Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Made the custom management commands respect --verbosity=0.

  • Loading branch information...
commit 7ec3ea7b0b63d6beda1a1a851f43596f686b9edc 1 parent fed3b32
Jacob Kaplan-Moss authored January 28, 2011
8  django_website/aggregator/management/commands/update_feeds.py
@@ -34,7 +34,11 @@ def handle(self, *args, **kwargs):
34 34
             sys.exit(1)
35 35
 
36 36
         try:
37  
-            verbose = kwargs.get('verbosity')
  37
+            verbose = int(kwargs['verbosity']) > 0
  38
+        except (KeyError, TypeError, ValueError):
  39
+            verbose = True
  40
+            
  41
+        try:
38 42
             socket.setdefaulttimeout(15)
39 43
             self.update_feeds(verbose=verbose, num_threads=kwargs['threads'])
40 44
         except:
@@ -50,7 +54,7 @@ def update_feeds(self, verbose=False, num_threads=4):
50 54
 
51 55
         threadpool = []
52 56
         for i in range(num_threads):
53  
-            threadpool.append(FeedUpdateWorker(feed_queue, verbose))
  57
+            threadpool.append(FeedUpdateWorker(q=feed_queue, verbose=verbose))
54 58
             
55 59
         [t.start() for t in threadpool]
56 60
         [t.join() for t in threadpool]
9  django_website/docs/management/commands/update_docs.py
@@ -13,8 +13,15 @@
13 13
 
14 14
 class Command(NoArgsCommand):
15 15
     def handle_noargs(self, **kwargs):
  16
+        try:
  17
+            verbose = int(kwargs['verbosity']) > 0
  18
+        except (KeyError, TypeError, ValueError):
  19
+            verbose = True
  20
+        
16 21
         for release in DocumentRelease.objects.all():
17  
-            print "Updating %s..." % release
  22
+            if verbose:
  23
+                print "Updating %s..." % release
  24
+                
18 25
             destdir = Path(settings.DOCS_BUILD_ROOT).child(release.lang, release.version)
19 26
             if not destdir.exists():
20 27
                 destdir.mkdir(parents=True)

0 notes on commit 7ec3ea7

Please sign in to comment.
Something went wrong with that request. Please try again.