[Zope3-checkins] CVS: zopeproducts/bugtracker - VERSION.txt:1.3 bug.py:1.4 configure.zcml:1.9 interfaces.py:1.4 mail.py:1.3 version.txt:1.2 vocabulary.py:1.6

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 28 02:23:01 EDT 2003


Update of /cvs-repository/zopeproducts/bugtracker
In directory cvs.zope.org:/tmp/cvs-serv11184

Modified Files:
	VERSION.txt bug.py configure.zcml interfaces.py mail.py 
	version.txt vocabulary.py 
Log Message:
Major usibility improvements landed:

- You can now filter also by the owner. This is good when you want to 
  see all the bugs you are responsible for for example.

- There is a "View Type" in the tracker overview, which specifes how the
  found bugs are displayed. "normal" is what we had till now and 
  "compressed" displays the bugs in a table (one bug per line). This 
  feature was requested by Fred Drake, who liked this particular feature
  in the SF bug tracker.

- You can now collapse the filter options, so that more bugs fit on your 
  screen.

- When seeing the bug overview, you now have an "Add Bug" link there, which
  enables you to add a new bug that is a dependency of the currently viewed 
  one. This feature will increase input speed by multiples. Thanks goes to
  Jim for suggesting this.

- In the bug dependency screen you can also collapse the edit interface.

- The dependency edit interface is not shown as part of the "Dependencies" 
  screen, if the user has not the necessary rights to modify this data.

- The management widget for dependencies has been switched to a different
  model which is more scalable and user savy. Furthermore, you cannot just 
  set Dependencies (children) but also Dependents (Parents), which makes it
  much easier to manage dependencies in general, since you often want to 
  specify the Dependent and not the Dependency. Thanks to Jim again for 
  suggesting this.

- Chnaged the dependency annotation key to be a valid file, so that it 
  plays nice with fssync. This means, if you have an existing bug tracker 
  you cannot just upgrade your software, since you would loose all of your 
  dependencies. The easy solution is to export the entire bug tracker to 
  XML first, before upgrading, so that you can easily import it after the 
  upgrade again.

** WARNING: THIS CHECKIN BREAKS BACKWARD COMPATIBILITY! SEE LAST NOTE ABOVE**


=== zopeproducts/bugtracker/VERSION.txt 1.2 => 1.3 ===
--- zopeproducts/bugtracker/VERSION.txt:1.2	Sat Jul 26 09:40:43 2003
+++ zopeproducts/bugtracker/VERSION.txt	Thu Aug 28 01:22:30 2003
@@ -1 +1 @@
-0.2
\ No newline at end of file
+0.3
\ No newline at end of file


=== zopeproducts/bugtracker/bug.py 1.3 => 1.4 ===
--- zopeproducts/bugtracker/bug.py:1.3	Tue Aug 12 14:55:07 2003
+++ zopeproducts/bugtracker/bug.py	Thu Aug 28 01:22:30 2003
@@ -16,11 +16,10 @@
 $Id$
 """
 from zope.interface import implements
-from zope.component import getAdapter, queryAdapter
+from zope.app import zapi
 from zope.app.interfaces.dublincore import IZopeDublinCore
 from zope.app.interfaces.annotation import IAnnotations
 from zope.app.interfaces.index.text import ISearchableText
-from zope.app.traversing import getParent, getName
 from zope.app.container.btree import BTreeContainer
 from zope.app.context import ContextWrapper
 from zope.context import ContextProperty
@@ -31,7 +30,7 @@
      VocabularyPropertyGetter, VocabularyPropertySetter
 from zopeproducts.bugtracker import TrackerMessageID as _
 
-DependencyKey = 'http://www.zope.org/bugtracker#1.0/Dependencies'
+DependencyKey = 'bugtracker.dependencies'
 
 
 class Bug(BTreeContainer):
@@ -70,12 +69,12 @@
 
     def setTitle(self, title):
         """Set bug title."""
-        dc = queryAdapter(self, IZopeDublinCore)
+        dc = zapi.queryAdapter(self, IZopeDublinCore)
         dc.title = title
 
     def getTitle(self):
         """Get bug title."""
-        dc = queryAdapter(self, IZopeDublinCore)
+        dc = zapi.queryAdapter(self, IZopeDublinCore)
         return dc.title
 
     # See zopeproducts.bugtracker.interfaces.IBug
@@ -83,12 +82,12 @@
 
     def setDescription(self, description):
         """Set bug description."""
-        dc = queryAdapter(self, IZopeDublinCore)
+        dc = zapi.queryAdapter(self, IZopeDublinCore)
         dc.description = description
 
     def getDescription(self):
         """Get bug description."""
-        dc = queryAdapter(self, IZopeDublinCore)
+        dc = zapi.queryAdapter(self, IZopeDublinCore)
         return dc.description
 
     # See zopeproducts.bugtracker.interfaces.IBug
@@ -96,7 +95,7 @@
 
     def getSubmitter(self):
         """Get bug submitter."""
-        dc = queryAdapter(self, IZopeDublinCore)
+        dc = zapi.queryAdapter(self, IZopeDublinCore)
         if not dc.creators:
             return None
         return dc.creators[0]
@@ -112,10 +111,17 @@
 
     def __init__(self, context):
         self.context = context
-        self._annotations = getAdapter(context, IAnnotations)
+        self._annotations = zapi.getAdapter(context, IAnnotations)
         if not self._annotations.get(DependencyKey):
             self._annotations[DependencyKey] = ()
 
+    def addDependencies(self, dependencies):
+        self._annotations[DependencyKey] += tuple(dependencies)
+
+    def deleteDependencies(self, dependencies):
+        self.dependencies = filter(lambda d: d not in dependencies,
+                                   self.dependencies)
+
     def setDependencies(self, dependencies):
         self._annotations[DependencyKey] = tuple(dependencies)
 
@@ -124,13 +130,52 @@
 
     dependencies = property(getDependencies, setDependencies)
 
+    def addDependents(self, dependents):
+        tracker = zapi.getParent(self.context)
+        bug_id = zapi.name(self.context)
+        for id in dependents:
+            deps = zapi.getAdapter(tracker[id], IBugDependencies)
+            deps.dependencies += (bug_id,)
+
+    def deleteDependents(self, dependents):
+        tracker = zapi.getParent(self.context)
+        bug_id = zapi.name(self.context)
+        for id in dependents:
+            deps = zapi.getAdapter(tracker[id], IBugDependencies)
+            d = filter(lambda x: str(x) != str(bug_id), deps.dependencies)
+            deps.dependencies = tuple(d)
+
+    def setDependents(self, dependents):
+        tracker = zapi.getParent(self.context)
+        bug_id = zapi.name(self.context)
+        for id, bug in tracker.items():
+            deps = zapi.getAdapter(bug, IBugDependencies)
+            if bug_id in deps.dependencies and id not in dependents:
+                d = list(deps.dependencies)
+                d.remove(bug_id)
+                deps.dependencies += tuple(d)
+            if bug_id not in deps.dependencies and id in dependents:
+                deps.dependencies += (bug_id,)
+
+    def getDependents(self):
+        tracker = zapi.getParent(self.context)
+        bug_id = zapi.name(self.context)
+        dependents = []
+        for id, bug in tracker.items():
+            deps = zapi.getAdapter(bug, IBugDependencies)
+            if bug_id in deps.dependencies:
+                dependents.append(id)
+        return dependents
+
+    dependents = property(getDependents, setDependents)
+
     def findChildren(self, recursive=True, all=None):
         "See zopeproducts.bugtracker.interfaces.IBugDependencies"
         if all is None:
             all = []
-        tracker = getParent(self.context)
-        contextName = getName(self.context)
-        deps = getAdapter(self.context, IBugDependencies)
+        tracker = zapi.getParent(self.context)
+        contextName = zapi.name(self.context)
+        deps = zapi.getAdapter(self.context, IBugDependencies)
         children = []
         for bugName in deps.dependencies:
             # Circle detection; if the bugName was processed before, skip it
@@ -141,7 +186,7 @@
 
             wrapped = ContextWrapper(tracker[bugName], tracker, name=bugName)
             if recursive is True:
-                deps = getAdapter(wrapped, IBugDependencies)
+                deps = zapi.getAdapter(wrapped, IBugDependencies)
                 subs = deps.findChildren(all=all)
             else:
                 subs = ()


=== zopeproducts/bugtracker/configure.zcml 1.8 => 1.9 ===
--- zopeproducts/bugtracker/configure.zcml:1.8	Tue Aug 12 14:55:07 2003
+++ zopeproducts/bugtracker/configure.zcml	Thu Aug 28 01:22:30 2003
@@ -253,6 +253,20 @@
       provides="zope.app.interfaces.index.text.ISearchableText"
       for=".interfaces.IBug" />
 
+  <content class=".bug.BugDependencyAdapter">
+
+    <require
+        permission="bugtracker.ViewBug"
+        attributes="dependencies dependents"/>
+
+    <require
+        permission="bugtracker.EditBug"
+        attributes="addDependencies deleteDependencies 
+                    addDependents deleteDependents" 
+        set_schema=".interfaces.IBugDependencies"/>
+
+  </content>
+
   <adapter
       factory=".bug.BugDependencyAdapter"
       provides=".interfaces.IBugDependencies"


=== zopeproducts/bugtracker/interfaces.py 1.3 => 1.4 ===
--- zopeproducts/bugtracker/interfaces.py:1.3	Tue Aug 12 14:55:07 2003
+++ zopeproducts/bugtracker/interfaces.py	Thu Aug 28 01:22:30 2003
@@ -103,12 +103,32 @@
 class IBugDependencies(Interface):
     """This object handles the dependencies of a bug."""
     
+    def addDependencies(self, dependencies):
+        """Add the dependencies given to the existing list."""
+
+    def deleteDependencies(self, dependencies):
+        """Delete the dependencies given from the existing list."""
+
     dependencies = List(
         title = _(u"Dependencies"),
         description = _(u"Other bugs this bug depends on."),
         value_type = TextLine(title=_(u"Bug Id"),
                               description=_(u"Bug Id.")),
         required=False)
+
+    def addDependents(self, dependents):
+        """Add the dependents given to the existing list."""
+
+    def deleteDependents(self, dependents):
+        """Delete the dependents given from the existing list."""
+
+    dependents = List(
+        title = _(u"Dependents"),
+        description = _(u"Other bugs that depend on this one"),
+        value_type = TextLine(title=_(u"Bug Id"),
+                              description=_(u"Bug Id.")),
+        required=False)
+
 
 
     def findChildren(recursive=True):


=== zopeproducts/bugtracker/mail.py 1.2 => 1.3 ===
--- zopeproducts/bugtracker/mail.py:1.2	Sat Jul 26 09:40:43 2003
+++ zopeproducts/bugtracker/mail.py	Thu Aug 28 01:22:30 2003
@@ -25,7 +25,7 @@
 
 from interfaces import IBug, IBugTracker, IMailSubscriptions
 
-SubscriberKey = 'http://www.zope.org/bugtracker#1.0/MailSubs/emails'
+SubscriberKey = 'bugtracker.MailSubsriptions.emails'
 
 class MailSubscriptions:
     """An adapter for IBugTracker and IBug to provide an


=== zopeproducts/bugtracker/version.txt 1.1 => 1.2 ===
--- zopeproducts/bugtracker/version.txt:1.1	Tue Aug 12 14:55:07 2003
+++ zopeproducts/bugtracker/version.txt	Thu Aug 28 01:22:30 2003
@@ -1 +1 @@
-Zope 3 Bug Tracker 0.2
+Zope 3 Bug Tracker 0.3


=== zopeproducts/bugtracker/vocabulary.py 1.5 => 1.6 ===
--- zopeproducts/bugtracker/vocabulary.py:1.5	Tue Aug 12 18:50:55 2003
+++ zopeproducts/bugtracker/vocabulary.py	Thu Aug 28 01:22:30 2003
@@ -127,7 +127,7 @@
 
     implements(IStatusVocabulary)
 
-    key = 'http://www.zope.org/bugtracker#1.0/status/values'
+    key = 'bugtracker.status.values'
     interface = IBugTracker
 
     title = _('Status Definitions')
@@ -137,7 +137,7 @@
 
     implements(IReleaseVocabulary)
 
-    key = 'http://www.zope.org/bugtracker#1.0/release/values'
+    key = 'bugtracker.release.values'
     interface = IBugTracker
 
     title = _('Release Definitions')
@@ -147,7 +147,7 @@
 
     implements(IPriorityVocabulary)
 
-    key = 'http://www.zope.org/bugtracker#1.0/priority/values'
+    key = 'bugtracker.priority.values'
     interface = IBugTracker
 
     title = _('Priority Definitions')
@@ -157,7 +157,7 @@
 
     implements(IBugTypeVocabulary)
 
-    key = 'http://www.zope.org/bugtracker#1.0/bugtype/values'
+    key = 'bugtracke.bugtype.values'
     interface = IBugTracker
 
     title = _('Bug Type Definitions')




More information about the Zope3-Checkins mailing list