zope.filerepresentation-3.6.1/0000775000177100020040000000000011665210415017526 5ustar menesismenesis00000000000000zope.filerepresentation-3.6.1/setup.py0000664000177100020040000000450711665210054021245 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2006-2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## # This package is developed by the Zope Toolkit project, documented here: # http://docs.zope.org/zopetoolkit # When developing and releasing this package, please follow the documented # Zope Toolkit policies as described by this documentation. ############################################################################## """Setup for zope.filerepresentation package """ import os from setuptools import setup, find_packages def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() setup(name='zope.filerepresentation', version='3.6.1', author='Zope Corporation and Contributors', author_email='zope-dev@zope.org', description='File-system Representation Interfaces', long_description=( read('README.txt') + '\n\n' + read('CHANGES.txt') ), keywords="zope3 filesystem representation", classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: Zope Public License', 'Programming Language :: Python', 'Natural Language :: English', 'Operating System :: OS Independent', 'Topic :: Internet :: WWW/HTTP', 'Framework :: Zope3'], url='http://pypi.python.org/pypi/zope.filerepresentation', license='ZPL 2.1', packages=find_packages('src'), package_dir={'': 'src'}, namespace_packages=['zope'], install_requires=['setuptools', 'zope.interface', 'zope.schema', ], include_package_data=True, zip_safe=True, ) zope.filerepresentation-3.6.1/CHANGES.txt0000664000177100020040000000154611665210054021344 0ustar menesismenesis00000000000000======= CHANGES ======= 3.6.1 (2011-11-29) ------------------ - Add undeclared ``zope.schema`` dependency. - Remove ``zope.testing`` test dependency and ``test`` extra. 3.6.0 (2009-10-08) ------------------ - Added `IRawReadFile` and `IRawWriteFile` interfaces. These extend `IReadFile` and `IWritefile`, respectively, to behave pretty much like a standard Python file object with a few embellishments. This in turn allows efficient, iterator- based implementations of file reading and writing. - Removed dependency on ``zope.container``: `IReadDirectory` and `IWriteDirectory` inherit only from interfaces defined in ``zope.interface`` and ``zope.interface.common.mapping``. 3.5.0 (2009-01-31) ------------------ - Changed use of ``zope.app.container`` to ``zope.container``. 3.4.0 (2007-10-02) ------------------ - Initial Zope-independent release. zope.filerepresentation-3.6.1/PKG-INFO0000664000177100020040000000436511665210415020633 0ustar menesismenesis00000000000000Metadata-Version: 1.0 Name: zope.filerepresentation Version: 3.6.1 Summary: File-system Representation Interfaces Home-page: http://pypi.python.org/pypi/zope.filerepresentation Author: Zope Corporation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: ============================== File Representation Interfaces ============================== Overview -------- File-system representation interfaces. The interfaces defined here are used for file-system and file-system-like representations of objects, such as file-system synchronization, FTP, PUT, and WebDAV. ======= CHANGES ======= 3.6.1 (2011-11-29) ------------------ - Add undeclared ``zope.schema`` dependency. - Remove ``zope.testing`` test dependency and ``test`` extra. 3.6.0 (2009-10-08) ------------------ - Added `IRawReadFile` and `IRawWriteFile` interfaces. These extend `IReadFile` and `IWritefile`, respectively, to behave pretty much like a standard Python file object with a few embellishments. This in turn allows efficient, iterator- based implementations of file reading and writing. - Removed dependency on ``zope.container``: `IReadDirectory` and `IWriteDirectory` inherit only from interfaces defined in ``zope.interface`` and ``zope.interface.common.mapping``. 3.5.0 (2009-01-31) ------------------ - Changed use of ``zope.app.container`` to ``zope.container``. 3.4.0 (2007-10-02) ------------------ - Initial Zope-independent release. Keywords: zope3 filesystem representation Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.filerepresentation-3.6.1/bootstrap.py0000664000177100020040000000330211665210054022112 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Bootstrap a buildout-based project Simply run this script in a directory containing a buildout.cfg. The script accepts buildout command-line options, so you can use the -c option to specify an alternate configuration file. """ import os, shutil, sys, tempfile, urllib2 tmpeggs = tempfile.mkdtemp() ez = {} exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' ).read() in ez ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) import pkg_resources cmd = 'from setuptools.command.easy_install import main; main()' if sys.platform == 'win32': cmd = '"%s"' % cmd # work around spawn lamosity on windows ws = pkg_resources.working_set assert os.spawnle( os.P_WAIT, sys.executable, sys.executable, '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', dict(os.environ, PYTHONPATH= ws.find(pkg_resources.Requirement.parse('setuptools')).location ), ) == 0 ws.add_entry(tmpeggs) ws.require('zc.buildout') import zc.buildout.buildout zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) shutil.rmtree(tmpeggs) zope.filerepresentation-3.6.1/COPYRIGHT.txt0000664000177100020040000000004011665210054021630 0ustar menesismenesis00000000000000Zope Foundation and Contributorszope.filerepresentation-3.6.1/src/0000775000177100020040000000000011665210415020315 5ustar menesismenesis00000000000000zope.filerepresentation-3.6.1/src/zope.filerepresentation.egg-info/0000775000177100020040000000000011665210415026665 5ustar menesismenesis00000000000000zope.filerepresentation-3.6.1/src/zope.filerepresentation.egg-info/PKG-INFO0000664000177100020040000000436511665210410027765 0ustar menesismenesis00000000000000Metadata-Version: 1.0 Name: zope.filerepresentation Version: 3.6.1 Summary: File-system Representation Interfaces Home-page: http://pypi.python.org/pypi/zope.filerepresentation Author: Zope Corporation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: ============================== File Representation Interfaces ============================== Overview -------- File-system representation interfaces. The interfaces defined here are used for file-system and file-system-like representations of objects, such as file-system synchronization, FTP, PUT, and WebDAV. ======= CHANGES ======= 3.6.1 (2011-11-29) ------------------ - Add undeclared ``zope.schema`` dependency. - Remove ``zope.testing`` test dependency and ``test`` extra. 3.6.0 (2009-10-08) ------------------ - Added `IRawReadFile` and `IRawWriteFile` interfaces. These extend `IReadFile` and `IWritefile`, respectively, to behave pretty much like a standard Python file object with a few embellishments. This in turn allows efficient, iterator- based implementations of file reading and writing. - Removed dependency on ``zope.container``: `IReadDirectory` and `IWriteDirectory` inherit only from interfaces defined in ``zope.interface`` and ``zope.interface.common.mapping``. 3.5.0 (2009-01-31) ------------------ - Changed use of ``zope.app.container`` to ``zope.container``. 3.4.0 (2007-10-02) ------------------ - Initial Zope-independent release. Keywords: zope3 filesystem representation Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.filerepresentation-3.6.1/src/zope.filerepresentation.egg-info/dependency_links.txt0000664000177100020040000000000111665210410032726 0ustar menesismenesis00000000000000 zope.filerepresentation-3.6.1/src/zope.filerepresentation.egg-info/namespace_packages.txt0000664000177100020040000000000511665210410033206 0ustar menesismenesis00000000000000zope zope.filerepresentation-3.6.1/src/zope.filerepresentation.egg-info/top_level.txt0000664000177100020040000000000511665210410031405 0ustar menesismenesis00000000000000zope zope.filerepresentation-3.6.1/src/zope.filerepresentation.egg-info/zip-safe0000664000177100020040000000000111665210055030315 0ustar menesismenesis00000000000000 zope.filerepresentation-3.6.1/src/zope.filerepresentation.egg-info/requires.txt0000664000177100020040000000004511665210410031257 0ustar menesismenesis00000000000000setuptools zope.interface zope.schemazope.filerepresentation-3.6.1/src/zope.filerepresentation.egg-info/SOURCES.txt0000664000177100020040000000104211665210410030541 0ustar menesismenesis00000000000000CHANGES.txt COPYRIGHT.txt LICENSE.txt README.txt bootstrap.py buildout.cfg setup.py src/zope/__init__.py src/zope.filerepresentation.egg-info/PKG-INFO src/zope.filerepresentation.egg-info/SOURCES.txt src/zope.filerepresentation.egg-info/dependency_links.txt src/zope.filerepresentation.egg-info/namespace_packages.txt src/zope.filerepresentation.egg-info/requires.txt src/zope.filerepresentation.egg-info/top_level.txt src/zope.filerepresentation.egg-info/zip-safe src/zope/filerepresentation/__init__.py src/zope/filerepresentation/interfaces.pyzope.filerepresentation-3.6.1/src/zope/0000775000177100020040000000000011665210415021272 5ustar menesismenesis00000000000000zope.filerepresentation-3.6.1/src/zope/filerepresentation/0000775000177100020040000000000011665210415025174 5ustar menesismenesis00000000000000zope.filerepresentation-3.6.1/src/zope/filerepresentation/__init__.py0000664000177100020040000000001711665210054027302 0ustar menesismenesis00000000000000# Import this. zope.filerepresentation-3.6.1/src/zope/filerepresentation/interfaces.py0000664000177100020040000001653711665210054027704 0ustar menesismenesis00000000000000############################################################################## # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. ############################################################################## """File-system representation interfaces The interfaces defined here are used for file-system and file-system-like representations of objects, such as file-system synchronization, FTP, PUT, and WebDAV. There are three issues we need to deal with: File system representation Every object is either a directory or a file. Properties There are two kinds of proprties: - Data properties Data properties are handled directly by the object implementation. - Meta-data properties Meta data properties are handled via annotations. Completeness We must have a complete lossless data representation for file-system synchronization. This is achieved through serialization of: - All annotations (not just properties), and - Extra data. Strategies for common access mechanisms: FTP - For getting directory info (statish) information: - Use Zope DublinCore to get modification times - Show as readable if we can access a read method. - Show as writable if we can access a write method. FTP and WebDAV - Treat as a directory if there is an adapter to `IReadDirectory`. Treat as a file otherwise. - For creating objects: - Directories: Look for an `IDirectoryFactory` adapter. - Files First lookj for a `IFileFactory` adapter with a name that is the same as the extention (e.g. ".pt"). Then look for an unnamed `IFileFactory` adapter. File-system synchronization Because this must be lossless, we will use class-based adapters for this, but we want to make it as easy as possible to use other adapters as well. For reading, there must be a class adapter to `IReadSync`. We will then apply rules similar to those above. """ __docformat__ = 'restructuredtext' from zope.interface import Interface from zope import schema from zope.interface.common.mapping import IEnumerableMapping, IItemMapping, \ IReadMapping class IReadFile(Interface): """Provide read access to file data """ def read(): """Return the file data """ def size(): """Return the data length in bytes. """ class IWriteFile(Interface): def write(data): """Update the file data """ class ICommonFileOperations(Interface): """Common file operations used by IRawReadFile and IRawWriteFile """ mimeType = schema.ASCIILine( title=u"File MIME type", description=u"Provided if it makes sense for this file data" + u"May be set prior to writing data to a file that " + u"is writeable. It is an error to set this on a " + u"file that is not writable.", readonly=True, ) encoding = schema.Bool( title=u"The encoding that this file uses", description=u"Provided if it makes sense for this file data" + u"May be set prior to writing data to a file that " + u"is writeable. It is an error to set this on a " + u"file that is not writable.", required=False, ) closed = schema.Bool( title=u"Is the file closed?", required=True, ) name = schema.TextLine( title=u"A representative file name", description=u"Provided if it makes sense for this file data" + u"May be set prior to writing data to a file that " + u"is writeable. It is an error to set this on a " + u"file that is not writable.", required=False, ) def seek(offset, whence=None): """Seek the file. See Python documentation for ``file`` for details. """ def tell(): """Return the file's current position. """ def close(): """Close the file. See Python documentation for ``file`` for details. """ class IRawReadFile(IReadFile, ICommonFileOperations): """Specialisation of IReadFile to make it act more like a Python file object. """ def read(size=None): """Read at most ``size`` bytes of file data. If ``size`` is None, return all the file data. """ def readline(size=None): """Read one entire line from the file. See Python documentation for ``file`` for details. """ def readlines(sizehint=None): """Read until EOF using readline() and return a list containing the lines thus read. See Python documentation for ``file`` for details. """ def __iter__(): """Return an iterator for the file. Note that unlike a Python standard ``file``, this does not necessarily have to return data line-by-line if doing so is inefficient. """ def next(): """Iterator protocol. See Python documentation for ``file`` for details. """ class IRawWriteFile(IWriteFile, ICommonFileOperations): """Specialisation of IWriteFile to make it act more like a Python file object. """ def write(data): """Write a chunk of data to the file. See Python documentation for ``file`` for details. """ def writelines(sequence): """Write a sequence of strings to the file. See Python documentation for ``file`` for details. """ def truncate(size): """Truncate the file. See Python documentation for ``file`` for details. """ def flush(): """Flush the file. See Python documentation for ``file`` for details. """ class IReadDirectory(IEnumerableMapping, IItemMapping, IReadMapping): """Objects that should be treated as directories for reading """ class IWriteDirectory(Interface): """Objects that should be treated as directories for writing """ def __setitem__(name, object): """Add the given `object` to the directory under the given name.""" def __delitem__(name): """Delete the named object from the directory.""" class IDirectoryFactory(Interface): def __call__(name): """Create a directory where a directory is an object with adapters to IReadDirectory and IWriteDirectory. """ class IFileFactory(Interface): def __call__(name, content_type, data): """Create a file where a file is an object with adapters to `IReadFile` and `IWriteFile`. The file `name`, content `type`, and `data` are provided to help create the object. """ # TODO: we will add additional interfaces for WebDAV and File-system # synchronization. zope.filerepresentation-3.6.1/src/zope/__init__.py0000664000177100020040000000007011665210054023377 0ustar menesismenesis00000000000000__import__('pkg_resources').declare_namespace(__name__) zope.filerepresentation-3.6.1/buildout.cfg0000664000177100020040000000015111665210054022032 0ustar menesismenesis00000000000000[buildout] develop = . parts = test [test] recipe = zc.recipe.testrunner eggs = zope.filerepresentation zope.filerepresentation-3.6.1/README.txt0000664000177100020040000000047211665210054021226 0ustar menesismenesis00000000000000============================== File Representation Interfaces ============================== Overview -------- File-system representation interfaces. The interfaces defined here are used for file-system and file-system-like representations of objects, such as file-system synchronization, FTP, PUT, and WebDAV. zope.filerepresentation-3.6.1/setup.cfg0000664000177100020040000000007311665210415021347 0ustar menesismenesis00000000000000[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 zope.filerepresentation-3.6.1/LICENSE.txt0000664000177100020040000000402611665210054021352 0ustar menesismenesis00000000000000Zope Public License (ZPL) Version 2.1 A copyright notice accompanies this license document that identifies the copyright holders. This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF). Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders. 4. The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders. 5. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. Disclaimer THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.