mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
Logging now in sub-routines
This commit is contained in:
parent
c134c65adf
commit
3d9675f66e
1 changed files with 0 additions and 11 deletions
|
@ -10,7 +10,6 @@ import datetime
|
||||||
import time
|
import time
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
|
|
||||||
|
|
||||||
# Custom imports
|
# Custom imports
|
||||||
import linktastic.linktastic as linktastic
|
import linktastic.linktastic as linktastic
|
||||||
import autoProcessMovie
|
import autoProcessMovie
|
||||||
|
@ -22,7 +21,6 @@ from utorrent.client import UTorrentClient
|
||||||
nzbtomedia_configure_logging(os.path.dirname(sys.argv[0]))
|
nzbtomedia_configure_logging(os.path.dirname(sys.argv[0]))
|
||||||
Logger = logging.getLogger(__name__)
|
Logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def category_search(inputDirectory, inputName, inputCategory, root, categories):
|
def category_search(inputDirectory, inputName, inputCategory, root, categories):
|
||||||
categorySearch = [os.path.normpath(inputDirectory), ""] # initializie
|
categorySearch = [os.path.normpath(inputDirectory), ""] # initializie
|
||||||
notfound = 0
|
notfound = 0
|
||||||
|
@ -413,12 +411,6 @@ if inputHash and useLink:
|
||||||
utorrentClass.stop(inputHash)
|
utorrentClass.stop(inputHash)
|
||||||
time.sleep(5) # Give uTorrent some time to catch up with the change
|
time.sleep(5) # Give uTorrent some time to catch up with the change
|
||||||
|
|
||||||
# Log this output
|
|
||||||
old_stdout = sys.stdout # Still crude, but we wat to capture this for now
|
|
||||||
logFile = os.path.join(os.path.dirname(sys.argv[0]), "postprocess.log")
|
|
||||||
log_file = open(logFile, "a+")
|
|
||||||
sys.stdout = log_file
|
|
||||||
|
|
||||||
# Now we pass off to CouchPotato or Sick-Beard
|
# Now we pass off to CouchPotato or Sick-Beard
|
||||||
if inputCategory == movieCategory:
|
if inputCategory == movieCategory:
|
||||||
Logger.info("MAIN: Calling postprocessing script for CouchPotatoServer") # can we use logger while logfile open?
|
Logger.info("MAIN: Calling postprocessing script for CouchPotatoServer") # can we use logger while logfile open?
|
||||||
|
@ -427,9 +419,6 @@ elif inputCategory == tvCategory:
|
||||||
Logger.info("MAIN: Calling postprocessing script for Sick-Beard") # can we use logger while logfile open?
|
Logger.info("MAIN: Calling postprocessing script for Sick-Beard") # can we use logger while logfile open?
|
||||||
autoProcessTV.processEpisode(outputDestination, inputName, status)
|
autoProcessTV.processEpisode(outputDestination, inputName, status)
|
||||||
|
|
||||||
sys.stdout = old_stdout
|
|
||||||
log_file.close()
|
|
||||||
|
|
||||||
now = datetime.datetime.now() # set time for timeout
|
now = datetime.datetime.now() # set time for timeout
|
||||||
while os.path.exists(videofile): # while this file is still here, CPS hasn't finished renaming
|
while os.path.exists(videofile): # while this file is still here, CPS hasn't finished renaming
|
||||||
if (datetime.datetime.now() - now) > datetime.timedelta(minutes=3): # note; minimum 1 minute delay in autoProcessMovie
|
if (datetime.datetime.now() - now) > datetime.timedelta(minutes=3): # note; minimum 1 minute delay in autoProcessMovie
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue