Skip to content

/ Zope / gocept svn checkins / Archive / 2006 / 2006-07 / SVN: r4230 - AlphaFlow/trunk

[ << ] [ >> ]

[ SVN: r4225 - in gtimelog: . trunk / Christian ... ] [ SVN: r4231 - in AlphaFlow/trunk: . Extensions ... ]

SVN: r4230 - AlphaFlow/trunk
Christian Zagrodnick <cz(at)gocept.com>
2006-07-25 14:42:13 [ FULL ]
Author: zagy
Date: Tue Jul 25 14:42:09 2006
New Revision: 4230

Modified:
   AlphaFlow/trunk/utils.py
Log:
restord id-tag

Modified: AlphaFlow/trunk/utils.py
==============================================================================
--- AlphaFlow/trunk/utils.py	(original)
+++ AlphaFlow/trunk/utils.py	Tue Jul 25 14:42:09 2006
(at)(at) -1,7 +1,7 (at)(at)
 # copyright (c) 2004-2005 gocept gmbh & co. kg
 # Some functions in this file are (c) Zope Corporation (tm)
 # See also LICENSE-ZPL2_0.txt
-# utils.py,v 1.34.2.3 2005/05/02 09:02:02 zagy Exp
+# $Id$
 """ Some common utilities.
 """

SVN: r4232 - AlphaFlow/trunk
Christian Zagrodnick <cz(at)gocept.com>
2006-07-25 14:43:11 [ FULL ]
Author: zagy
Date: Tue Jul 25 14:43:10 2006
New Revision: 4232

Modified:
   AlphaFlow/trunk/utils.py
Log:
2006 copyright

Modified: AlphaFlow/trunk/utils.py
==============================================================================
--- AlphaFlow/trunk/utils.py	(original)
+++ AlphaFlow/trunk/utils.py	Tue Jul 25 14:43:10 2006
(at)(at) -1,4 +1,4 (at)(at)
-# copyright (c) 2004-2005 gocept gmbh & co. kg
+# Copyright (c) 2004-2006 gocept gmbh & co. kg
 # Some functions in this file are (c) Zope Corporation (tm)
 # See also LICENSE-ZPL2_0.txt
 # $Id$

SVN: r4233 - gtimelog/trunk
Michael Howitz <mh(at)gocept.com>
2006-07-25 16:45:15 [ FULL ]
Author: mac
Date: Tue Jul 25 16:45:12 2006
New Revision: 4233

Modified:
   gtimelog/trunk/gtimelog.glade
   gtimelog/trunk/gtimelog.py
Log:
fixed typo + added some shortcut keys

Modified: gtimelog/trunk/gtimelog.glade
==============================================================================
--- gtimelog/trunk/gtimelog.glade	(original)
+++ gtimelog/trunk/gtimelog.glade	Tue Jul 25 16:45:12 2006
(at)(at) -73,6 +73,7 (at)(at)
 		      <property name="label" translatable="yes">_Edit
timelog.txt</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_edit_timelog_activate"
last_modification_time="Mon, 13 Sep 2004 17:40:33 GMT"/>
+		      <accelerator key="E" modifiers="GDK_CONTROL_MASK"
signal="activate"/>
 
 		      <child internal-child="image">
 			<widget class="GtkImage" id="image19">
(at)(at) -95,6 +96,7 (at)(at)
 		      <property name="label" translatable="yes">_Edit
tasks.txt</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_edit_tasks_activate"
last_modification_time="Wed, 19 Oct 2005 08:56:34 GMT"/>
+		      <accelerator key="T" modifiers="GDK_CONTROL_MASK"
signal="activate"/>
 
 		      <child internal-child="image">
 			<widget class="GtkImage" id="image19">
(at)(at) -138,6 +140,7 (at)(at)
 		      <property name="label" translatable="yes">Daily Report for a
_Previous Day</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_previous_day_report_activate"
last_modification_time="Wed, 13 Apr 2005 17:50:36 GMT"/>
+		      <accelerator key="P" modifiers="GDK_CONTROL_MASK"
signal="activate"/>
 
 		      <child internal-child="image">
 			<widget class="GtkImage" id="image21">

Modified: gtimelog/trunk/gtimelog.py
==============================================================================
--- gtimelog/trunk/gtimelog.py	(original)
+++ gtimelog/trunk/gtimelog.py	Tue Jul 25 16:45:12 2006
(at)(at) -1028,7 +1028,7 (at)(at)
             self.mail(window.weekly_report)
 
     def on_fill_hour_tracker_activate(self, widget):
-        """File -> Fill our tracker"""
+        """File -> Fill hour tracker"""
         day = self.choose_date()
         if day:
             import hours

SVN: r4235 - AlphaFlow/trunk/doc/manual
Christian Zagrodnick <cz(at)gocept.com>
2006-07-26 08:42:34 [ FULL ]
Author: zagy
Date: Wed Jul 26 08:42:32 2006
New Revision: 4235

Modified:
   AlphaFlow/trunk/doc/manual/activities.tex
Log:
improved email documentation

Modified: AlphaFlow/trunk/doc/manual/activities.tex
==============================================================================
--- AlphaFlow/trunk/doc/manual/activities.tex	(original)
+++ AlphaFlow/trunk/doc/manual/activities.tex	Wed Jul 26 08:42:32 2006
(at)(at) -551,11 +551,16 (at)(at)
                 allows to easily model something like: modify document, notify
                 reviewers, review document \ldots
 
-		Note that if the following activity is a route, it will use the contained
activities to find out recipients.
+                Note that if the following activity is a route, it will use
+                the contained activities to find out recipients.
+
+            \item[previous\_assignees] will notify all people who were
+              responsible for the email's parent activity.
+
                 
-            \item[owner] will notify the owner of the workflow instance. In a
-                content management situation this might be the owner of the
-                content object or a chief editor \ldots
+            \item[owner] will only notify the actual owner of the content
+              object. It willl \emph{not} notify the users with the Owner
+              role.
                 
             \item[actual\_role] will notify all people with at least one of 
                 the given roles.

SVN: r4234 - gtimelog/trunk
Roman Joost <rj(at)gocept.com>
2006-07-26 08:52:49 [ FULL ]
Author: roman
Date: Wed Jul 26 08:33:47 2006
New Revision: 4234

Modified:
   gtimelog/trunk/gtimelog.glade
   gtimelog/trunk/gtimelog.py
Log:
added statusbar with message in case during upload goes something wrong - a
timout to remove a msg is needed!

Modified: gtimelog/trunk/gtimelog.glade
==============================================================================
--- gtimelog/trunk/gtimelog.glade	(original)
+++ gtimelog/trunk/gtimelog.glade	Wed Jul 26 08:33:47 2006
(at)(at) -197,8 +197,8 (at)(at)
 		      </child>
 		    </widget>
 		  </child>
-		  
-          <child>
+
+		  <child>
 		    <widget class="GtkImageMenuItem" id="fill_hour_tracker">
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">_Fill Hour
Tracker</property>
(at)(at) -518,6 +518,22 (at)(at)
 	  <property name="fill">True</property>
 	</packing>
       </child>
+
+      <child>
+	<widget class="GtkStatusbar" id="statusbar">
+	  <property name="visible">True</property>
+	  <property name="has_resize_grip">True</property>
+	  <accessibility>
+	    <atkproperty name="AtkObject::accessible_name"
translatable="yes">Statusbar</atkproperty>
+	    <atkproperty name="AtkObject::accessible_description"
translatable="yes">Messages go in here</atkproperty>
+	  </accessibility>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
     </widget>
   </child>
 </widget>

Modified: gtimelog/trunk/gtimelog.py
==============================================================================
--- gtimelog/trunk/gtimelog.py	(original)
+++ gtimelog/trunk/gtimelog.py	Wed Jul 26 08:33:47 2006
(at)(at) -1,4 +1,4 (at)(at)
-#!/usr/bin/python
+#!/usr/bin/python2.4
 """
 A Gtk+ application for keeping track of time.
 """
(at)(at) -719,6 +719,8 (at)(at)
                               self.on_calendar_day_selected_double_click)
         self.main_window = tree.get_widget("main_window")
         self.main_window.connect("delete_event", self.delete_event)
+        self.statusbar = tree.get_widget("statusbar")
+        self.statusbarmsgs = 0
         self.log_view = tree.get_widget("log_view")
         self.set_up_log_view_columns()
         self.task_pane_info_label = tree.get_widget("task_pane_info_label")
(at)(at) -1038,9 +1040,16 (at)(at)
             week = int(window.min_timestamp.strftime('%W'))
             year = int(window.min_timestamp.strftime('%Y'))
             
-            tracker.loadWeek(week, year)
-            tracker.setHours(window.all_entries())
-            tracker.saveWeek()
+            try:
+                tracker.loadWeek(week, year)
+                tracker.setHours(window.all_entries())
+                tracker.saveWeek()
+            except (KeyError, ValueError), err:
+                msg = "An error during upload occured: %s" % err
+                self.statusbarmsgs += 1
+                contextid = self.statusbarmsgs
+                self.statusbar.push(contextid, msg)
+
 
     def on_edit_timelog_activate(self, widget):
         """File -> Edit timelog.txt"""

SVN: r4242 - gtimelog/trunk
Roman Joost <rj(at)gocept.com>
2006-07-27 13:11:28 [ FULL ]
Author: roman
Date: Thu Jul 27 13:11:28 2006
New Revision: 4242

Modified:
   gtimelog/trunk/gtimelog.py
Log:
- added message if upload to hourtracker was successfull


Modified: gtimelog/trunk/gtimelog.py
==============================================================================
--- gtimelog/trunk/gtimelog.py	(original)
+++ gtimelog/trunk/gtimelog.py	Thu Jul 27 13:11:28 2006
(at)(at) -687,7 +687,6 (at)(at)
             tip += "\nTime left at work: %s" % format_duration(time_left)
         return tip
 
-
 class MainWindow(object):
     """Main application window."""
 
(at)(at) -720,7 +719,8 (at)(at)
         self.main_window = tree.get_widget("main_window")
         self.main_window.connect("delete_event", self.delete_event)
         self.statusbar = tree.get_widget("statusbar")
-        self.statusbarmsgs = 0
+        self.statusbarmsgids = []
+        gobject.timeout_add(5000, self.purge_statusbar)
         self.log_view = tree.get_widget("log_view")
         self.set_up_log_view_columns()
         self.task_pane_info_label = tree.get_widget("task_pane_info_label")
(at)(at) -801,6 +801,11 (at)(at)
         self.add_footer()
         self.scroll_to_end()
         self.lock = False
+    
+    def purge_statusbar(self):
+        """Purges all messages in the statusbar"""
+        for msgid in self.statusbarmsgids:
+            self.statusbar.pop(msgid)
 
     def delete_footer(self):
         buffer = self.log_buffer
(at)(at) -1044,11 +1049,15 (at)(at)
                 tracker.loadWeek(week, year)
                 tracker.setHours(window.all_entries())
                 tracker.saveWeek()
+                msg = "Upload to Hourtracker successfull"
+                contextid = len(self.statusbarmsgids)
+                msgid = self.statusbar.push(contextid, msg)
+                self.statusbarmsgids.append(msgid)
             except (KeyError, ValueError), err:
                 msg = "An error during upload occured: %s" % err
-                self.statusbarmsgs += 1
-                contextid = self.statusbarmsgs
-                self.statusbar.push(contextid, msg)
+                contextid = len(self.statusbarmsgids)
+                msgid = self.statusbar.push(contextid, msg)
+                self.statusbarmsgids.append(msgid)
 
 
     def on_edit_timelog_activate(self, widget):

SVN: r4243 - gtimelog/trunk
Christian Zagrodnick <cz(at)gocept.com>
2006-07-27 14:25:07 [ FULL ]
Author: zagy
Date: Thu Jul 27 14:25:06 2006
New Revision: 4243

Modified:
   gtimelog/trunk/gtimelog.py
   gtimelog/trunk/hours.py
Log:
automatic task/project fetching

Modified: gtimelog/trunk/gtimelog.py
==============================================================================
--- gtimelog/trunk/gtimelog.py	(original)
+++ gtimelog/trunk/gtimelog.py	Thu Jul 27 14:25:06 2006
(at)(at) -1,4 +1,4 (at)(at)
-#!/usr/bin/python2.4
+#!/usr/bin/python
 """
 A Gtk+ application for keeping track of time.
 """
(at)(at) -18,6 +18,7 (at)(at)
 import gtk.glade
 import pango
 
+import hours
 
 resource_dir = os.path.dirname(os.path.realpath(__file__))
 ui_file = os.path.join(resource_dir, "gtimelog.glade")
(at)(at) -218,7 +219,6 (at)(at)
                 entries = slack
             else:
                 entries = work
-            entry = ':'.join(entry.split(':')[:2])
             if entry in entries:
                 old_start, old_entry, old_duration = entries[entry]
                 start = min(start, old_start)
(at)(at) -489,11 +489,15 (at)(at)
     Keeps a cached copy of the list in a local file, so you can use it
offline.
     """
 
-    def __init__(self, url, cache_filename):
-        self.url = url
-        TaskList.__init__(self, cache_filename)
+    def __init__(self, settings, projects_filename, tasks_filename):
+        self.project_url = settings.project_list_url
+        self.task_url = settings.task_list_url
+        self.projects_file = projects_filename
+        TaskList.__init__(self, tasks_filename)
         self.first_time = True
 
+        self.hours = hours.HourTracker(settings)
+        
     def check_reload(self):
         """Check whether the task list needs to be reloaded.
 
(at)(at) -504,7 +508,8 (at)(at)
         """
         if self.first_time:
             self.first_time = False
-            if not os.path.exists(self.filename):
+            if not os.path.exists(self.filename) or not os.path.exists(
+                self.projects_file):
                 self.download()
                 return True
         return TaskList.check_reload(self)
(at)(at) -514,7 +519,13 (at)(at)
         if self.loading_callback:
             self.loading_callback()
         try:
-            urllib.urlretrieve(self.url, self.filename)
+            f = file(self.filename, 'w')
+            f.write(self.hours.getPage(self.task_url))
+            f.close()
+
+            f = file(self.projects_file, 'w')
+            f.write(self.hours.getPage(self.project_url))
+            f.close()
         except IOError:
             if self.error_callback:
                 self.error_callback()
(at)(at) -522,6 +533,24 (at)(at)
         if self.loaded_callback:
             self.loaded_callback()
 
+    def load(self):
+        """Load task list from a file named self.filename."""
+        groups = {}
+        self.last_mtime = self.get_mtime()
+        try:
+            for project in file(self.projects_file):
+                project = project.strip()
+                if not project or project.startswith('#'):
+                    continue
+                for task in  file(self.filename):
+                    if not task or task.startswith('#'):
+                        continue
+                    groups.setdefault(project, []).append('
'.join(task.split()[1:]))
+        except IOError:
+            pass # the file's not there, so what?
+        self.groups = groups.items()
+        self.groups.sort()
+            
     def reload(self):
         """Reload the task list."""
         self.download()
(at)(at) -542,12 +571,13 (at)(at)
     hours = 8
     virtual_midnight = datetime.time(2, 0)
 
-    task_list_url = ''
+    task_list_url = 'http://cosmos.infrae.com/uren/tasks'
+    project_list_url = 'http://cosmos.infrae.com/uren/projects'
     edit_task_list_cmd = ''
 
-    hours_url = 'http://hours.gocept.com/'
-    hours_username = 'myuser'
-    hours_password = 'mypassword'
+    hours_url = 'http://cosmos.infrae.com/uren/'
+    hours_username = ''
+    hours_password = ''
 
     def _config(self):
         config = ConfigParser.RawConfigParser()
(at)(at) -568,6 +598,8 (at)(at)
         config.set('hours', 'url', self.hours_url)
         config.set('hours', 'username', self.hours_username)
         config.set('hours', 'password', self.hours_password)
+        config.set('hours', 'tasks', self.task_list_url)
+        config.set('hours', 'projects', self.project_list_url)
         return config
 
     def load(self, filename):
(at)(at) -588,6 +620,8 (at)(at)
         self.hours_url = config.get('hours', 'url')
         self.hours_username = config.get('hours', 'username')
         self.hours_password = config.get('hours', 'password')
+        self.task_list_url = config.get('hours', 'tasks')
+        self.project_list_url = config.get('hours', 'projects')
         
 
     def save(self, filename):
(at)(at) -687,6 +721,7 (at)(at)
             tip += "\nTime left at work: %s" % format_duration(time_left)
         return tip
 
+
 class MainWindow(object):
     """Main application window."""
 
(at)(at) -718,9 +753,6 (at)(at)
                               self.on_calendar_day_selected_double_click)
         self.main_window = tree.get_widget("main_window")
         self.main_window.connect("delete_event", self.delete_event)
-        self.statusbar = tree.get_widget("statusbar")
-        self.statusbarmsgids = []
-        gobject.timeout_add(5000, self.purge_statusbar)
         self.log_view = tree.get_widget("log_view")
         self.set_up_log_view_columns()
         self.task_pane_info_label = tree.get_widget("task_pane_info_label")
(at)(at) -801,11 +833,6 (at)(at)
         self.add_footer()
         self.scroll_to_end()
         self.lock = False
-    
-    def purge_statusbar(self):
-        """Purges all messages in the statusbar"""
-        for msgid in self.statusbarmsgids:
-            self.statusbar.pop(msgid)
 
     def delete_footer(self):
         buffer = self.log_buffer
(at)(at) -1035,30 +1062,18 (at)(at)
             self.mail(window.weekly_report)
 
     def on_fill_hour_tracker_activate(self, widget):
-        """File -> Fill hour tracker"""
+        """File -> Fill our tracker"""
         day = self.choose_date()
         if day:
-            import hours
             tracker = hours.HourTracker(self.settings)
 
             window = self.weekly_window(day=day)
             week = int(window.min_timestamp.strftime('%W'))
             year = int(window.min_timestamp.strftime('%Y'))
             
-            try:
-                tracker.loadWeek(week, year)
-                tracker.setHours(window.all_entries())
-                tracker.saveWeek()
-                msg = "Upload to Hourtracker successfull"
-                contextid = len(self.statusbarmsgids)
-                msgid = self.statusbar.push(contextid, msg)
-                self.statusbarmsgids.append(msgid)
-            except (KeyError, ValueError), err:
-                msg = "An error during upload occured: %s" % err
-                contextid = len(self.statusbarmsgids)
-                msgid = self.statusbar.push(contextid, msg)
-                self.statusbarmsgids.append(msgid)
-
+            tracker.loadWeek(week, year)
+            tracker.setHours(window.all_entries())
+            tracker.saveWeek()
 
     def on_edit_timelog_activate(self, widget):
         """File -> Edit timelog.txt"""
(at)(at) -1233,8 +1248,10 (at)(at)
     timelog = TimeLog(os.path.join(configdir, 'timelog.txt'),
                       settings.virtual_midnight)
     if settings.task_list_url:
-        tasks = RemoteTaskList(settings.task_list_url,
-                               os.path.join(configdir, 'remote-tasks.txt'))
+        tasks = RemoteTaskList(
+            settings,
+            os.path.join(configdir, 'projects'),
+            os.path.join(configdir, 'tasks'))
     else:
         tasks = TaskList(os.path.join(configdir, 'tasks.txt'))
     main_window = MainWindow(timelog, settings, tasks)
(at)(at) -1246,3 +1263,4 (at)(at)
 
 if __name__ == '__main__':
     main()
+

Modified: gtimelog/trunk/hours.py
==============================================================================
--- gtimelog/trunk/hours.py	(original)
+++ gtimelog/trunk/hours.py	Thu Jul 27 14:25:06 2006
(at)(at) -39,11 +39,11 (at)(at)
             key = (args, tuple(kw))
             try:
                 v = self.cache[key]
-                #print "cache"
+                print "cache"
                 if (time.time() - v[1]) > self.timeout:
                     raise KeyError
             except KeyError:
-                #print "new"
+                print "new"
                 v = self.cache[key] = f(*args,**kwargs),time.time()
             return v[0]
 
(at)(at) -65,12 +65,15 (at)(at)
         opener = urllib2.build_opener(auth_handler)
         urllib2.install_opener(opener)
 
-
-    def loadWeek(self, week, year):
+    def downloadWeek(self, week, year):
         view_url =
'%s?view_name=%s&view_week=%d&view_year=%d&view=1' % (
             self.settings.hours_url, self.settings.hours_username,
             week, year)
-        data = self._get_page(view_url)
+        data = self.getPage(view_url)
+        return data
+
+    def loadWeek(self, week, year):
+        data = self.downloadWeek(week, ywar)
         tree = etree.HTML(data)
 
         self.tree = tree
(at)(at) -80,8 +83,8 (at)(at)
         self.loadProjects()
         self.loadTasks()
 
-    (at)Memoize(300)
-    def _get_page(self, url):
+    (at)Memoize(3000)
+    def getPage(self, url):
         response = urllib2.urlopen(url)
         data = response.read()
         return data

SVN: r4244 - gtimelog/trunk
Christian Zagrodnick <cz(at)gocept.com>
2006-07-27 14:29:36 [ FULL ]
Author: zagy
Date: Thu Jul 27 14:29:38 2006
New Revision: 4244

Modified:
   gtimelog/trunk/hours.py
Log:
typo

Modified: gtimelog/trunk/hours.py
==============================================================================
--- gtimelog/trunk/hours.py	(original)
+++ gtimelog/trunk/hours.py	Thu Jul 27 14:29:38 2006
(at)(at) -73,7 +73,7 (at)(at)
         return data
 
     def loadWeek(self, week, year):
-        data = self.downloadWeek(week, ywar)
+        data = self.downloadWeek(week, year)
         tree = etree.HTML(data)
 
         self.tree = tree

SVN: r4245 - gtimelog/trunk
Christian Zagrodnick <cz(at)gocept.com>
2006-07-27 14:29:46 [ FULL ]
Author: zagy
Date: Thu Jul 27 14:29:49 2006
New Revision: 4245

Modified:
   gtimelog/trunk/gtimelog.py
Log:
empty defaults fors task list url and projects url

Modified: gtimelog/trunk/gtimelog.py
==============================================================================
--- gtimelog/trunk/gtimelog.py	(original)
+++ gtimelog/trunk/gtimelog.py	Thu Jul 27 14:29:49 2006
(at)(at) -571,8 +571,8 (at)(at)
     hours = 8
     virtual_midnight = datetime.time(2, 0)
 
-    task_list_url = 'http://cosmos.infrae.com/uren/tasks'
-    project_list_url = 'http://cosmos.infrae.com/uren/projects'
+    task_list_url = ''
+    project_list_url = ''
     edit_task_list_cmd = ''
 
     hours_url = 'http://cosmos.infrae.com/uren/'

SVN: r4246 - gtimelog/trunk
Christian Zagrodnick <cz(at)gocept.com>
2006-07-27 15:48:20 [ FULL ]
Author: zagy
Date: Thu Jul 27 15:48:22 2006
New Revision: 4246

Modified:
   gtimelog/trunk/hours.py
Log:
uploading in latin1

Modified: gtimelog/trunk/hours.py
==============================================================================
--- gtimelog/trunk/hours.py	(original)
+++ gtimelog/trunk/hours.py	Thu Jul 27 15:48:22 2006
(at)(at) -177,7 +177,8 (at)(at)
                     comments.extend(day_comments)
                     
 
-                data['opm%d' % row] = '; '.join(set(comments))
+                data['opm%d' % row] = unicode('; '.join(set(comments)),
+                                              'utf-8').encode('latin1')
         print '%d rows' % row
         return data

SVN: r4252 - lms/trunk/doc
Christian Theune <ct(at)gocept.com>
2006-07-29 13:36:12 [ FULL ]
Author: ctheune
Date: Sat Jul 29 13:36:37 2006
New Revision: 4252

Modified:
   lms/trunk/doc/INSTALL.txt
Log:
 - minor clarifications


Modified: lms/trunk/doc/INSTALL.txt
==============================================================================
--- lms/trunk/doc/INSTALL.txt	(original)
+++ lms/trunk/doc/INSTALL.txt	Sat Jul 29 13:36:37 2006
(at)(at) -50,7 +50,7 (at)(at)
 2. Create a MySQL database from ``lms.sql``
 
 3. From the ``lms`` directory copy ``customconfig_example.py ``
-   to ``customconfig.py``
+   to ``lib/python/customconfig.py``
 
 4. Edit ``lib/python/lms/customconfig.py`` (see Configuration_)
 
(at)(at) -84,5 +84,3 (at)(at)
 Registering Clients::
 
  bin/lmsCommand.sh registerClient client_id callback_url "Full Name"
email(at)address
-
-

SVN: r4256 - gtimelog/trunk
Roman Joost <rj(at)gocept.com>
2006-07-31 08:51:11 [ FULL ]
Author: roman
Date: Mon Jul 31 08:51:53 2006
New Revision: 4256

Modified:
   gtimelog/trunk/gtimelog.py
Log:
- readded the statusbar messages
- now it's a class where you can post messages to
- a timeout needs still to be implemented


Modified: gtimelog/trunk/gtimelog.py
==============================================================================
--- gtimelog/trunk/gtimelog.py	(original)
+++ gtimelog/trunk/gtimelog.py	Mon Jul 31 08:51:53 2006
(at)(at) -721,6 +721,18 (at)(at)
             tip += "\nTime left at work: %s" % format_duration(time_left)
         return tip
 
+class TimelogStatusbar(object):
+    """The Gtimelog Statusbar"""
+
+    def __init__(self, tree):
+        self.statusbar = tree.get_widget("statusbar")
+        self.statusbarmsgids = []
+
+    def post_message(self, msg):
+        """Writes a msg to the statusbar"""
+        contextid = len(self.statusbarmsgids)
+        msgid = self.statusbar.push(contextid, msg)
+        self.statusbarmsgids.append(msgid)
 
 class MainWindow(object):
     """Main application window."""
(at)(at) -751,6 +763,7 (at)(at)
         self.calendar = tree.get_widget("calendar")
         self.calendar.connect("day_selected_double_click",
                               self.on_calendar_day_selected_double_click)
+        self.statusbar = TimelogStatusbar(tree)
         self.main_window = tree.get_widget("main_window")
         self.main_window.connect("delete_event", self.delete_event)
         self.log_view = tree.get_widget("log_view")
(at)(at) -1070,10 +1083,17 (at)(at)
             window = self.weekly_window(day=day)
             week = int(window.min_timestamp.strftime('%W'))
             year = int(window.min_timestamp.strftime('%Y'))
+
+            try:
+                tracker.loadWeek(week, year)
+                tracker.setHours(window.all_entries())
+                tracker.saveWeek()
+                msg = "Upload to Hourtracker successfull"
+                self.statusbar.post_message(msg)
+            except (KeyError, ValueError), err:
+                msg = "An error during upload occured: %s" % err
+                self.statusbar.post_message(msg)
             
-            tracker.loadWeek(week, year)
-            tracker.setHours(window.all_entries())
-            tracker.saveWeek()
 
     def on_edit_timelog_activate(self, widget):
         """File -> Edit timelog.txt"""

MailBoxer