# Transfers' status info is output into status_file.
-FILE_NAME = "status_msg.log" #+ strftime("_%d_%b_%Y_%H_%M_%S", localtime()) + ".log"
+FILE_NAME = "status_msg_single_download.log" #+ strftime("_%d_%b_%Y_%H_%M_%S", localtime()) + ".log"
status_file = open(FILE_NAME, 'w');
class SingleDownload:
""" Return the local filename to which to save the file 'name' in the torrent """
if DEBUG:
print >>status_file, strftime("%d-%m-%Y %H:%M:%S", localtime())," ","SingleDownload: save_as(",`name`,length,`saveas`,isdir,")"
- # status_file.close()
+ status_file.close()
try:
if not os.access(saveas,os.F_OK):
os.mkdir(saveas)
def perform_hashcheck(self,complete_callback):
""" Called by any thread """
if DEBUG:
- print >>status_file, strftime("%d-%m-%Y %H:%M:%S", localtime())," ","SingleDownload: perform_hashcheck()" # ,self.videoinfo
- #status_file.close()
+ print >>sys.stderr, strftime("%d-%m-%Y %H:%M:%S", localtime())," ","SingleDownload: perform_hashcheck()" # ,self.videoinfo
try:
""" Schedules actually hashcheck on network thread """
self._getstatsfunc = SPECIAL_VALUE # signal we're hashchecking
Called by network thread
"""
if DEBUG:
- print >>status_file, strftime("%d-%m-%Y %H:%M:%S", localtime())," ","SingleDownload: hashcheck_done()"
+ print >>sys.stderr, strftime("%d-%m-%Y %H:%M:%S", localtime())," ","SingleDownload: hashcheck_done()"
try:
self.dow.startEngine(vodeventfunc = self.lmvodeventcallback)
self._getstatsfunc = self.dow.startStats() # not possible earlier
def shutdown(self):
if DEBUG:
- print >>status_file, strftime("%d-%m-%Y %H:%M:%S", localtime())," ","SingleDownload: shutdown"
- #status_file.close()
+ print >>sys.stderr, strftime("%d-%m-%Y %H:%M:%S", localtime())," ","SingleDownload: shutdown"
resumedata = None
if self.dow is not None:
self.dldoneflag.set()
def finishedfunc(self):
""" Download is complete """
if DEBUG:
- print >>status_file, strftime("%d-%m-%Y %H:%M:%S", localtime())," ","SingleDownload::finishedfunc called: Download is complete *******************************"
- #status_file.close()
+ print >>sys.stderr, strftime("%d-%m-%Y %H:%M:%S", localtime())," ","SingleDownload::finishedfunc called: Download is complete *******************************"
pass
def fatalerrorfunc(self,data):