You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-office/gtg/files/gtg-0.2.4-hamster.patch

42 lines
2.1 KiB

diff --git a/GTG/plugins/hamster/hamster.py b/GTG/plugins/hamster/hamster.py
index b4e2208..046fd10 100755
--- a/GTG/plugins/hamster/hamster.py
+++ b/GTG/plugins/hamster/hamster.py
@@ -65,16 +65,19 @@ class hamsterPlugin:
hamster_activities=dict([(unicode(x[0]), unicode(x[1])) for x in self.hamster.GetActivities()])
if (gtg_title in hamster_activities
or gtg_title.replace(",", "") in hamster_activities):
- category = "@%s" % hamster_activities[gtg_title]
+ category = "%s" % hamster_activities[gtg_title]
if (self.preferences['category'] == 'tag' or
(self.preferences['category'] == 'auto_tag' and not category)):
# See if any of the tags match existing categories
- categories = dict([(unicode(x).lower(), unicode(x)) for x in self.hamster.GetCategories()])
+ categories = dict([(unicode(x[1]).lower(), unicode(x[1])) for x in self.hamster.GetCategories()])
intersection = set(categories.keys()).intersection(set([x.lower() for x in gtg_tags]))
if len(intersection) > 0:
- category = "@%s" % categories[intersection.pop()]
-
+ category = "%s" % categories[intersection.pop()]
+ else:
+ # Force category if not found
+ category = gtg_tags[0]
+
description = ""
if self.preferences['description'] == 'title':
description = gtg_title
@@ -91,10 +94,10 @@ class hamsterPlugin:
except dbus.exceptions.DBusException:
# old hamster version, doesn't support tags
pass
- tag_str = "".join([" #" + x for x in tag_candidates])
+ tag_str = "".join([", " + x for x in tag_candidates])
#print '%s%s,%s%s'%(activity, category, description, tag_str)
- hamster_id=self.hamster.AddFact('%s%s,%s%s'%(activity, category, description, tag_str), 0, 0)
+ hamster_id=self.hamster.AddFact(activity, tag_str, 0, 0, category, description, False)
ids=self.get_hamster_ids(task)
ids.append(str(hamster_id))