[hamster-applet] using relative imports so changes are reflected also in dev environment



commit e627c2129012bad22fbe477d0ba2997ec2ac295f
Author: Toms Bauģis <toms baugis gmail com>
Date:   Sat Dec 5 22:01:56 2009 +0000

    using relative imports so changes are reflected also in dev environment

 hamster/widgets/dateinput.py           |    2 +-
 hamster/widgets/dayline.py             |    4 +-
 hamster/widgets/facttree.py            |   43 ++++---------------------------
 hamster/widgets/reportchooserdialog.py |    6 ++--
 hamster/widgets/timeinput.py           |    2 +-
 hamster/widgets/timeline.py            |    2 +-
 6 files changed, 14 insertions(+), 45 deletions(-)
---
diff --git a/hamster/widgets/dateinput.py b/hamster/widgets/dateinput.py
index ffdf0c1..80855c1 100644
--- a/hamster/widgets/dateinput.py
+++ b/hamster/widgets/dateinput.py
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Project Hamster.  If not, see <http://www.gnu.org/licenses/>.
 
-from hamster.stuff import format_duration
+from .hamster.stuff import format_duration
 import gtk
 import datetime as dt
 import calendar
diff --git a/hamster/widgets/dayline.py b/hamster/widgets/dayline.py
index 57338b4..1a03eed 100644
--- a/hamster/widgets/dayline.py
+++ b/hamster/widgets/dayline.py
@@ -20,8 +20,8 @@
 import gtk
 import gobject
 
-from hamster import stuff
-from hamster import graphics
+from .hamster import stuff
+from .hamster import graphics
 
 import time
 import datetime as dt
diff --git a/hamster/widgets/facttree.py b/hamster/widgets/facttree.py
index b44c7c5..bd99fc8 100644
--- a/hamster/widgets/facttree.py
+++ b/hamster/widgets/facttree.py
@@ -20,34 +20,12 @@
 import gtk, gobject
 import datetime as dt
 
-from hamster.configuration import runtime
-
-from hamster import stuff
-from hamster.stuff import format_duration, format_activity
+from .hamster import stuff
+from .hamster.stuff import format_duration, format_activity
 from tags import TagCellRenderer
 
 import pango
 
-class ActivityColumn(gtk.TreeViewColumn):
-    def __init__(self, name, description, category = None):
-        gtk.TreeViewColumn.__init__(self)
-        
-        self.name, self.description, self.category = name, description, category
-        self.set_expand(True)
-        cell = gtk.CellRendererText()
-        self.pack_start(cell, True)
-        cell.set_property("ellipsize", pango.ELLIPSIZE_END)
-        self.set_cell_data_func(cell, self.activity_painter)
-
-    def activity_painter(self, column, cell, model, iter):
-        activity_name = model.get_value(iter, self.name)
-        description = model.get_value(iter, self.description)
-        category = model.get_value(iter, self.category)
-        
-        markup = format_activity(activity_name, category, description)            
-        cell.set_property('markup', markup)
-        return
-
 def parent_painter(column, cell, model, iter):
     cell_text = model.get_value(iter, 1)
     
@@ -94,11 +72,6 @@ def action_painter(column, cell, model, iter):
 
 
 class FactTree(gtk.TreeView):
-    __gsignals__ = {
-        'value-entered': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
-    }
-
-
     def __init__(self):
         gtk.TreeView.__init__(self)
         
@@ -113,14 +86,16 @@ class FactTree(gtk.TreeView):
         nameColumn = gtk.TreeViewColumn()
         nameColumn.set_expand(True)
         nameCell = gtk.CellRendererText()
-        nameCell.set_property("ellipsize", pango.ELLIPSIZE_END)
+        #nameCell.set_property("ellipsize", pango.ELLIPSIZE_END)
         nameColumn.pack_start(nameCell, True)
         nameColumn.set_cell_data_func(nameCell, parent_painter)
         self.append_column(nameColumn)
 
         tag_cell = TagCellRenderer()
         tag_cell.font_size = 8;
-        self.append_column(gtk.TreeViewColumn("", tag_cell, data=6))
+        tagColumn = gtk.TreeViewColumn("", tag_cell, data=6)
+        tagColumn.set_expand(True)
+        self.append_column(tagColumn)
         
 
         # duration
@@ -137,9 +112,6 @@ class FactTree(gtk.TreeView):
         self.append_column(self.edit_column)
 
 
-        runtime.dispatcher.add_handler('activity_updated', self.after_activity_update)
-        runtime.dispatcher.add_handler('fact_updated', self.after_activity_update)
-
         self.show()
     
     def clear(self):
@@ -184,6 +156,3 @@ class FactTree(gtk.TreeView):
 
         self.expand_all()
 
-
-    def after_activity_update(self, event, whatnot):
-        print "catch me!"
\ No newline at end of file
diff --git a/hamster/widgets/reportchooserdialog.py b/hamster/widgets/reportchooserdialog.py
index f4c584d..f71d9c2 100644
--- a/hamster/widgets/reportchooserdialog.py
+++ b/hamster/widgets/reportchooserdialog.py
@@ -24,9 +24,9 @@ pygtk.require('2.0')
 import os
 import gtk, gobject
 
-from hamster import stuff
-from hamster.i18n import C_
-from hamster.configuration import runtime
+from .hamster import stuff
+from .hamster.i18n import C_
+from .hamster.configuration import runtime
 
 from dateinput import DateInput
 
diff --git a/hamster/widgets/timeinput.py b/hamster/widgets/timeinput.py
index ea928b1..7dbffed 100644
--- a/hamster/widgets/timeinput.py
+++ b/hamster/widgets/timeinput.py
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Project Hamster.  If not, see <http://www.gnu.org/licenses/>.
 
-from hamster.stuff import format_duration
+from .hamster.stuff import format_duration
 import gtk
 import datetime as dt
 import calendar
diff --git a/hamster/widgets/timeline.py b/hamster/widgets/timeline.py
index caf7133..248891f 100644
--- a/hamster/widgets/timeline.py
+++ b/hamster/widgets/timeline.py
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Project Hamster.  If not, see <http://www.gnu.org/licenses/>.
 
-from hamster import graphics
+from .hamster import graphics
 import datetime as dt
 
 class TimeLine(graphics.Area):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]