[zopeorg-checkins] CVS: Products/Extensions - TrackerMethods.py:1.2

Sidnei da Silva sidnei at x3ng.com.br
Fri May 30 17:15:19 EDT 2003


Update of /cvs-zopeorg/Products/Extensions
In directory cvs.zope.org:/tmp/cvs-serv9455

Modified Files:
	TrackerMethods.py 
Log Message:
Overflow with Python2.2.3

=== Products/Extensions/TrackerMethods.py 1.1 => 1.2 ===
 def setTrackerConfig(self, REQUEST):
     """Process fundamental configuration activities.
 
-    If request has a 'nextpage' setting, we redirect there, otherwise we go 
+    If request has a 'nextpage' setting, we redirect there, otherwise we go
     to the tracker proper."""
 
     # XXX Will this be needed for site search stuff?
@@ -102,7 +102,7 @@
             for role in roles:
                 if not tracker._has_user_defined_role(role):
                     tracker._addRole(role)
-            
+
     if do_catalog:
         trackerInitCatalog(tracker)
 
@@ -179,7 +179,7 @@
             REQUEST.set('tickets_%s_date' % i, dstr)
 
     # tracker.assignments: {supporter: {trait: [vals, ...]}}
-    sa = {}  
+    sa = {}
     if hasattr(self, 'assignments'):
         sa.update(self.assignments)
     # tracker.supporters: [supporter, ...]
@@ -288,7 +288,7 @@
             sa[t] = curr
 
     self.assignments = assignments
- 
+
 def addTrackerIssue(self, REQUEST=None):
     """Do permission setting and item allocations for new issue.
 
@@ -448,13 +448,13 @@
 
     Populate the issue with a freshly minted item, setting the item's action
     from the msgrole setting and the description, from, date, etc from the
-    REQUEST, and doing a lot of incidental business: 
+    REQUEST, and doing a lot of incidental business:
 
     - Create a new item
     - Add the item to the issue
     - Register the item's action according to the msgrole.
     - Set some other item metadata according to the REQUEST and incidental
-      data (time, etc.) 
+      data (time, etc.)
     - Do divert, if any
     - Set the issue and item stage using setIssueStage(), IF valid.
     - Stash user's new signature and/or alternate email addr if specified
@@ -579,7 +579,7 @@
 
     for ps in item.propertysheets:
         ps.manage_changeProperties(REQUEST)
-                      
+
     origin = REQUEST.get("in_reply_to", '')
     if origin:
         try:
@@ -638,7 +638,7 @@
         if msgrole in ['resolve', 'defer', 'reject']:
             respred = REQUEST['RESPONSE'].redirect
             msg = urllib.quote('manage_tabs_message=<font color="green">'
-                               'Issue %s %s done.</font>' % (issue.id, 
+                               'Issue %s %s done.</font>' % (issue.id,
                                                              msgrole))
             return respred(tracker.absolute_url() + '?' + msg)
         else:
@@ -660,7 +660,7 @@
     stuff (full names, emails) are ported from the old to the new issue."""
 
     ## XXX Currently we fail to port anonymous or superuser requesters and
-    ##     subscribers to the target issue of the divert.  This is a bug, but 
+    ##     subscribers to the target issue of the divert.  This is a bug, but
     ##     it's a hassle to fix and i'm a bit undermotivated to cater to
     ##     anonymous/superuser submitters.
 
@@ -692,7 +692,7 @@
     # Ensure parties to diverted issue can view target.
     # XXX Eventually offer choices, simple override or:
     #     - endow those who can't view with privilege,
-    #     - abandon those who can't view, 
+    #     - abandon those who can't view,
     requester = issue.requester
     unpriv = ""
     numunpriv = 0
@@ -704,7 +704,7 @@
         return ('<strong><font color="red">Divert failed</font></strong> - '
                 ' <p> Diverted issue participant%s <strong> %s </strong>'
                 ' not privileged to view the target issue'
-                ' %s.' 
+                ' %s.'
                 '</p> Hit back to return to the form and change your'
                 '<br> target, or, if suitable, visit the target and change its'
                 '<br> privacy or security settings to enable access.\n'
@@ -718,7 +718,7 @@
         d = DateTime()
         text = 'Subject: [%s] Subsuming issue %s\n' % (target_emblem,
                                                        diverted_emblem)
-        text = text + ('From: Tracker System for <%s>\n' % 
+        text = text + ('From: Tracker System for <%s>\n' %
                        tgt_tracker.adminaddr)
         text = text + 'To: "Issue Participants":;\n'
         text = text + 'Date: %s\n' % d.rfc822()
@@ -771,7 +771,7 @@
         if not tgt_issue.alt_full_names:
             tgt_issue.alt_full_names = {}
         tgt_issue.alt_full_names.update(issue.alt_full_names)
-            
+
     tgt_issue.audited_state.set('subsume_issue', diverted_emblem,
                                 `REQUEST.AUTHENTICATED_USER`)
 
@@ -1131,14 +1131,14 @@
                                       "\nowner to take %s action." % which)
 
     if stage in ['accepted', 'resolved', 'completed', 'diverted', 'deferred',
-                 'rejected']: 
+                 'rejected']:
         if userid in tracker.supporters:
             issue.manage_addLocalRoles(userid, ['IssueOwner'])
         if item:
             item.msgrole = stage
     elif stage == 'pending':
         # Enable moving an issue to pending while still keeping
-        # supporter assignment.  People can 'Edit State' to remove the 
+        # supporter assignment.  People can 'Edit State' to remove the
         # supporter, as well.
         # XXX Eventually this should be an optional behavior.
         #clear_local_role('IssueOwner', issue)
@@ -1311,12 +1311,12 @@
             if self.id in self.promotes():
                 raise 'Bad Request', "Promoted items must be public."
             self.manage_permission('View', roles=minimal, acquire=0)
-        
+
 
 ## def index_object(self):
 ##     """Site catalog indexing
 
-##     The tracker has an explicit one for the reindexing process, so that the 
+##     The tracker has an explicit one for the reindexing process, so that the
 ##     subcomponents are traversed then."""
 ##     return None                         # XXX !!! Temporary until cataloging
 
@@ -1333,7 +1333,7 @@
 def trackerOnDeleteObject(self):
     """Object delete handler.
 
-    Tracker has an explicit one both to do its own unindexing and also cause 
+    Tracker has an explicit one both to do its own unindexing and also cause
     traversal of the subcomponents."""
     for i in self.values():
         for j in i.values():
@@ -1377,7 +1377,7 @@
     #     Problem is that the collection of traits is dynamic, and the names
     #     may well collide with catalogued attributes, like title, priority,
     #     stage, etc.  So we would need a handle in each element for each
-    #     trait - yuck.  For now they're grouped together - which means people 
+    #     trait - yuck.  For now they're grouped together - which means people
     #     only get an 'or' style search within traits.  If we had some easy
     #     'and'ing mechanism for search results, we would have a way to do
     #     multiple passes, refiningthe search to the desired results.
@@ -1414,7 +1414,7 @@
     path = make_catalogPath(element)
     tracker._catalog.uncatalogObject(path)
     tracker._catalog.catalogObject(element, path)
-    
+
 def make_catalogPath(element):
     """Construct element's catalog path, wrt encompassing tracker and issue."""
     if element.type == 'tracker_issue':
@@ -1603,7 +1603,7 @@
         boundary = max(0, len(pool) - 1)
     if boundary > lenpool:
         boundary == lenpool
-    
+
     if direction in [0, 1]:
         # Going forwards from boundary.
         start = boundary
@@ -1620,7 +1620,7 @@
 ##                    % (len(pool), size, direction, last_start, last_end,
 ##                       boundary, start, end))
     return(pool[start:end], start, len(pool) - end)
-    
+
 def fieldValuesRange(self, field, precedence=None, include=None):
     """Return the sorted range of values for a particular catalog field.
 
@@ -1676,7 +1676,7 @@
 
     # XXX Would probably be better to use an explicit .get/.set
     #     interface, if this were actually *on* a user object.
-    # XXX Generalizing this would means something like 'MemberPref', where the 
+    # XXX Generalizing this would means something like 'MemberPref', where the
     #     application name would be a parameter - and there should be some
     #     shared space.
     # XXX There's no security provision!  Not sure how i'd organize it.  Sigh.
@@ -1759,20 +1759,20 @@
         if period_only:
             return (start, end)
 
-    
+
     criteria = criteria.copy()
     criteria.update({'date': [start, end], 'date_usage': 'range:min:max'})
 
     results = tracker._catalog.searchResults(criteria)
     return (results, start, end)
 
-INFINITY = 1e200**2
+INFINITY = 1e32**2 + 0L
 
 def quota_stats(self, stat, expired=0):
     """Return triple: (tracker activity stat, start-date, end-date).
 
     An activity stat is the number of tracker issues having the indicated
-    status - for 
+    status - for
 
     The figures are computed with respect to the tracker's quota, if it's a
     dedicated one.
@@ -1815,7 +1815,7 @@
             return (tracker.tickets_max -
                     (resolved - quota_stats(tracker, 'accepted')))
 
-    # This needs to be after the 
+    # This needs to be after the
     elif stat == 'period':
         return quota_stat_search(tracker, period_only=1)
 
@@ -1844,7 +1844,7 @@
     (<totals rec>, <supporters list>)
     <totals rec> := <activity rec>
     <supporters list>: ((supporter, <activity rec>), ...)
-    <activity rec> := {'platinum': <tickets rec>, 'gold': <tickets rec>, 
+    <activity rec> := {'platinum': <tickets rec>, 'gold': <tickets rec>,
                        'silver': <tickets rec>, 'bronze': <tickets rec>,
                        'open': <tickets rec>, 'total': <tickets rec>]
     <tickets rec> := [#active, #resolved, #other]."""
@@ -1969,7 +1969,7 @@
 
     The objects are returned as single-element tuples, to make them easy to
     distinguish from the error-message returns (ie, result[1][1:] == ()) and
-    to insulate them from the zope auto-call mechanism applied in dtml-var and 
+    to insulate them from the zope auto-call mechanism applied in dtml-var and
     dtml-in operations.
 
     For those URLs which do not resolve into trackers (or resolve into
@@ -2021,7 +2021,7 @@
         if branchpoint:
             ps = ps[branchpoint:]
 
-        # Ascend to the branch point, then go back down to the object, bailing 
+        # Ascend to the branch point, then go back down to the object, bailing
         # if we hit an access error.  *NOTE* that by ascending and descending
         # we ensure that the acqusition hierarchy - hence the permissions
         # context - is for the object we're visiting.
@@ -2072,7 +2072,7 @@
 
     For now, every acl_user account is a member account.
 
-    Optional ceiling specifies a maximum amount of users to fetch - we 
+    Optional ceiling specifies a maximum amount of users to fetch - we
     return the usernames for the first of that number that we find."""
     # Collect users from all acquired acl_users:
     users = []
@@ -2108,7 +2108,7 @@
 
     AUTHENTICATED_USER must have the 'manager' global role to run this.
 
-    Go to the value of the REQUEST nextpage setting, if any, or to fromurl, if 
+    Go to the value of the REQUEST nextpage setting, if any, or to fromurl, if
     any, or to referer."""
 
     if REQUEST is None:
@@ -2116,7 +2116,7 @@
 
     requester = REQUEST.AUTHENTICATED_USER
     if not tracker_role(self, 'staff', user=requester):
-        raise 'Bad Request', "Restricted to tracker owner and supporters." 
+        raise 'Bad Request', "Restricted to tracker owner and supporters."
 
     for acl_users in get_acl_users_acquired(self):
 
@@ -2174,7 +2174,7 @@
 def createRules():
     """Create the rules for an issue tracker."""
     # XXX This is an external method for convenience.
-    # XXX Eventually this will be a (perhaps more genericish) default, 
+    # XXX Eventually this will be a (perhaps more genericish) default,
     #     and there will be a ttw interface for changing and refining them.
 
     # See TrackerBase.Noodge.eval_contingency(), .eval_condition(), and
@@ -2207,7 +2207,7 @@
 ##              " %[var absolute_url]s."),
 ##             (SET, 'alert', 'receipt ack'),
 ##             (SET, 'msgfromrole', 'requester'))),
-        
+
 ##        (   # Ownership pending alerts.
 ##            (CONDITION, (AND,
 ##                          (VALUE, 'rsvps'),





More information about the zopeorg-checkins mailing list