--- a/entities/authobjs.py Thu Apr 30 00:40:35 2009 +0200
+++ b/entities/authobjs.py Thu Apr 30 00:41:10 2009 +0200
@@ -24,7 +24,7 @@
id = 'CWUser'
fetch_attrs, fetch_order = fetch_config(['login', 'firstname', 'surname'])
fetch_unrelated_order = fetch_order
-
+
# used by repository to check if the user can log in or not
AUTHENTICABLE_STATES = ('activated',)
@@ -37,7 +37,7 @@
self._groups = groups
if properties is not None:
self._properties = properties
-
+
@property
def groups(self):
try:
@@ -45,7 +45,7 @@
except AttributeError:
self._groups = set(g.name for g in self.in_group)
return self._groups
-
+
@property
def properties(self):
try:
@@ -64,7 +64,7 @@
except ValueError:
self.warning('incorrect value for eproperty %s of user %s', key, self.login)
return self.vreg.property_value(key)
-
+
def matching_groups(self, groups):
"""return the number of the given group(s) in which the user is
@@ -86,7 +86,7 @@
""" checks if user is an anonymous user"""
#FIXME on the web-side anonymous user is detected according
# to config['anonymous-user'], we don't have this info on
- # the server side.
+ # the server side.
return self.groups == frozenset(('guests', ))
def owns(self, eid):
@@ -116,12 +116,12 @@
return self.req.execute(rql, kwargs, cachekey)
except Unauthorized:
return False
-
+
# presentation utilities ##################################################
-
+
def name(self):
"""construct a name using firstname / surname or login if not defined"""
-
+
if self.firstname and self.surname:
return self.req._('%(firstname)s %(surname)s') % {
'firstname': self.firstname, 'surname' : self.surname}
--- a/interfaces.py Thu Apr 30 00:40:35 2009 +0200
+++ b/interfaces.py Thu Apr 30 00:41:10 2009 +0200
@@ -11,7 +11,7 @@
class IEmailable(Interface):
"""interface for emailable entities"""
-
+
def get_email(self):
"""return email address"""
@@ -28,7 +28,7 @@
def as_email_context(self):
"""returns the dictionary as used by the sendmail controller to
build email bodies.
-
+
NOTE: the dictionary keys should match the list returned by the
`allowed_massmail_keys` method.
"""
@@ -45,12 +45,12 @@
"""change the entity's state according to a state defined in given
parameters
"""
-
+
def can_pass_transition(self, trname):
"""return true if the current user can pass the transition with the
given name
"""
-
+
def latest_trinfo(self):
"""return the latest transition information for this entity
"""
@@ -73,7 +73,7 @@
@property
def todo(self):
"""what remains to be done"""
-
+
def progress_info(self):
"""returns a dictionary describing progress/estimated cost of the
version.
@@ -93,19 +93,19 @@
def progress(self):
"""returns the % progress of the task item"""
-
-
+
+
class IMileStone(IProgress):
"""represents an ITask's item"""
-
+
parent_type = None # specify main task's type
-
+
def get_main_task(self):
"""returns the main ITask entity"""
def initial_prevision_date(self):
"""returns the initial expected end of the milestone"""
-
+
def eta_date(self):
"""returns expected date of completion based on what remains
to be done
@@ -128,7 +128,7 @@
def __iter__(self):
"""iterates over the item's children"""
-
+
def is_leaf(self):
"""returns true if this node as no child"""
@@ -146,7 +146,7 @@
"""interface for entities which can be linked to a previous and/or next
entity
"""
-
+
def next_entity(self):
"""return the 'next' entity"""
def previous_entity(self):
@@ -155,10 +155,10 @@
class IBreadCrumbs(Interface):
"""interface for entities which can be "located" on some path"""
-
+
def breadcrumbs(self, view, recurs=False):
"""return a list containing some:
-
+
* tuple (url, label)
* entity
* simple label string
@@ -173,7 +173,7 @@
class IDownloadable(Interface):
"""interface for downloadable entities"""
-
+
def download_url(self): # XXX not really part of this interface
"""return an url to download entity's content"""
def download_content_type(self):
@@ -188,31 +188,31 @@
class IEmbedable(Interface):
"""interface for embedable entities"""
-
+
def embeded_url(self):
"""embed action interface"""
-
+
class ICalendarable(Interface):
"""interface for items that do have a begin date 'start' and an end date 'stop'
- """
-
+ """
+
class ICalendarViews(Interface):
"""calendar views interface"""
def matching_dates(self, begin, end):
"""
:param begin: day considered as begin of the range (`DateTime`)
:param end: day considered as end of the range (`DateTime`)
-
+
:return:
a list of dates (`DateTime`) in the range [`begin`, `end`] on which
this entity apply
"""
-
+
class ITimetableViews(Interface):
"""timetable views interface"""
def timetable_date(self):
"""XXX explain
-
+
:return: date (`DateTime`)
"""
@@ -231,17 +231,18 @@
"""returns the icon that should be used as the marker
(returns None for default)
"""
-
+
class IFeed(Interface):
"""interface for entities with rss flux"""
-
+
def rss_feed_url(self):
"""return an url which layout sub-entities item
"""
+
class ISiocItem(Interface):
"""interface for entities (which are item
in sioc specification) with sioc views"""
-
+
def isioc_content(self):
"""return content entity"""
@@ -252,11 +253,11 @@
"""return container type (post, BlogPost, MailMessage)"""
def isioc_replies(self):
- """return replies items"""
+ """return replies items"""
def isioc_topics(self):
"""return topics items"""
-
+
class ISiocContainer(Interface):
"""interface for entities (which are container
in sioc specification) with sioc views"""
@@ -267,5 +268,5 @@
def isioc_items(self):
"""return contained items"""
-
-
+
+