From 046a6dc79ca92047d1c92adf012fb8a9c1205188 Mon Sep 17 00:00:00 2001 From: Jon Monroe Date: Wed, 13 Feb 2013 17:23:59 -0800 Subject: [PATCH 1/5] Created environment file Created a file that defines various runtime constants like what VERSION we're running. --- env.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 env.py diff --git a/env.py b/env.py new file mode 100644 index 00000000..687140d4 --- /dev/null +++ b/env.py @@ -0,0 +1,2 @@ + +VERSION = 'v4.2' From 6dde5794acde5e73f0b4fda7107d3f0fa255cb2b Mon Sep 17 00:00:00 2001 From: Jon Monroe Date: Wed, 13 Feb 2013 20:24:30 -0500 Subject: [PATCH 2/5] Update env.py --- env.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/env.py b/env.py index 687140d4..e3611246 100644 --- a/env.py +++ b/env.py @@ -1,2 +1 @@ - -VERSION = 'v4.2' +VERSION = 'V4.2' From a16cc8418b52b01972972724a1412ab8a75be21f Mon Sep 17 00:00:00 2001 From: Jon Monroe Date: Wed, 13 Feb 2013 20:25:51 -0500 Subject: [PATCH 3/5] Added VERSION constant to TorrentToMedia --- TorrentToMedia.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index c11d984c..b7e7009f 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -5,6 +5,8 @@ import autoProcessTV import sys, os, ConfigParser, shutil from subprocess import call +from nzbToMediaEnv import * + def removeEmptyFolders(path): if not os.path.isdir(path): return @@ -26,7 +28,7 @@ def removeEmptyFolders(path): 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 "INFO: TorrentToMedia V4.2" +print "INFO: TorrentToMedia %s" % VERSION if len(sys.argv) == 4: ##You can use the following parameters (UTORRENT): ## From 61a9da26d2ac98583c714e86681e45e4237d2adc Mon Sep 17 00:00:00 2001 From: Jon Monroe Date: Wed, 13 Feb 2013 17:26:49 -0800 Subject: [PATCH 4/5] Created better named ENV file --- nznToMediaEnv | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 nznToMediaEnv diff --git a/nznToMediaEnv b/nznToMediaEnv new file mode 100644 index 00000000..922704e1 --- /dev/null +++ b/nznToMediaEnv @@ -0,0 +1,2 @@ + +VERSION = 'V4.2' From 4adec9e8de9404f9ce717bcd6272df94aa901f02 Mon Sep 17 00:00:00 2001 From: Berkona Date: Wed, 13 Feb 2013 20:31:33 -0500 Subject: [PATCH 5/5] Added VERSION constant to nzbToSickBeard, nzbToCouchPotato. Also finally renamed nzbToMediaEnv correctly... I was doing it on the github web interface so forgive the last commits --- env.py | 1 - nzbToCouchPotato.py | 16 +++++++++------- nznToMediaEnv => nzbToMediaEnv.py | 0 nzbToSickBeard.py | 16 +++++++++------- 4 files changed, 18 insertions(+), 15 deletions(-) delete mode 100644 env.py rename nznToMediaEnv => nzbToMediaEnv.py (100%) diff --git a/env.py b/env.py deleted file mode 100644 index e3611246..00000000 --- a/env.py +++ /dev/null @@ -1 +0,0 @@ -VERSION = 'V4.2' diff --git a/nzbToCouchPotato.py b/nzbToCouchPotato.py index d43cb7aa..d9bcd664 100755 --- a/nzbToCouchPotato.py +++ b/nzbToCouchPotato.py @@ -1,9 +1,11 @@ #!/usr/bin/env python import sys -import autoProcessMovie +import autoProcessMovie -print "nzbToCouchPotato V4.1" +from nzbToMediaEnv import * + +print "nzbToCouchPotato %s" % VERSION # SABnzbd if len(sys.argv) == 8: @@ -20,15 +22,15 @@ if len(sys.argv) == 8: # NZBGet elif len(sys.argv) == 4: -# NZBGet argv: -# 1 The final directory of the job (full path) -# 2 The original name of the NZB file +# NZBGet argv: +# 1 The final directory of the job (full path) +# 2 The original name of the NZB file # 3 The status of the download: 0 == successful print "Script triggered from NZBGet, starting autoProcessMovie..." - + autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[3]) else: - print "Invalid number of arguments received from client." + print "Invalid number of arguments received from client." print "Running autoProcessMovie as a manual run..." autoProcessMovie.process('Manual Run', 'Manual Run', 0) diff --git a/nznToMediaEnv b/nzbToMediaEnv.py similarity index 100% rename from nznToMediaEnv rename to nzbToMediaEnv.py diff --git a/nzbToSickBeard.py b/nzbToSickBeard.py index 635b36a2..d389097f 100755 --- a/nzbToSickBeard.py +++ b/nzbToSickBeard.py @@ -14,7 +14,7 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with Sick Beard. If not, see . # @@ -25,7 +25,9 @@ import sys import autoProcessTV -print "nzbToSickBeard V4.1" +from nzbToMediaEnv import * + +print "nzbToSickBeard %s" % VERSION # SABnzbd if len(sys.argv) == 8: @@ -42,15 +44,15 @@ if len(sys.argv) == 8: # NZBGet elif len(sys.argv) == 4: -# NZBGet argv: -# 1 The final directory of the job (full path) -# 2 The original name of the NZB file +# NZBGet argv: +# 1 The final directory of the job (full path) +# 2 The original name of the NZB file # 3 The status of the download: 0 == successful print "Script triggered from NZBGet, starting autoProcessTV..." - + autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[3]) else: - print "Invalid number of arguments received from client." + print "Invalid number of arguments received from client." print "Running autoProcessTV as a manual run..." autoProcessTV.processEpisode('Manual Run', 'Manual Run', 0)