diff options
Diffstat (limited to '4grab.py')
-rwxr-xr-x | 4grab.py | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -25,6 +25,7 @@ import os import config from util import raw_input_with_default +import util import download import progressbar @@ -110,6 +111,12 @@ under certain conditions.""") dest="sort", help="Sort downloaded images, most handy if you've used " "older versions which didn't sort yet") + parser.add_option("-l", + "--loglevel", + nargs=1, + dest="loglevel", + metavar="LEVEL", + help="Changes the default log level to LEVEL") (options, args) = parser.parse_args() if options.confval and (options.tempcat @@ -175,8 +182,9 @@ under certain conditions.""") elif options.tempcat: conf.set_categories([options.tempcat]) -#base_url = "%s%s/" % (base_url, conf.get_categories()) - + elif options.loglevel is not None: + util.loglevel = util.LogType.from_int(options.loglevel) + if __name__ == "__main__": conf = config.Configuration() sort = sorter.Sorter() @@ -196,3 +204,4 @@ if __name__ == "__main__": except KeyboardInterrupt: print print "So you don't want these images? Fine! I'll stop then." + util.log(util.LogType.Err, "Quit on user request") |