Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 7ec3ea7b0b63d6beda1a1a851f43596f686b9edc 1 parent fed3b32
Jacob Kaplan-Moss jacobian authored
8 django_website/aggregator/management/commands/update_feeds.py
View
@@ -34,7 +34,11 @@ def handle(self, *args, **kwargs):
sys.exit(1)
try:
- verbose = kwargs.get('verbosity')
+ verbose = int(kwargs['verbosity']) > 0
+ except (KeyError, TypeError, ValueError):
+ verbose = True
+
+ try:
socket.setdefaulttimeout(15)
self.update_feeds(verbose=verbose, num_threads=kwargs['threads'])
except:
@@ -50,7 +54,7 @@ def update_feeds(self, verbose=False, num_threads=4):
threadpool = []
for i in range(num_threads):
- threadpool.append(FeedUpdateWorker(feed_queue, verbose))
+ threadpool.append(FeedUpdateWorker(q=feed_queue, verbose=verbose))
[t.start() for t in threadpool]
[t.join() for t in threadpool]
9 django_website/docs/management/commands/update_docs.py
View
@@ -13,8 +13,15 @@
class Command(NoArgsCommand):
def handle_noargs(self, **kwargs):
+ try:
+ verbose = int(kwargs['verbosity']) > 0
+ except (KeyError, TypeError, ValueError):
+ verbose = True
+
for release in DocumentRelease.objects.all():
- print "Updating %s..." % release
+ if verbose:
+ print "Updating %s..." % release
+
destdir = Path(settings.DOCS_BUILD_ROOT).child(release.lang, release.version)
if not destdir.exists():
destdir.mkdir(parents=True)
Please sign in to comment.
Something went wrong with that request. Please try again.