Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArtActivity.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-03-18 20:08:41 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-03-18 20:08:41 (GMT)
commited25025ad854553535d69f1d1251f12096bef591 (patch)
tree022b692f445c44f9765a252b867e96af358f43a6 /TurtleArtActivity.py
parent8173152d73dbf7c05837b99d4b5f7252aa80c548 (diff)
more robust checking when metadata is None
Diffstat (limited to 'TurtleArtActivity.py')
-rw-r--r--TurtleArtActivity.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py
index 248dcad..fb32fd1 100644
--- a/TurtleArtActivity.py
+++ b/TurtleArtActivity.py
@@ -1,5 +1,5 @@
#Copyright (c) 2007, Playful Invention Company
-#Copyright (c) 2008-11, Walter Bender
+#Copyright (c) 2008-12, Walter Bender
#Copyright (c) 2009-10 Raul Gutierrez Segales
#Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -92,14 +92,14 @@ class TurtleArtActivity(activity.Activity):
_logger.debug('_setup_sharing')
self._setup_sharing()
- # TRANS: activity count is the number of times this instance
- # has been accessed
+ # Activity count is the number of times this instance has been
+ # accessed
count = 1
- if hasattr(self, 'metadata'):
+ if hasattr(self, 'metadata') and self.metadata is not None:
if 'activity count' in self.metadata:
count = int(self.metadata['activity count'])
count += 1
- self.metadata['activity count'] = str(count)
+ self.metadata['activity count'] = str(count)
# Activity toolbar callbacks