Merge pull request #51 from berkona/master

Merged version output & Added Environment file
This commit is contained in:
clinton-hall 2013-02-13 18:53:37 -08:00
commit b083f4d762
4 changed files with 23 additions and 15 deletions

View file

@ -5,6 +5,8 @@ import autoProcessTV
import sys, os, ConfigParser, shutil import sys, os, ConfigParser, shutil
from subprocess import call from subprocess import call
from nzbToMediaEnv import *
def removeEmptyFolders(path): def removeEmptyFolders(path):
if not os.path.isdir(path): if not os.path.isdir(path):
return return
@ -26,7 +28,7 @@ def removeEmptyFolders(path):
old_stdout = sys.stdout #backup the default stdout old_stdout = sys.stdout #backup the default stdout
log_file = open(os.path.join(os.path.dirname(sys.argv[0]), "postprocess.log"),"a+") 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. 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: if len(sys.argv) == 4:
##You can use the following parameters (UTORRENT): ##You can use the following parameters (UTORRENT):
## ##

View file

@ -1,9 +1,11 @@
#!/usr/bin/env python #!/usr/bin/env python
import sys import sys
import autoProcessMovie import autoProcessMovie
print "nzbToCouchPotato V4.1" from nzbToMediaEnv import *
print "nzbToCouchPotato %s" % VERSION
# SABnzbd # SABnzbd
if len(sys.argv) == 8: if len(sys.argv) == 8:
@ -20,15 +22,15 @@ if len(sys.argv) == 8:
# NZBGet # NZBGet
elif len(sys.argv) == 4: elif len(sys.argv) == 4:
# NZBGet argv: # NZBGet argv:
# 1 The final directory of the job (full path) # 1 The final directory of the job (full path)
# 2 The original name of the NZB file # 2 The original name of the NZB file
# 3 The status of the download: 0 == successful # 3 The status of the download: 0 == successful
print "Script triggered from NZBGet, starting autoProcessMovie..." print "Script triggered from NZBGet, starting autoProcessMovie..."
autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[3]) autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[3])
else: else:
print "Invalid number of arguments received from client." print "Invalid number of arguments received from client."
print "Running autoProcessMovie as a manual run..." print "Running autoProcessMovie as a manual run..."
autoProcessMovie.process('Manual Run', 'Manual Run', 0) autoProcessMovie.process('Manual Run', 'Manual Run', 0)

2
nzbToMediaEnv.py Normal file
View file

@ -0,0 +1,2 @@
VERSION = 'V4.2'

View file

@ -14,7 +14,7 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>. # along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
# #
@ -25,7 +25,9 @@
import sys import sys
import autoProcessTV import autoProcessTV
print "nzbToSickBeard V4.1" from nzbToMediaEnv import *
print "nzbToSickBeard %s" % VERSION
# SABnzbd # SABnzbd
if len(sys.argv) == 8: if len(sys.argv) == 8:
@ -42,15 +44,15 @@ if len(sys.argv) == 8:
# NZBGet # NZBGet
elif len(sys.argv) == 4: elif len(sys.argv) == 4:
# NZBGet argv: # NZBGet argv:
# 1 The final directory of the job (full path) # 1 The final directory of the job (full path)
# 2 The original name of the NZB file # 2 The original name of the NZB file
# 3 The status of the download: 0 == successful # 3 The status of the download: 0 == successful
print "Script triggered from NZBGet, starting autoProcessTV..." print "Script triggered from NZBGet, starting autoProcessTV..."
autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[3]) autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[3])
else: else:
print "Invalid number of arguments received from client." print "Invalid number of arguments received from client."
print "Running autoProcessTV as a manual run..." print "Running autoProcessTV as a manual run..."
autoProcessTV.processEpisode('Manual Run', 'Manual Run', 0) autoProcessTV.processEpisode('Manual Run', 'Manual Run', 0)