From c0e9f89ea366734c65a4ee2fe4af7f4a401f2bdb Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Tue, 5 Feb 2013 18:22:46 -0800 Subject: [PATCH] Consistent logging. --- TorrentToMedia.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 626c6116..4cc95eab 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -8,7 +8,7 @@ from subprocess import call old_stdout = sys.stdout #backup the default stdout log_file = open(os.path.join(os.path.dirname(sys.argv[0]), "postprocess.log"),"a+") sys.stdout = log_file #create a local log file, and direct all "print" to the log. -print "TorrentToMedia V4.1" +print "INFO: TorrentToMedia V4.1" if len(sys.argv) == 4: ##You can use the following parameters (UTORRENT): ## @@ -40,13 +40,13 @@ if len(sys.argv) == 4: ##Stopped - 13 ## We will pass in %D, %N, %L from uTorrent - print "script called from utorrent" + print "INFO: Script called from utorrent" Directory = sys.argv[1] ## %D -- Example output: F:\path\to\dir\My.Series.S01E01.720p.HDTV.x264-2HD Name = sys.argv[2] ## %N -- Example output: My.Series.S01E01.720p.HDTV.x264-2HD Category = sys.argv[3] ## %L -- Example output: tvseries ## This is the label in uTorrent elif len(sys.argv) > 1: #Doesn't match Transmission (1) or uTorrent (4). - print "The number of arguments passed is", len(sys.argv), "unable to determin the arguments to use, Exiting" + print "Error: The number of arguments passed is", len(sys.argv), "unable to determin the arguments to use, Exiting" sys.exit(-1) else: @@ -60,9 +60,9 @@ else: try: Directory = os.getenv('TR_TORRENT_DIR') Name = os.getenv('TR_TORRENT_NAME') - print "script called from Transmission" + print "INFO: Script called from Transmission" except: - print "There was a problem loading variables from Transmission", "Exiting" + print "Error: There was a problem loading variables from Transmission", "Exiting" sys.exit(-1) Category = os.path.basename(os.path.normpath(Directory)) #We assume the last directory is the category for now.