/usr/share/pyshared/zope/site/tests/folder.txt is in python-zope.site 3.9.2-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | ===============================
File representation for Folders
===============================
Folders can be represented in file-system-like protocols (e.g. FTP). An
adapter abstracts some internals away and adds support for accessing the
'++etc++site' folder from those protocols.
>>> from zope.site.folder import rootFolder
>>> from zope.container.directory import ReadDirectory
>>> folder = rootFolder()
>>> from zope.site.site import LocalSiteManager
>>> folder.setSiteManager(LocalSiteManager(folder))
>>> fs_folder = ReadDirectory(folder)
As the root folder is a site, the ++etc++site object appears:
>>> fs_folder.keys()
['++etc++site']
>>> fs_folder.get('++etc++site')
<LocalSiteManager ++etc++site>
>>> fs_folder['++etc++site']
<LocalSiteManager ++etc++site>
>>> list(fs_folder.__iter__())
['++etc++site']
>>> fs_folder.values()
[<LocalSiteManager ++etc++site>]
>>> len(fs_folder)
1
>>> fs_folder.items()
[('++etc++site', <LocalSiteManager ++etc++site>)]
>>> '++etc++site' in fs_folder
True
Let's add another folder to see how a non-site folder behaves:
>>> from zope.site.folder import Folder
>>> folder['test'] = Folder()
The site folder now contains the new folder:
>>> fs_folder.keys()
[u'test', '++etc++site']
>>> fs_folder.get('test')
<zope.site.folder.Folder object at 0x...>
>>> fs_folder['test']
<zope.site.folder.Folder object at 0x...>
>>> list(fs_folder.__iter__())
[u'test', '++etc++site']
>>> fs_folder.values()
[<zope.site.folder.Folder object at 0x...>, <LocalSiteManager ++etc++site>]
>>> len(fs_folder)
2
>>> fs_folder.items()
[(u'test', <zope.site.folder.Folder object at 0x...>),
('++etc++site', <LocalSiteManager ++etc++site>)]
>>> 'test' in fs_folder
True
|