cleanup tls-sprint
authorsylvain.thenault@logilab.fr
Wed, 18 Feb 2009 11:11:05 +0100
branchtls-sprint
changeset 767 b094cf8535b4
parent 766 33ede72b22b8
child 768 878e6139a46b
cleanup
interfaces.py
web/action.py
web/views/calendar.py
--- a/interfaces.py	Wed Feb 18 11:10:28 2009 +0100
+++ b/interfaces.py	Wed Feb 18 11:11:05 2009 +0100
@@ -1,7 +1,7 @@
 """Specific views for entities implementing IDownloadable
 
 :organization: Logilab
-:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 
@@ -193,8 +193,8 @@
         """embed action interface"""
     
 class ICalendarable(Interface):
-    """interface for itms that do have a begin date 'start' and an end
-date 'stop'"""    
+    """interface for items that do have a begin date 'start' and an end date 'stop'
+    """    
     
 class ICalendarViews(Interface):
     """calendar views interface"""
--- a/web/action.py	Wed Feb 18 11:10:28 2009 +0100
+++ b/web/action.py	Wed Feb 18 11:11:05 2009 +0100
@@ -95,8 +95,7 @@
                               __redirectvid=self.req.form.get('__redirectvid', ''))
 
 class EntityAction(Action):
-    """DEPRECATED / BACKWARD COMPAT
-    """
+    """DEPRECATED / BACKWARD COMPAT"""
     registered = deprecate(accepts_compat(condition_compat(Action.registered)),
                            msg='EntityAction is deprecated, use Action with '
                            'appropriate selectors')
--- a/web/views/calendar.py	Wed Feb 18 11:10:28 2009 +0100
+++ b/web/views/calendar.py	Wed Feb 18 11:11:05 2009 +0100
@@ -14,9 +14,9 @@
 
 from cubicweb.interfaces import ICalendarable
 from cubicweb.selectors import implements
-from cubicweb.common.utils import date_range
+from cubicweb.utils import date_range
+from cubicweb.view import EntityView
 from cubicweb.common.uilib import ajax_replace_url
-from cubicweb.common.view import EntityView
 
 
 # For backward compatibility
@@ -67,7 +67,8 @@
         task.view('oneline', w=self.w)
         if dates:
             if task.start and task.stop:
-                self.w('<br/>from %s'%self.format_date(task.start))
+                self.w('<br/>' % self.req._('from %(date)s' % {'date': self.format_date(task.start)}))
+                self.w('<br/>' % self.req._('to %(date)s' % {'date': self.format_date(task.stop)}))
                 self.w('<br/>to %s'%self.format_date(task.stop))
                 
 class CalendarLargeItemView(CalendarItemView):
@@ -110,11 +111,11 @@
 
     Does apply to ICalendarable compatible entities
     """
+    id = 'hcal'
     __select__ = implements(ICalendarable)
     need_navigation = False
     title = _('hCalendar')
     #templatable = False
-    id = 'hcal'
 
     def call(self):
         self.w(u'<div class="hcalendar">')
@@ -140,9 +141,9 @@
 
 class OneMonthCal(EntityView):
     """At some point, this view will probably replace ampm calendars"""
+    id = 'onemonthcal'
     __select__ = implements(ICalendarable)
     need_navigation = False
-    id = 'onemonthcal'
     title = _('one month')
 
     def call(self):
@@ -323,9 +324,9 @@
 
 class OneWeekCal(EntityView):
     """At some point, this view will probably replace ampm calendars"""
+    id = 'oneweekcal'
     __select__ = implements(ICalendarable)
     need_navigation = False
-    id = 'oneweekcal'
     title = _('one week')
     
     def call(self):