Exceptions loggen; jetzt ist tivomirror silent (-v verwenden)
This commit is contained in:
parent
8cd90d5984
commit
cc0e499908
1 changed files with 25 additions and 22 deletions
|
@ -1,6 +1,6 @@
|
|||
#!/usr/local/bin/python
|
||||
|
||||
# $Schlepperbande: src/tivomirror/tivomirror,v 1.57 2014/07/01 07:04:45 stb Exp $
|
||||
# $Schlepperbande: src/tivomirror/tivomirror,v 1.58 2014/07/01 16:57:33 stb Exp $
|
||||
#
|
||||
# Stefans Script, um die Sendungen vom Tivo runterzuladen und in MPEG4
|
||||
# zu transkodieren.
|
||||
|
@ -386,31 +386,34 @@ def main():
|
|||
handler.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
|
||||
logger.addHandler(handler)
|
||||
|
||||
options, remainder = getopt.getopt(sys.argv[1:], 'dvT',
|
||||
['ignoreepisodetitle'])
|
||||
try:
|
||||
options, remainder = getopt.getopt(sys.argv[1:], 'dvT',
|
||||
['ignoreepisodetitle'])
|
||||
|
||||
for opt, arg in options:
|
||||
if opt in ('-T', '--ignoreepisodetitle'):
|
||||
ignoreepisodetitle = True
|
||||
if opt in ('-d'):
|
||||
logger.setLevel(logging.DEBUG)
|
||||
if opt in ('-v'):
|
||||
handler = logging.StreamHandler()
|
||||
logger.addHandler(handler)
|
||||
downloaddb = anydbm.open("downloads.db", "c")
|
||||
logger.info("*** Getting listing")
|
||||
dom = gettoc()
|
||||
savetoc(dom)
|
||||
for opt, arg in options:
|
||||
if opt in ('-T', '--ignoreepisodetitle'):
|
||||
ignoreepisodetitle = True
|
||||
if opt in ('-d'):
|
||||
logger.setLevel(logging.DEBUG)
|
||||
if opt in ('-v'):
|
||||
handler = logging.StreamHandler()
|
||||
logger.addHandler(handler)
|
||||
downloaddb = anydbm.open("downloads.db", "c")
|
||||
logger.info("*** Getting listing")
|
||||
dom = gettoc()
|
||||
savetoc(dom)
|
||||
|
||||
if len(remainder) == 1:
|
||||
if remainder[0] == "list":
|
||||
printtoc(dom, downloaddb)
|
||||
elif remainder[0] == "mirror":
|
||||
if len(remainder) == 1:
|
||||
if remainder[0] == "list":
|
||||
printtoc(dom, downloaddb)
|
||||
elif remainder[0] == "mirror":
|
||||
mirror(dom, downloaddb)
|
||||
else:
|
||||
mirror(dom, downloaddb)
|
||||
else:
|
||||
mirror(dom, downloaddb)
|
||||
|
||||
downloaddb.close()
|
||||
downloaddb.close()
|
||||
except Exception:
|
||||
logger.exception("")
|
||||
logger.info("*** Completed")
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in a new issue