[Zope3-checkins] CVS: Zope3/src/zope/interfaces - configuration.py:1.1.2.2 event.py:1.1.2.3 i18n.py:1.1.2.2
Tim Peters
tim.one@comcast.net
Tue, 24 Dec 2002 21:21:41 -0500
Update of /cvs-repository/Zope3/src/zope/interfaces
In directory cvs.zope.org:/tmp/cvs-serv19240/src/zope/interfaces
Modified Files:
Tag: NameGeddon-branch
configuration.py event.py i18n.py
Log Message:
Whitespace normalization, via Python's Tools/scripts/reindent.py. The
files are fixed-points of that script now. Fixed a few cases where
code relied on significant trailing whitespace (ouch).
=== Zope3/src/zope/interfaces/configuration.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/interfaces/configuration.py:1.1.2.1 Mon Dec 23 14:32:58 2002
+++ Zope3/src/zope/interfaces/configuration.py Tue Dec 24 21:21:10 2002
@@ -2,14 +2,14 @@
#
# 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.0 (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.
-#
+#
##############################################################################
"""Configuration directives that have subdirectives
@@ -78,16 +78,16 @@
Provide methods for registered subdirectives. The methods are
typically IEmptyDirective objects. They could, theoretically be
- INonEmptyDirective objects.
+ INonEmptyDirective objects.
Also provide a call that can provide additional configuration
- actions.
-
+ actions.
+
"""
def __call__():
"""Return a sequence of configuration actions.
-
+
See IEmptyDirective for a definition of configuration actions.
This method should be called *after* any subdirective methods are
=== Zope3/src/zope/interfaces/event.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/interfaces/event.py:1.1.2.2 Tue Dec 24 07:51:27 2002
+++ Zope3/src/zope/interfaces/event.py Tue Dec 24 21:21:10 2002
@@ -2,14 +2,14 @@
#
# 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.0 (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.
-#
+#
##############################################################################
"""
@@ -52,9 +52,9 @@
def subscribe(subscriber, event_type=IEvent, filter=None):
"""Add subscriber to the list of subscribers for the channel.
-
+
subscriber must implement ISubscriber.
-
+
event_type, if supplied, is the event interface
about which subscriber should be notified, and must implement
IEvent. The subscriber will be notified of all events of this
@@ -69,36 +69,36 @@
already been subscribed with the same event type and
filter. In this case the subscriber will receive multiple
calls to its notify method.
-
+
If the subscriber implements ISubscriptionAware, this function
will call the subscriber's subscribedTo method.
"""
-
+
def unsubscribe(subscriber, event_type=None, filter=None):
"""Unsubscribe subscriber from receiving event types from this
subscribable.
-
+
If event_type is None, the default value, the subscriber is
unsubscribed completely for all event types from this
subscribable (and its parents, if the subscribable is a placeful
service). The filter argument is ignored in this case. If no
subscriptions for this subscriber are present, no error is
raised.
-
+
If event_type is supplied, this method will unsubscribe the
subscriber from one subscription exactly matching the
event_type/filter pair given (the default filter being None).
If other subscriptions are present they will remain. If the
subscription cannot be found and the subscribable is a placeful
service, the unsubscription request is passed to parent
- services. Raises NotFound if subscriber wasn't
+ services. Raises NotFound if subscriber wasn't
subscribed as expected.
-
+
If the subscriber implements ISubscriptionAware, this function
will call the subscriber's unsubscribedFrom method for each
individual unsubscribe.
"""
-
+
def listSubscriptions(subscriber, event_type=None):
"""Returns an iterator of the subscriptions to this channel for
the subscriber. If event_type is supplied, the list is limited
@@ -130,7 +130,7 @@
class IIndirectSubscriber(ISubscriber):
"""Interface for objects that handle subscriptions for another object."""
-
+
def __eq__(other):
"""Compare two indirect subscribers
@@ -138,8 +138,8 @@
same object.
"""
-
-
+
+
"""
@@ -153,8 +153,8 @@
class IEventChannel(ISubscribable, ISubscriber):
"""Interface for objects which distribute events to subscribers. """
-
-
+
+
"""
@@ -168,23 +168,23 @@
# between two objects, not events of general interest.
class ISubscriptionAware(Interface):
-
+
def subscribedTo(subscribable, event_type, filter):
"""Alerts the object that it has subscribed, via a call from
itself or from another object, to the subscribable. The
event_type and filter match the arguments provided to the
ISubscribable.subscribe.
-
+
The subscribable must be appropriately placefully wrapped (note
that the global event service will have no wrapping)."""
-
+
def unsubscribedFrom(subscribable, event_type, filter):
"""Alerts the object that it has unsubscribed, via a call from
itself or from another object, to the subscribable. The
event_type and filter match the exact event_type and filter of
the deleted subscription, rather than, necessarily, the
arguments provided to the ISubscribable.unsubscribe.
-
+
The subscribable must be appropriately placefully wrapped (note
that the global event service will have no wrapping)."""
@@ -200,17 +200,16 @@
class IEventService(ISubscribable):
"""The EventService service is the 'root channel'.
-
+
Its subscribers include other channels.
It is also the 'default destination' for events
when they are generated.
"""
-
+
def publish(event):
"""Notify all subscribers of the channel of event.
Events will often be propagated to higher level IEventServices;
This is a policy decision for the IEventService.
"""
-
=== Zope3/src/zope/interfaces/i18n.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/interfaces/i18n.py:1.1.2.1 Mon Dec 23 14:32:58 2002
+++ Zope3/src/zope/interfaces/i18n.py Tue Dec 24 21:21:10 2002
@@ -2,14 +2,14 @@
#
# 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.0 (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.
-#
+#
##############################################################################
"""Internationalization of content objects.
@@ -24,13 +24,13 @@
"""
def getDefaultLanguage():
- """Return the default language."""
+ """Return the default language."""
def setDefaultLanguage(language):
- """Set the default language, which will be used if the language is not
- specified, or not available.
- """
-
+ """Set the default language, which will be used if the language is not
+ specified, or not available.
+ """
+
def getAvailableLanguages():
"""Find all the languages that are available."""
@@ -64,7 +64,7 @@
text representation.
Note: The IReadMessageCatalog is the absolut minimal version required for
- the TranslationService to function.
+ the TranslationService to function.
"""
def getMessage(msgid):
@@ -81,7 +81,7 @@
def getLanguage():
"""Return the language this message catalog is representing."""
-
+
def getDomain():
"""Return the domain this message catalog is serving."""
@@ -126,7 +126,7 @@
class IMessageCatalog(IReadMessageCatalog, IWriteMessageCatalog):
- """Most message catalogs should support this interface.
+ """Most message catalogs should support this interface.
"""
@@ -175,7 +175,7 @@
Also note that language tags are defined by RFC 1766.
"""
- def translate(domain, msgid, mapping=None,
+ def translate(domain, msgid, mapping=None,
context=None, target_language=None):
"""Return the translation for the message referred to by msgid.
@@ -185,7 +185,7 @@
The method also looks for a possible language to translate to.
After a translation it also replaces any $name variable variables
inside the post-translation string.
-
+
Note: The TranslationService interface does not support simplified
translation methods, since it is totally hidden by ZPT and in
Python you should use a Domain object, since it supports all
@@ -202,21 +202,21 @@
class IWriteTranslationService(Interface):
"""This interface describes the methods that are necessary for an editable
Translation Service to work.
-
+
For a translation service to be editable its 'messages' have to support
the following information: id, string, domain, language, date
-
+
Most of the information will be natural, since they are required by the
- translation service, but especially the date is not a necessary info
- (in fact, it is meta data)
+ translation service, but especially the date is not a necessary info
+ (in fact, it is meta data)
"""
-
+
def getMessageIdsOfDomain(domain, filter='%'):
"""Get all the message ids of a particular domain."""
def getMessagesOfDomain(domain):
"""Get all the messages of a particular domain."""
-
+
def getMessage(msgid, domain, langauge):
"""Get the full message of a particular domain and language."""
@@ -231,7 +231,7 @@
def getAvailableDomains(language):
"""Find all available domains."""
-
+
def addMessage(domain, msgid, msg, language, mod_time=None):
"""Add a message to the translation service.
@@ -246,7 +246,7 @@
def deleteMessage(domain, msgid, language):
"""Delete a messahe in the translation service."""
-
+
def addLanguage(language):
"""Add Language to Translation Service"""
@@ -334,7 +334,7 @@
from zope.interface import Interface
class ILanguageAvailability(Interface):
-
+
def getAvailableLanguages():
"""Return a sequence of language tags for available languages
"""
@@ -351,7 +351,7 @@
"""This interface provides language negotiation based on user preferences.
"""
-
+
def getPreferredLanguages():
"""Return a sequence of user preferred languages.
"""
@@ -418,7 +418,7 @@
"""A language negotiation service.
"""
-
+
def getLanguage(langs, env):
"""Return the matching language to use.
@@ -455,7 +455,7 @@
class IUserPreferredCharsets(Interface):
"""This interface provides charset negotiation based on user preferences.
"""
-
+
def getPreferredCharsets():
"""Return a sequence of user preferred charsets. Note that the order
should describe the order of preference. Therefore the first