[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/content - i18nimage.py:1.2.26.1 sql.py:1.4.10.1

Grégoire Weber zope@i-con.ch
Sun, 22 Jun 2003 10:24:14 -0400


Update of /cvs-repository/Zope3/src/zope/app/interfaces/content
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/app/interfaces/content

Modified Files:
      Tag: cw-mail-branch
	i18nimage.py sql.py 
Log Message:
Synced up with HEAD

=== Zope3/src/zope/app/interfaces/content/i18nimage.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/app/interfaces/content/i18nimage.py:1.2	Wed Dec 25 09:12:59 2002
+++ Zope3/src/zope/app/interfaces/content/i18nimage.py	Sun Jun 22 10:23:13 2003
@@ -20,6 +20,7 @@
 from zope.app.interfaces.content.i18nfile import II18nFile
 from zope.app.content.i18nfile import I18nFile
 from zope.app.interfaces.annotation import IAnnotatable
+from zope.interface import implements
 
 
 class II18nImage(II18nFile, IImage):
@@ -31,16 +32,11 @@
     languages share the same content type.
     """
 
-    __implements__ = (
-        II18nImage,
-        IAnnotatable,
-        )
-
+    implements(II18nImage, IAnnotatable)
 
     def _create(self, data):
         return Image(data)
 
-
     def setData(self, data, language=None):
         '''See interface IFile'''
         super(I18nImage, self).setData(data, language)
@@ -52,7 +48,6 @@
             contentType = getImageInfo(self.getData(language))[0]
             if contentType:
                 self.setContentType(contentType)
-
 
     def getImageSize(self, language=None):
         '''See interface IImage'''


=== Zope3/src/zope/app/interfaces/content/sql.py 1.4 => 1.4.10.1 ===
--- Zope3/src/zope/app/interfaces/content/sql.py:1.4	Thu May  1 15:35:22 2003
+++ Zope3/src/zope/app/interfaces/content/sql.py	Sun Jun 22 10:23:13 2003
@@ -17,19 +17,25 @@
 import zope.schema
 
 from zope.app.interfaces.rdb import ISQLCommand
-from zope.component import getService
-from zope.proxy.context import ContextProperty
+from zope.component import getService, ComponentLookupError
+from zope.context import ContextProperty
 from zope.app.i18n import ZopeMessageIDFactory as _
 
+class MissingInput(Exception):
+    pass
 
 class SQLConnectionName(zope.schema.TextLine):
     """SQL Connection Name"""
 
     def __allowed(self):
         """Note that this method works only if the Field is context wrapped."""
-        connection_service = getService(self.context, "SQLDatabaseConnections")
-        connections = connection_service.getAvailableConnections()
-        return connections
+        try:
+            connection_service = getService(self.context,
+                                            "SQLDatabaseConnections")
+        except ComponentLookupError:
+            return []
+        
+        return connection_service.getAvailableConnections()
 
     allowed_values = ContextProperty(__allowed)
 
@@ -52,28 +58,8 @@
         description=_(u"The source of the page template."),
         required=True)
 
-    def setArguments(arguments):
-        """Processes the arguments (which could be a dict, string or whatever)
-        to arguments as they are needed for the rendering process."""
-
     def getArguments():
-        """Get the arguments. A method is preferred here, since some argument
-        evaluation might be done."""
-
-    def getArgumentsString():
-        """This method returns the arguments string."""
-
-    def setSource(source):
-        """Save the source of the page template."""
-
-    def getSource():
-        """Get the source of the page template."""
+        """Returns a set of arguments. Note that this is not a string!"""
 
     def getTemplate():
         """Get the SQL DTML Template object."""
-
-    def setConnectionName(name):
-        """Save the connection name for this SQL Script."""
-
-    def getConnectionName():
-        """Get the connection name for this SQL Script."""