[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/i18n/ Update doc
strings to ReST
Phil Ruggera
pruggera at san.rr.com
Wed Aug 4 00:00:36 EDT 2004
Log message for revision 26889:
Update doc strings to ReST
Changed:
U Zope3/trunk/src/zope/app/i18n/__init__.py
U Zope3/trunk/src/zope/app/i18n/browser/__init__.py
U Zope3/trunk/src/zope/app/i18n/browser/exportimport.py
U Zope3/trunk/src/zope/app/i18n/browser/synchronize.py
U Zope3/trunk/src/zope/app/i18n/browser/translate.py
U Zope3/trunk/src/zope/app/i18n/filters.py
U Zope3/trunk/src/zope/app/i18n/interfaces.py
U Zope3/trunk/src/zope/app/i18n/messagecatalog.py
U Zope3/trunk/src/zope/app/i18n/metaconfigure.py
U Zope3/trunk/src/zope/app/i18n/translationdomain.py
U Zope3/trunk/src/zope/app/i18n/xmlrpc/methods.py
-=-
Modified: Zope3/trunk/src/zope/app/i18n/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/__init__.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/__init__.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.i18n.messageid import MessageIDFactory
# Import _ to use to create message ids in the zope domain
Modified: Zope3/trunk/src/zope/app/i18n/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/browser/__init__.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/browser/__init__.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.i18n.interfaces import ITranslationDomain
class BaseView(object):
Modified: Zope3/trunk/src/zope/app/i18n/browser/exportimport.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/browser/exportimport.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/browser/exportimport.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.app.i18n.browser import BaseView
from zope.i18n.interfaces import IMessageExportFilter, IMessageImportFilter
Modified: Zope3/trunk/src/zope/app/i18n/browser/synchronize.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/browser/synchronize.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/browser/synchronize.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
import httplib
import urllib
import xmlrpclib
@@ -68,7 +70,7 @@
def _disconnect(self):
- '''Disconnect from the sever; return None'''
+ '''Disconnect from the sever; return ``None``'''
if hasattr(self, '_connection') and self._connection is not None:
self._connection = None
Modified: Zope3/trunk/src/zope/app/i18n/browser/translate.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/browser/translate.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/browser/translate.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.app.i18n.browser import BaseView
class Translate(BaseView):
Modified: Zope3/trunk/src/zope/app/i18n/filters.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/filters.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/filters.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
import time, re
from types import StringTypes
from zope.interface import implements
Modified: Zope3/trunk/src/zope/app/i18n/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/interfaces.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/interfaces.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.interface import Interface
from zope.i18n.interfaces import ITranslationDomain, IMessageCatalog
from zope.app.container.interfaces import IContainer
@@ -50,13 +52,13 @@
def addMessage(msgid, msg, language, mod_time=None):
"""Add a message to the translation domain.
- If mod_time is None, then the current time should be inserted.
+ If `mod_time` is ``None``, then the current time should be inserted.
"""
def updateMessage(msgid, msg, language, mod_time=None):
"""Update a message in the translation domain.
- If mod_time is None, then the current time should be inserted.
+ If `mod_time` is ``None``, then the current time should be inserted.
"""
def deleteMessage(domain, msgid, language):
@@ -71,7 +73,7 @@
class ISyncTranslationDomain(Interface):
"""This interface allows translation domains to be synchronized. The
- following four synchronization states can exist:
+ following four synchronization states can exist::
0 - uptodate: The two messages are in sync.
Default Action: Do nothing.
@@ -110,7 +112,7 @@
"""This is the common and full-features translation domain. Almost all
translation domain implementations will use this interface.
- An exception to this is the GlobalMessageCatalog as it will be read-only.
+ An exception to this is the `GlobalMessageCatalog` as it will be read-only.
"""
@@ -119,21 +121,21 @@
able to update our messages.
Note that not all methods here require write access, but they should
- not be required for an IReadMessageCatalog and are used for editing
+ not be required for an `IReadMessageCatalog` and are used for editing
only. Therefore this is the more suitable interface to put them.
"""
def getFullMessage(msgid):
"""Get the message data and meta data as a nice dictionary. More
advanced implementation might choose to return an object with
- the data, but the object should then implement IEnumerableMapping.
+ the data, but the object should then implement `IEnumerableMapping`.
An exception is raised if the message id is not found.
"""
def setMessage(msgid, message, mod_time=None):
- """Set a message to the catalog. If mod_time is None use the current
- time instead as modification time."""
+ """Set a message to the catalog. If `mod_time` is ``None`` use the
+ current time instead as modification time."""
def deleteMessage(msgid):
"""Delete a message from the catalog."""
Modified: Zope3/trunk/src/zope/app/i18n/messagecatalog.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/messagecatalog.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/messagecatalog.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.interface import classProvides, providedBy, implements
import time
@@ -40,11 +42,11 @@
self._messages = OOBTree()
def getMessage(self, id):
- 'See IReadMessageCatalog'
+ 'See `IReadMessageCatalog`'
return removeAllProxies(self._messages[id][0])
def queryMessage(self, id, default=None):
- 'See IReadMessageCatalog'
+ 'See `IReadMessageCatalog`'
result = removeAllProxies(self._messages.get(id))
if result is not None:
result = result[0]
@@ -53,11 +55,11 @@
return result
def getIdentifier(self):
- 'See IReadMessageCatalog'
+ 'See `IReadMessageCatalog`'
return (self.language, self.domain)
def getFullMessage(self, msgid):
- 'See IWriteMessageCatalog'
+ 'See `IWriteMessageCatalog`'
message = removeAllProxies(self._messages[msgid])
return {'domain' : self.domain,
'language' : self.language,
@@ -66,13 +68,13 @@
'mod_time' : message[1]}
def setMessage(self, msgid, message, mod_time=None):
- 'See IWriteMessageCatalog'
+ 'See `IWriteMessageCatalog`'
if mod_time is None:
mod_time = int(time.time())
self._messages[msgid] = (message, mod_time)
def deleteMessage(self, msgid):
- 'See IWriteMessageCatalog'
+ 'See `IWriteMessageCatalog`'
del self._messages[msgid]
def getMessageIds(self):
@@ -80,7 +82,7 @@
return list(self._messages.keys())
def getMessages(self):
- 'See IWriteMessageCatalog'
+ 'See `IWriteMessageCatalog`'
messages = []
for message in self._messages.items():
messages.append({'domain' : self.domain,
@@ -91,7 +93,7 @@
return messages
def getInterfaces(self):
- 'See IFactory'
+ 'See `IFactory`'
return tuple(providedBy(self))
getInterfaces = classmethod(getInterfaces)
Modified: Zope3/trunk/src/zope/app/i18n/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/metaconfigure.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/metaconfigure.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
import os
from zope.app.component.metaconfigure import utility
Modified: Zope3/trunk/src/zope/app/i18n/translationdomain.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/translationdomain.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/translationdomain.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
import re
from BTrees.OOBTree import OOBTree
from zope.interface import implements
@@ -64,7 +66,7 @@
def translate(self, msgid, mapping=None, context=None,
target_language=None, default=None):
- """See interface ITranslationService"""
+ """See interface `ITranslationService`"""
if target_language is None and context is not None:
avail_langs = self.getAvailableLanguages()
# Let's negotiate the language to translate to. :)
@@ -95,7 +97,7 @@
def getMessageIds(self, filter='%'):
- 'See IWriteTranslationDomain'
+ 'See `IWriteTranslationDomain`'
filter = filter.replace('%', '.*')
filter_re = re.compile(filter)
@@ -108,7 +110,7 @@
return msgids.keys()
def getMessages(self):
- 'See IWriteTranslationDomain'
+ 'See `IWriteTranslationDomain`'
messages = []
languages = self.getAvailableLanguages()
for language in languages:
@@ -118,7 +120,7 @@
def getMessage(self, msgid, language):
- 'See IWriteTranslationService'
+ 'See `IWriteTranslationService`'
for name in self._catalogs.get(language, []):
try:
return self[name].getFullMessage(msgid)
@@ -127,7 +129,7 @@
return None
def getAllLanguages(self):
- 'See IWriteTranslationService'
+ 'See `IWriteTranslationService`'
languages = {}
for key in self._catalogs.keys():
languages[key] = None
@@ -135,12 +137,12 @@
def getAvailableLanguages(self):
- 'See IWriteTranslationService'
+ 'See `IWriteTranslationService`'
return list(self._catalogs.keys())
def addMessage(self, msgid, msg, language, mod_time=None):
- 'See IWriteTranslationService'
+ 'See `IWriteTranslationService`'
if not self._catalogs.has_key(language):
if language not in self.getAllLanguages():
self.addLanguage(language)
@@ -151,27 +153,27 @@
def updateMessage(self, msgid, msg, language, mod_time=None):
- 'See IWriteTranslationService'
+ 'See `IWriteTranslationService`'
catalog_name = self._catalogs[language][0]
catalog = self[catalog_name]
catalog.setMessage(msgid, msg, mod_time)
def deleteMessage(self, msgid, language):
- 'See IWriteTranslationService'
+ 'See `IWriteTranslationService`'
catalog_name = self._catalogs[language][0]
catalog = self[catalog_name]
catalog.deleteMessage(msgid)
def addLanguage(self, language):
- 'See IWriteTranslationService'
+ 'See `IWriteTranslationService`'
catalog = zapi.createObject(None, 'Message Catalog', language)
self[language] = catalog
def deleteLanguage(self, language):
- 'See IWriteTranslationService'
+ 'See `IWriteTranslationService`'
# Delete all catalogs from the data storage
for name in self._catalogs[language]:
if self.has_key(name):
@@ -181,7 +183,7 @@
def getMessagesMapping(self, languages, foreign_messages):
- 'See ISyncTranslationService'
+ 'See `ISyncTranslationService`'
mapping = {}
# Get all relevant local messages
local_messages = []
@@ -203,7 +205,7 @@
def synchronize(self, messages_mapping):
- 'See ISyncTranslationService'
+ 'See `ISyncTranslationService`'
for value in messages_mapping.values():
fmsg = value[0]
Modified: Zope3/trunk/src/zope/app/i18n/xmlrpc/methods.py
===================================================================
--- Zope3/trunk/src/zope/app/i18n/xmlrpc/methods.py 2004-08-03 22:59:11 UTC (rev 26888)
+++ Zope3/trunk/src/zope/app/i18n/xmlrpc/methods.py 2004-08-04 04:00:36 UTC (rev 26889)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.proxy import removeAllProxies
from zope.app.publisher.xmlrpc import XMLRPCView
More information about the Zope3-Checkins
mailing list