[Checkins] SVN: lovely.tag/trunk/src/lovely/tag/ Changed the statistic methods to properties.

Jürgen Kartnaller juergen at kartnaller.at
Sun Nov 26 03:40:32 EST 2006


Log message for revision 71309:
  Changed the statistic methods to properties.
  

Changed:
  U   lovely.tag/trunk/src/lovely/tag/README.txt
  U   lovely.tag/trunk/src/lovely/tag/engine.py
  U   lovely.tag/trunk/src/lovely/tag/interfaces.py

-=-
Modified: lovely.tag/trunk/src/lovely/tag/README.txt
===================================================================
--- lovely.tag/trunk/src/lovely/tag/README.txt	2006-11-26 02:07:55 UTC (rev 71308)
+++ lovely.tag/trunk/src/lovely/tag/README.txt	2006-11-26 08:40:31 UTC (rev 71309)
@@ -161,11 +161,11 @@
   >>> from lovely.tag.interfaces import ITaggingStatistics
   >>> ITaggingStatistics.providedBy(engine)
   True
-  >>> engine.tagCount()
+  >>> engine.tagCount
   6
-  >>> engine.itemCount()
+  >>> engine.itemCount
   3
-  >>> engine.userCount()
+  >>> engine.userCount
   2
 
 

Modified: lovely.tag/trunk/src/lovely/tag/engine.py
===================================================================
--- lovely.tag/trunk/src/lovely/tag/engine.py	2006-11-26 02:07:55 UTC (rev 71308)
+++ lovely.tag/trunk/src/lovely/tag/engine.py	2006-11-26 08:40:31 UTC (rev 71309)
@@ -45,12 +45,15 @@
         self._item_to_tagids = IOBTree.IOBTree()
         self._name_to_tagids = OOBTree.OOBTree()
 
+    @property
     def tagCount(self):
         return len(self._name_to_tagids)
 
+    @property
     def itemCount(self):
         return len(self._item_to_tagids)
 
+    @property
     def userCount(self):
         return len(self._user_to_tagids)
 

Modified: lovely.tag/trunk/src/lovely/tag/interfaces.py
===================================================================
--- lovely.tag/trunk/src/lovely/tag/interfaces.py	2006-11-26 02:07:55 UTC (rev 71308)
+++ lovely.tag/trunk/src/lovely/tag/interfaces.py	2006-11-26 08:40:31 UTC (rev 71309)
@@ -101,14 +101,23 @@
 class ITaggingStatistics(zope.interface.Interface):
     """A tagging engine that provides statistical information about itself"""
 
-    def tagCount():
-        """Return the number of tags in the tagging engine"""
+    tagCount = zope.schema.Int(
+            title = u'Tags',
+            description = u'The number of tags in the tagging engine',
+            required = True,
+            )
 
-    def itemCount():
-        """Return the number of items in the tagging engine"""
+    itemCount = zope.schema.Int(
+            title = u'Items',
+            description = u'The number of items in the tagging engine',
+            required = True,
+            )
 
-    def userCount():
-        """Return the number of users in the tagging engine"""
+    userCount = zope.schema.Int(
+            title = u'Users',
+            description = u'The number of users in the tagging engine',
+            required = True,
+            )
 
 
 class ITaggable(zope.interface.Interface):



More information about the Checkins mailing list