[hamster-applet] more brackety leftovers
- From: Toms Baugis <tbaugis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hamster-applet] more brackety leftovers
- Date: Wed, 1 Sep 2010 23:24:15 +0000 (UTC)
commit 4e151f6da84593044fc571ea2f6526a0dac9b331
Author: Toms Bauģis <toms baugis gmail com>
Date: Thu Sep 2 00:23:53 2010 +0100
more brackety leftovers
src/docky_control/2.0/hamster_control.py | 2 +-
src/docky_control/2.1/hamster_control.py | 2 +-
src/hamster-cli | 8 ++++----
src/hamster-time-tracker | 8 ++++----
4 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/docky_control/2.0/hamster_control.py b/src/docky_control/2.0/hamster_control.py
index 31a7264..8bbd547 100755
--- a/src/docky_control/2.0/hamster_control.py
+++ b/src/docky_control/2.0/hamster_control.py
@@ -62,7 +62,7 @@ class DockyHamsterItem(DockyItem):
def update_text(self):
today = self.storage.get_todays_facts()
- if today and today[-1]['end_time'] is None:
+ if today and today[-1].end_time is None:
fact = today[-1]
self.iface.SetText("%(name)s - %(category)s" % fact)
diff --git a/src/docky_control/2.1/hamster_control.py b/src/docky_control/2.1/hamster_control.py
index 06835ed..05bd6e2 100755
--- a/src/docky_control/2.1/hamster_control.py
+++ b/src/docky_control/2.1/hamster_control.py
@@ -66,7 +66,7 @@ class HamsterItem(DockManagerItem):
def update_text(self):
today = self.storage.get_todays_facts()
- if today and today[-1]['end_time'] is None:
+ if today and today[-1].end_time is None:
fact = today[-1]
self.set_tooltip("%(name)s - %(category)s" % fact)
diff --git a/src/hamster-cli b/src/hamster-cli
index fc4c86d..8fbf424 100755
--- a/src/hamster-cli
+++ b/src/hamster-cli
@@ -197,17 +197,17 @@ def fact_dict(fact_data, with_date):
fact['start'] = fact_data.start_time.strftime(fmt)
if fact_data['end_time']:
- fact['end'] = fact_data['end_time'].strftime(fmt)
+ fact['end'] = fact_data.end_time.strftime(fmt)
else:
end_date = dt.datetime.now()
fact['end'] = ''
fact['duration'] = stuff.format_duration(fact_data.delta)
- fact['activity'] = fact_data['name']
- fact['category'] = fact_data['category']
+ fact['activity'] = fact_data.name
+ fact['category'] = fact_data.category
if fact_data['tags']:
- fact['tags'] = ' '.join('#%s' % tag for tag in fact_data['tags'])
+ fact['tags'] = ' '.join('#%s' % tag for tag in fact_data.tags)
else:
fact['tags'] = ''
return fact
diff --git a/src/hamster-time-tracker b/src/hamster-time-tracker
index 2380f75..5cb8e9a 100755
--- a/src/hamster-time-tracker
+++ b/src/hamster-time-tracker
@@ -244,7 +244,7 @@ class ProjectHamster(object):
def delete_selected(self):
fact = self.treeview.get_selected_fact()
- runtime.storage.remove_fact(fact["id"])
+ runtime.storage.remove_fact(fact.id)
"""events"""
@@ -257,7 +257,7 @@ class ProjectHamster(object):
def _open_edit_activity(self, row, fact):
"""opens activity editor for selected row"""
- dialogs.edit.show(self.window, fact_id = fact["id"])
+ dialogs.edit.show(self.window, fact_id = fact.id)
def on_today_row_activated(self, tree, path, column):
fact = tree.get_selected_fact()
@@ -364,12 +364,12 @@ class ProjectHamster(object):
if self.last_activity and \
self.last_activity.name.lower() == activity.name.lower() and \
(self.last_activity.category or "").lower() == (activity.category or "").lower() and \
- ", ".join(self.last_activity['tags']).lower() == ", ".join(activity['tags']).lower():
+ ", ".join(self.last_activity.tags).lower() == ", ".join(activity.tags).lower():
return
# ok, switch
fact = stuff.Fact(activity.name,
- tags = ", ".join(activity['tags']),
+ tags = ", ".join(activity.tags),
category = activity.category,
description = activity.description);
runtime.storage.add_fact(fact)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]