Mercurial > public > sg101
diff downloads/management/commands/dlwgetcat.py @ 684:161b56849114
For Django 1.5: management commands should use self.stdout, etc. for output.
Note that I did not update the legacy commands since it is likely I will never
run or test these commands again.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 23 Aug 2013 19:17:40 -0500 |
parents | ee87ea74d46b |
children | a75554eb6bae |
line wrap: on
line diff
--- a/downloads/management/commands/dlwgetcat.py Fri Aug 23 19:02:45 2013 -0500 +++ b/downloads/management/commands/dlwgetcat.py Fri Aug 23 19:17:40 2013 -0500 @@ -17,7 +17,7 @@ class Command(LabelCommand): help = ("Produce on standard output a bash script that wgets all the files" " in a category. The files are downloaded with a slugified name.") - + args = "category-slug" def handle_label(self, slug, **options): @@ -50,4 +50,4 @@ # encode it ourselves since it can fail if you try to redirect output to # a file and any of the content is not ASCII... - print output.encode('utf-8') + self.stdout.write(output.encode('utf-8'))