[Checkins] SVN: z3c.blobfile/trunk/src/z3c/blobfile/interfaces.py - added consumable (for ZODB.blob.Blob) and openable specification

Grégoire Weber zope.org at incept.ch
Sun Nov 11 07:06:15 EST 2007


Log message for revision 81752:
  - added consumable (for ZODB.blob.Blob) and openable specification

Changed:
  A   z3c.blobfile/trunk/src/z3c/blobfile/interfaces.py

-=-
Added: z3c.blobfile/trunk/src/z3c/blobfile/interfaces.py
===================================================================
--- z3c.blobfile/trunk/src/z3c/blobfile/interfaces.py	                        (rev 0)
+++ z3c.blobfile/trunk/src/z3c/blobfile/interfaces.py	2007-11-11 12:06:14 UTC (rev 81752)
@@ -0,0 +1,44 @@
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation 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 interfaces
+
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
+import zope.interface
+
+import zope.app.file.interfaces
+
+class IConsumable(zope.interface.Interface):
+    """Support for Blob `consumeFile`
+    """
+
+    def __call__(data):
+        """Return a consumable file name or None
+
+        If the data doesn't represent a consumable file None is returned
+        """
+
+class IOpenable(zope.interface.Interface):
+    """Openable File
+    """
+
+    def open(mode):
+        """Open file and return the file descriptor
+        """
+
+class AmbiguousConsumables(Exception):
+    """More than one consumable
+    """



More information about the Checkins mailing list