[hamster-applet] another 3. forgot to mention that this is not yet for public consumption and the nature of the troph
- From: Toms Baugis <tbaugis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hamster-applet] another 3. forgot to mention that this is not yet for public consumption and the nature of the troph
- Date: Tue, 17 Aug 2010 07:36:11 +0000 (UTC)
commit 1d280cc08027519c8a72af67c84da89263b710ed
Author: Toms Bauģis <toms baugis gmail com>
Date: Tue Aug 17 08:35:47 2010 +0100
another 3. forgot to mention that this is not yet for public consumption and the nature of the trophies themselves is also under investigation
src/hamster/trophies.py | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/hamster/trophies.py b/src/hamster/trophies.py
index c14bd16..5de8466 100644
--- a/src/hamster/trophies.py
+++ b/src/hamster/trophies.py
@@ -45,14 +45,20 @@ class Checker(object):
# explicit over implicit
fact = stuff.parse_activity_input(activity_name)
+ if not fact.activity_name: # TODO - parse_activity could return None for these cases
+ return
+
+ # full plate - use all elements of syntax parsing
+ if all((fact.category_name, fact.description, fact.tags, fact.start_time, fact.end_time)):
+ self.trophies.unlock_achievement("hamster-applet", "full_plate")
+
+
fact.tags = [tag.strip() for tag in tags.split(",") if tag.strip()] or fact.tags
fact.category_name = category_name or fact.category_name
fact.description = description or fact.description
fact.start_time = start_time or fact.start_time
fact.end_time = end_time or fact.end_time
- if not fact.activity_name: # TODO - parse_activity could return None for these cases
- return
# cryptic - hidden - used word shorter than 4 letters for the activity name
@@ -63,5 +69,12 @@ class Checker(object):
if fact.activity_name == fact.activity_name.upper():
self.trophies.unlock_achievement("hamster-applet", "madness")
+ # verbose - hidden - description longer than 5 words
+ if fact.description and len((word for word in fact.description.split(" ") if word.strip())) >= 5:
+ self.trophies.unlock_achievement("hamster-applet", "verbose")
+
+ # overkill - used 8 or more tags on a single activity
+ if len(fact.tags) >=8:
+ self.trophies.unlock_achievement("hamster-applet", "overkill")
checker = Checker()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]