Hi nanotube!
There are 2 issues when compiling with python 2.4, because this version didnt accept an except-block together with a finally-block in one try-block and one with the defining of a class:
Last first:
1)
File; Line:
controlpanel.py; 214
<<<<<<<before:>>>>>></before:>
class ConfigPanel():
<<<<<<<after:>>>>>>></after:>
class ConfigPanel:
2)
File; Line:
timerthreads.py; 126
<<<<<<<before:>>>>>></before:>
try:
self.logger.debug("Handler %r: rolling over" % handler)
handler.doRollover()
except AttributeError:
self.logger.debug("Handler %r is not capable of rollover." % \
handler)
finally:
self.dir_lock.release()
<<<<<<<after:>>>>>>></after:>
try:
try:
self.logger.debug("Handler %r: rolling over" % handler)
handler.doRollover()
except AttributeError:
self.logger.debug("Handler %r is not capable of rollover." % \
handler)
finally:
self.dir_lock.release()
3)
File; Line:
timerthreads.py; 458
<<<<<<<before:>>>>>></before:>
try:
zipfile_list = os.listdir(self.log_full_dir)
# removing elements from a list while iterating over it produces
# undesirable results so we make a copy
zipfile_list_copy = copy.deepcopy(zipfile_list)
self.logger.debug(str(zipfile_list))
if len(zipfile_list) > 0:
for filename in zipfile_list_copy:
if not self.needs_ftping(filename):
zipfile_list.remove(filename)
self.logger.debug("removing %s from "
"zipfilelist." % filename)
self.logger.debug(str(zipfile_list))
## now actually connect and upload
ftp = ftplib.FTP()
if self.cmdoptions.debug:
ftp.set_debuglevel(2)
ftp.connect(host=self.subsettings['FTP']['FTP Server'],
port=self.subsettings['FTP']['FTP Port'])
ftp.login(user = self.subsettings['FTP']['FTP Username'],
passwd = myutils.password_recover(\
self.subsettings['FTP']['FTP Password']))
ftp.set_pasv(self.subsettings['FTP']['FTP Passive Mode'])
## todo: make sure to create directory first??
ftp.cwd(self.subsettings['FTP']['FTP Upload Directory'])
for filename in zipfile_list:
ftp.storbinary('STOR ' + filename,
open(os.path.join(self.log_full_dir, filename), 'rb'))
ftp.quit()
except:
self.logger.debug('Error in ftp upload.', exc_info=True)
finally:
self.dir_lock.release()
<<<<<<<after:>>>>>>></after:>
try:
try:
zipfile_list = os.listdir(self.log_full_dir)
# removing elements from a list while iterating over it produces
# undesirable results so we make a copy
zipfile_list_copy = copy.deepcopy(zipfile_list)
self.logger.debug(str(zipfile_list))
if len(zipfile_list) > 0:
for filename in zipfile_list_copy:
if not self.needs_ftping(filename):
zipfile_list.remove(filename)
self.logger.debug("removing %s from "
"zipfilelist." % filename)
self.logger.debug(str(zipfile_list))
## now actually connect and upload
ftp = ftplib.FTP()
if self.cmdoptions.debug:
ftp.set_debuglevel(2)
ftp.connect(host=self.subsettings['FTP']['FTP Server'],
port=self.subsettings['FTP']['FTP Port'])
ftp.login(user = self.subsettings['FTP']['FTP Username'],
passwd = myutils.password_recover(\
self.subsettings['FTP']['FTP Password']))
ftp.set_pasv(self.subsettings['FTP']['FTP Passive Mode'])
## todo: make sure to create directory first??
ftp.cwd(self.subsettings['FTP']['FTP Upload Directory'])
for filename in zipfile_list:
ftp.storbinary('STOR ' + filename,
open(os.path.join(self.log_full_dir, filename), 'rb'))
ftp.quit()
except:
self.logger.debug('Error in ftp upload.', exc_info=True)
finally:
self.dir_lock.release()
I didnt find any GitHub-repo to do pull requests which would be much easier to merge ;)