[Python-modules-commits] r11619 - in packages/python-whisper/trunk/debian/patches (1 file)

statik-guest at users.alioth.debian.org statik-guest at users.alioth.debian.org
Sun Feb 7 18:35:40 UTC 2010


    Date: Sunday, February 7, 2010 @ 18:35:39
  Author: statik-guest
Revision: 11619

Fix a bunch of inverted logic in the cleanup-assertions patch.

Modified:
  packages/python-whisper/trunk/debian/patches/cleanup-assertions

Modified: packages/python-whisper/trunk/debian/patches/cleanup-assertions
===================================================================
--- packages/python-whisper/trunk/debian/patches/cleanup-assertions	2010-02-07 17:07:17 UTC (rev 11618)
+++ packages/python-whisper/trunk/debian/patches/cleanup-assertions	2010-02-07 18:35:39 UTC (rev 11619)
@@ -1,10 +1,10 @@
 Description: Convert some asserts to exceptions instead.
 Forwarded: https://code.launchpad.net/~statik/graphite/cleanup-assertions/+merge/18780
 Author: Elliot Murphy <elliot at ubuntu.com>
-Last-Update: 2010-02-06
+Last-Update: 2010-02-07
 === modified file 'whisper/whisper.py'
 --- whisper/whisper.py	2009-11-02 06:47:51 +0000
-+++ whisper/whisper.py	2010-02-07 03:26:22 +0000
++++ whisper/whisper.py	2010-02-07 18:32:13 +0000
 @@ -53,6 +53,23 @@
  
  debug = startBlock = endBlock = lambda *a,**k: None
@@ -44,10 +44,10 @@
 -    "You cannot configure two archives with the same precision %s,%s" % (archive,next)
 -    assert (next[0] % archive[0]) == 0,\
 -    "Higher precision archives' precision must evenly divide all lower precision archives' precision %s,%s" % (archive[0],next[0])
-+    if archive[0] < next[0]:
++    if not (archive[0] < next[0]):
 +      raise InvalidConfiguration("You cannot configure two archives "
 +        "with the same precision %s,%s" % (archive,next))
-+    if (next[0] % archive[0]) == 0:
++    if (next[0] % archive[0]) != 0:
 +      raise InvalidConfiguration("Higher precision archives' precision "
 +        "must evenly divide all lower precision archives' precision %s,%s" \
 +        % (archive[0],next[0]))
@@ -55,7 +55,7 @@
      nextRetention = next[0] * next[1]
 -    assert nextRetention > retention,\
 -    "Lower precision archives must cover larger time intervals than higher precision archives %s,%s" % (archive,next)
-+    if nextRetention > retention:
++    if not (nextRetention > retention):
 +      raise InvalidConfiguration("Lower precision archives must cover "
 +        "larger time intervals than higher precision archives %s,%s" \
 +        % (archive,next))
@@ -71,7 +71,7 @@
    timestamp = int(timestamp)
    diff = now - timestamp
 -  assert diff < header['maxRetention'] and diff >= 0, "Timestamp not covered by any archives in this database"
-+  if diff < header['maxRetention']:
++  if not ((diff < header['maxRetention']) and diff >= 0):
 +    raise TimestampNotCovered("Timestamp not covered by any archives in "
 +      "this database.")
    for i,archive in enumerate(header['archives']): #Find the highest-precision archive that covers timestamp
@@ -82,7 +82,7 @@
      fromTime = oldestTime
  
 -  assert fromTime < untilTime, "Invalid time interval"
-+  if fromTime < untilTime:
++  if not (fromTime < untilTime):
 +    raise InvalidTimeInterval("Invalid time interval")
    if untilTime > now:
      untilTime = now




More information about the Python-modules-commits mailing list