[Checkins] SVN: Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/fetch.py added VERBOSE setting (to quiet down fetch, actually)

Luciano Ramalho luciano at ramalho.org
Wed Aug 8 13:30:41 EDT 2007


Log message for revision 78711:
  added VERBOSE setting (to quiet down fetch, actually)
  

Changed:
  U   Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/fetch.py

-=-
Modified: Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/fetch.py
===================================================================
--- Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/fetch.py	2007-08-08 17:13:37 UTC (rev 78710)
+++ Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/fetch.py	2007-08-08 17:30:40 UTC (rev 78711)
@@ -15,6 +15,8 @@
 
 POLL_INTERVAL = 1 # minimum seconds to wait between calls to fetch.poll
 
+VERBOSE = False
+
 class Fetch(object):
     
     def __init__(self, xmlrpc_url, poll, callback, source):
@@ -30,13 +32,13 @@
     def polled(self, isbns):
         i = 0
         if isbns:
-            print 'polled:', ' '.join(isbns)
+            if VERBOSE: print 'polled:', ' '.join(isbns)
             # fetch max_ids_per_request, and one request per second
             for i, start in enumerate(range(0,len(isbns),
                                             self.source.max_ids_per_request)):
                 end = start + self.source.max_ids_per_request
                 reactor.callLater(i, self.downloadItemsPage, isbns[start:end])
-        else:
+        elif VERBOSE:
             stdout.write('.')
             stdout.flush()
         reactor.callLater(i+POLL_INTERVAL, self.poll)



More information about the Checkins mailing list