From: <dg...@us...> - 2009-03-28 10:14:25
|
Revision: 303 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=303&view=rev Author: dgranda Date: 2009-03-28 10:14:14 +0000 (Sat, 28 Mar 2009) Log Message: ----------- Ordered shutdown of logging stuff Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2009-03-26 06:34:14 UTC (rev 302) +++ pytrainer/trunk/pytrainer/main.py 2009-03-28 10:14:14 UTC (rev 303) @@ -121,10 +121,12 @@ logging.debug('<<') def quit(self): - logging.debug('--') + logging.debug('--') + logging.info("Exit!") self.webservice.stop() self.windowmain.gtk_main_quit() - sys.exit("Exit!") + logging.shutdown() + sys.exit() # Any nonzero value is considered “abnormal termination” by shells and the like def loadPlugins(self): logging.debug('>>') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vu...@us...> - 2009-03-30 21:40:17
|
Revision: 308 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=308&view=rev Author: vud1 Date: 2009-03-30 21:40:11 +0000 (Mon, 30 Mar 2009) Log Message: ----------- Optimize record view tab system Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2009-03-29 18:56:10 UTC (rev 307) +++ pytrainer/trunk/pytrainer/main.py 2009-03-30 21:40:11 UTC (rev 308) @@ -180,8 +180,6 @@ if view=="record": logging.debug('record view') if self.windowmain.recordview.get_current_page()==0: - self.refreshRecordGraphView("graphs") - self.refreshRecordGraphView("heartrate") self.refreshRecordGraphView("info") elif self.windowmain.recordview.get_current_page()==1: self.refreshRecordGraphView("graphs") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2009-04-18 11:36:03
|
Revision: 322 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=322&view=rev Author: dgranda Date: 2009-04-18 11:36:01 +0000 (Sat, 18 Apr 2009) Log Message: ----------- Rotating log file support added Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2009-04-16 20:38:15 UTC (rev 321) +++ pytrainer/trunk/pytrainer/main.py 2009-04-18 11:36:01 UTC (rev 322) @@ -26,8 +26,11 @@ import gtk import gtk.glade import logging +import logging.handlers import traceback +from os import path + from record import Record from waypoint import Waypoint from extension import Extension @@ -54,25 +57,30 @@ from lib.system import checkConf from lib.heartrate import * -# 21.03.2008 - dgranda -# setting up logging +# 21.03.2008 - dgranda (updated 17.04.2008) # Only one parameter from command line is accepted # ERROR is the default log level -debug_level = logging.ERROR -if len(sys.argv) >1: +log_level = logging.ERROR +PATH = os.environ['HOME']+"/.pytrainer" +if not os.path.exists(PATH): + os.mkdir(PATH) +LOG_FILENAME = PATH + "/log.out" +if len(sys.argv) > 1: if sys.argv[1]=='-d': - debug_level = logging.DEBUG + log_level = logging.DEBUG elif sys.argv[1]=='-i': - debug_level = logging.INFO + log_level = logging.INFO elif sys.argv[1]=='-w': - debug_level = logging.WARNING + log_level = logging.WARNING else: print "CLI - Unknown parameter "+sys.argv[1] -print "*** Log level set to "+ logging.getLevelName(debug_level) +" ***" -logging.basicConfig(level=debug_level, - format='%(asctime)s|%(levelname)s|%(module)s|%(funcName)s|%(message)s', - filemode='w') +# Adding rotating support to default logger with customized format +rotHandler = logging.handlers.RotatingFileHandler(LOG_FILENAME, maxBytes=100000, backupCount=5) +formatter = logging.Formatter('%(asctime)s|%(levelname)s|%(module)s|%(funcName)s|%(message)s') +rotHandler.setFormatter(formatter) +logging.getLogger('').addHandler(rotHandler) +logging.getLogger('').setLevel(log_level) class pyTrainer: def __init__(self,filename = None, data_path = None): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-11-23 10:55:20
|
Revision: 399 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=399&view=rev Author: jblance Date: 2009-11-23 10:54:53 +0000 (Mon, 23 Nov 2009) Log Message: ----------- Small fix to debug info Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2009-11-23 10:42:47 UTC (rev 398) +++ pytrainer/trunk/pytrainer/main.py 2009-11-23 10:54:53 UTC (rev 399) @@ -208,7 +208,7 @@ logging.debug('>>') if self.windowmain is None: logging.debug("First call to refreshGraphView") - logging.debug('>>') + logging.debug('<<') return date_selected = self.date.getDate() if view=="record": This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2009-11-23 21:49:30
|
Revision: 401 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=401&view=rev Author: dgranda Date: 2009-11-23 21:49:22 +0000 (Mon, 23 Nov 2009) Log Message: ----------- Added command line flag --check to trigger database and config file sanity checks Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2009-11-23 21:27:06 UTC (rev 400) +++ pytrainer/trunk/pytrainer/main.py 2009-11-23 21:49:22 UTC (rev 401) @@ -59,8 +59,6 @@ from lib.system import checkConf from lib.heartrate import * -# 21.03.2008 - dgranda (updated 17.04.2008) -# Only one parameter from command line is accepted # ERROR is the default log level PATH = os.environ['HOME']+"/.pytrainer" if not os.path.exists(PATH): @@ -78,9 +76,11 @@ parser.add_option("-i", "--info", action="store_const", const=logging.INFO, dest="log_level", help="enable logging at info level") parser.add_option("-w", "--warn", action="store_const", const=logging.WARNING, dest="log_level", help="enable logging at warning level") parser.add_option("--valid", action="store_true", dest="validate", help="enable validation of files imported by plugins (details at info or debug logging level) - note plugin must support validation") +parser.add_option("--check", action="store_true", dest="check", help="triggers database (only sqlite based) and configuration file sanity checks, adding fields if necessary. Backup of database is done before any change. Details at info or debug logging level") (options, args) = parser.parse_args() log_level = options.log_level validate = options.validate +check = options.check # Adding rotating support to default logger with customized format rotHandler = logging.handlers.RotatingFileHandler(LOG_FILENAME, maxBytes=100000, backupCount=5) @@ -93,7 +93,7 @@ def __init__(self,filename = None, data_path = None): logging.debug('>>') self.data_path = data_path - self.version ="1.6.0.9 svn 397" + self.version ="1.6.0.9_svn#401" self.date = Date() main_dir = os.path.realpath(os.path.dirname(__file__)) #why? sys.path.insert(0, main_dir) #why? @@ -103,6 +103,7 @@ self.profile.isProfileConfigured() self.log_level = log_level self.validate = validate + self.check = check self.windowmain = None logging.debug('checking configuration...') @@ -118,7 +119,11 @@ self.ddbb.connect() self.record = Record(data_path,self) - self.migrationCheck() + if self.check: + #self.migrationCheck() + self.sanityCheck() # Deprecates migrationCheck. Review first installation and version control + else: + logging.info('No sanity check requested') #preparamos la ventana principal self.windowmain = Main(data_path,self,self.version) @@ -455,11 +460,23 @@ if version_tmp < "1.6.0.3": logging.info('Checking pace and max pace stored in DB') self.checkPacesDB() - logging.info('Checking configuration file integrity') - self.profile.checkProfile() + logging.info('Checking configuration file integrity') + self.profile.checkProfile() if version_tmp < self.version: self.configuration.setVersion(self.version) logging.debug('<<') + + def sanityCheck(self): + """23.11.2009 - dgranda + Checks database and configuration file if flag "--check" is enabled at start + args: none + returns: none""" + logging.debug('>>') + logging.info('Checking database integrity') + self.ddbb.checkDBIntegrity() + logging.info('Checking configuration file integrity') + self.profile.checkProfile() + logging.debug('<<') def addDateTimeUTC(self): """12.07.2008 - dgranda This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2009-12-05 13:21:04
|
Revision: 425 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=425&view=rev Author: dgranda Date: 2009-12-05 13:20:57 +0000 (Sat, 05 Dec 2009) Log Message: ----------- Added refresh for daily view when importing (Bug id #2089342). Updated version Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2009-12-05 13:16:37 UTC (rev 424) +++ pytrainer/trunk/pytrainer/main.py 2009-12-05 13:20:57 UTC (rev 425) @@ -97,7 +97,7 @@ def __init__(self,filename = None, data_path = None): logging.debug('>>') self.data_path = data_path - self.version ="1.6.0.9_svn#417" + self.version ="1.7.0pre" self.date = Date() main_dir = os.path.realpath(os.path.dirname(__file__)) #why? sys.path.insert(0, main_dir) #why? @@ -201,6 +201,7 @@ else: logging.debug("No files returned from Plugin") self.refreshListRecords() + self.refreshGraphView("day") logging.debug('<<') def runExtension(self,extension,id): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-12-25 23:40:51
|
Revision: 437 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=437&view=rev Author: jblance Date: 2009-12-25 23:40:43 +0000 (Fri, 25 Dec 2009) Log Message: ----------- Added support to force DB check by presence of FORCE_DB_CHECK file Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2009-12-25 23:11:26 UTC (rev 436) +++ pytrainer/trunk/pytrainer/main.py 2009-12-25 23:40:43 UTC (rev 437) @@ -97,7 +97,7 @@ def __init__(self,filename = None, data_path = None): logging.debug('>>') self.data_path = data_path - self.version ="1.7.0_svn#436" + self.version ="1.7.0_svn#437" self.date = Date() main_dir = os.path.realpath(os.path.dirname(__file__)) #why? sys.path.insert(0, main_dir) #why? @@ -127,6 +127,11 @@ self.ddbb.connect() self.record = Record(data_path,self) + #Look for force check file + check_file = self.data_path+"/FORCE_DB_CHECK" + if os.path.isfile(check_file): + self.check = True + os.remove(check_file) if self.check: #self.migrationCheck() self.sanityCheck() # Deprecates migrationCheck. Review first installation and version control This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-12-28 05:46:45
|
Revision: 449 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=449&view=rev Author: jblance Date: 2009-12-28 05:46:33 +0000 (Mon, 28 Dec 2009) Log Message: ----------- Re-introduce module path statement to allow subdir modules to be found Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2009-12-27 22:12:14 UTC (rev 448) +++ pytrainer/trunk/pytrainer/main.py 2009-12-28 05:46:33 UTC (rev 449) @@ -97,7 +97,7 @@ def __init__(self,filename = None, data_path = None): logging.debug('>>') self.data_path = data_path - self.version ="1.7.0_svn#448" + self.version ="1.7.0_svn#449" self.date = Date() # Checking profile self.profile = Profile(self.data_path,self) @@ -107,6 +107,8 @@ self.check = check self.gm3 = gm3 self.windowmain = None + main_dir = os.path.realpath(os.path.dirname(__file__)) #Add pytrainer directory to module search path + sys.path.insert(0, main_dir) # so modules in subdirs are found e.g. lib.xmlutil logging.debug('checking configuration...') self.conf = checkConf() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2010-01-16 16:26:54
|
Revision: 475 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=475&view=rev Author: dgranda Date: 2010-01-16 16:26:48 +0000 (Sat, 16 Jan 2010) Log Message: ----------- Triggering DB and config file check by new version or runtime argument Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-01-14 21:41:25 UTC (rev 474) +++ pytrainer/trunk/pytrainer/main.py 2010-01-16 16:26:48 UTC (rev 475) @@ -101,7 +101,7 @@ def __init__(self,filename = None, data_path = None): logging.debug('>>') self.data_path = data_path - self.version ="1.7.0_svn#471" + self.version ="1.7.0_svn#475" self.date = Date() # Checking profile self.profile = Profile(self.data_path,self) @@ -130,13 +130,8 @@ logging.debug('connecting to DDBB') self.ddbb.connect() - #Look for force check file - check_file = self.data_path+"/FORCE_DB_CHECK" - if os.path.isfile(check_file): - self.check = True - os.remove(check_file) - if self.check: - #self.migrationCheck() + # DB check can be triggered either via new version (mandatory) or as runtime parameter (--check) + if self.isNewVersion() or self.check: self.sanityCheck() # Deprecates migrationCheck. Review first installation and version control else: logging.info('No sanity check requested') @@ -491,6 +486,21 @@ self.configuration.setVersion(self.version) logging.debug('<<') + def isNewVersion(self): + """16.01.2010 - dgranda + Checks if executed version is new + args: none + returns: boolean. True if version is newer, False otherwise""" + logging.debug('>>') + version_tmp = self.configuration.getValue("pytraining","version") + logging.info('Old version: '+version_tmp+' | New version: '+self.version) + isNew = False + if version_tmp < self.version: + isNew = True + self.configuration.setVersion(self.version) + logging.debug('<<') + return isNew + def sanityCheck(self): """23.11.2009 - dgranda Checks database and configuration file if flag "--check" is enabled at start This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2010-01-17 00:50:21
|
Revision: 480 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=480&view=rev Author: dgranda Date: 2010-01-17 00:19:42 +0000 (Sun, 17 Jan 2010) Log Message: ----------- DB check relies in own DB version. Removed deprecated stuff Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-01-17 00:16:08 UTC (rev 479) +++ pytrainer/trunk/pytrainer/main.py 2010-01-17 00:19:42 UTC (rev 480) @@ -101,7 +101,8 @@ def __init__(self,filename = None, data_path = None): logging.debug('>>') self.data_path = data_path - self.version ="1.7.0_svn#476" + self.version ="1.7.0_svn#480" + self.DB_version = 1 self.date = Date() # Checking profile self.profile = Profile(self.data_path,self) @@ -131,10 +132,16 @@ self.ddbb.connect() # DB check can be triggered either via new version (mandatory) or as runtime parameter (--check) - if self.isNewVersion() or self.check: + currentDB_version = self.configuration.getValue("pytraining","DB_version") + logging.debug("Current DB version: "+str(currentDB_version)) + + if currentDB_version is None or self.check: self.sanityCheck() # Deprecates migrationCheck. Review first installation and version control else: - logging.info('No sanity check requested') + if self.DB_version > int(currentDB_version): + self.sanityCheck() # Deprecates migrationCheck. Review first installation and version control + else: + logging.info('No sanity check requested') self.record = Record(data_path,self) @@ -442,65 +449,7 @@ logging.debug('>>') self.profile.editProfile() logging.debug('<<') - - def migrationCheck(self): - """22.06.2008 - dgranda (reviewed 31.07.2008) - Checks if it is necessary to run migration scripts for new features - args: none - returns: none""" - logging.debug('>>') - self.filename = self.conf.getValue("conffile") - logging.debug('Retrieving data from '+ self.filename) - version_tmp = self.configuration.getOption("version") - logging.info('Old version: '+version_tmp+' | New version: '+self.version) - if version_tmp == "0.0": - logging.info('Nothing to do, first installation') - else: - if version_tmp=="1.0": - logging.debug('updating month data') - self.ddbb.updatemonth() - if version_tmp<="0.9.8": - logging.debug('updating date format') - self.ddbb.updateDateFormat() - if version_tmp<="0.9.8.2": - logging.debug('updating DB title') - self.ddbb.addTitle2ddbb() - if version_tmp<="1.3.1": - self.ddbb.addUnevenness2ddbb() - if version_tmp<="1.4.2": - self.ddbb.addWaypoints2ddbb() - if version_tmp<="1.5.0.1": - self.ddbb.addweightandmet2ddbb() - if version_tmp<="1.5.0.2": - logging.info('Adding maxspeed, maxpace, pace and maxbeats columns') - self.ddbb.addpaceandmax2ddbb() - if version_tmp < "1.6.0.1": - logging.info('Adding date_time_utc column and retrieving data from local GPX files') - self.addDateTimeUTC() - if version_tmp < "1.6.0.3": - logging.info('Checking pace and max pace stored in DB') - self.checkPacesDB() - logging.info('Checking configuration file integrity') - self.profile.checkProfile() - if version_tmp < self.version: - self.configuration.setVersion(self.version) - logging.debug('<<') - def isNewVersion(self): - """16.01.2010 - dgranda - Checks if executed version is new - args: none - returns: boolean. True if version is newer, False otherwise""" - logging.debug('>>') - version_tmp = self.configuration.getValue("pytraining","version") - logging.info('Old version: '+version_tmp+' | New version: '+self.version) - isNew = False - if version_tmp < self.version: - isNew = True - self.configuration.setVersion(self.version) - logging.debug('<<') - return isNew - def sanityCheck(self): """23.11.2009 - dgranda Checks database and configuration file if flag "--check" is enabled at start This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-11 08:24:54
|
Revision: 531 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=531&view=rev Author: jblance Date: 2010-03-11 08:24:47 +0000 (Thu, 11 Mar 2010) Log Message: ----------- Remove webservice stop on exit Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-11 07:51:27 UTC (rev 530) +++ pytrainer/trunk/pytrainer/main.py 2010-03-11 08:24:47 UTC (rev 531) @@ -166,7 +166,7 @@ def quit(self): logging.debug('--') logging.info("Exit!") - self.webservice.stop() + #self.webservice.stop() self.windowmain.gtk_main_quit() logging.shutdown() sys.exit() # Any nonzero value is considered “abnormal termination” by shells and the like This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2010-04-08 16:49:33
|
Revision: 554 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=554&view=rev Author: dgranda Date: 2010-04-08 16:49:27 +0000 (Thu, 08 Apr 2010) Log Message: ----------- Removed logging to stdout and updated interim version Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-08 16:46:55 UTC (rev 553) +++ pytrainer/trunk/pytrainer/main.py 2010-04-08 16:49:27 UTC (rev 554) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#551" + self.version ="1.7.1_svn#554" self.DB_version = 3 #Setup usage and permitted options @@ -208,7 +208,6 @@ if os.path.isfile(pluginFile): logging.info('File exists. Size: %d. Sport: %s' % (os.path.getsize(pluginFile), sport)) if self.record.importFromGPX(pluginFile, sport) is None: - print "Error importing file "+pluginFile logging.error("Error importing file "+pluginFile) else: logging.error('File '+pluginFile+' not valid') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-11-22 22:13:49
|
Revision: 726 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=726&view=rev Author: jblance Date: 2010-11-22 22:13:43 +0000 (Mon, 22 Nov 2010) Log Message: ----------- Make new graphing approach the default Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-11-22 22:05:41 UTC (rev 725) +++ pytrainer/trunk/pytrainer/main.py 2010-11-22 22:13:43 UTC (rev 726) @@ -53,7 +53,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#725" + self.version ="1.7.2_svn#726" self.DB_version = 6 #Process command line options self.startup_options = self.get_options() @@ -121,13 +121,14 @@ For more help on valid options try: %prog -h ''' parser = OptionParser(usage=usage) - parser.set_defaults(log_level=logging.ERROR, validate=False, equip=False, newgraph=False, conf_dir=None) + parser.set_defaults(log_level=logging.ERROR, validate=False, equip=False, newgraph=True, conf_dir=None) parser.add_option("-d", "--debug", action="store_const", const=logging.DEBUG, dest="log_level", help="enable logging at debug level") parser.add_option("-i", "--info", action="store_const", const=logging.INFO, dest="log_level", help="enable logging at info level") parser.add_option("-w", "--warn", action="store_const", const=logging.WARNING, dest="log_level", help="enable logging at warning level") parser.add_option("--valid", action="store_true", dest="validate", help="enable validation of files imported by plugins (details at info or debug logging level) - note plugin must support validation") parser.add_option("--check", action="store_true", dest="check", help="triggers database (only sqlite based) and configuration file sanity checks, adding fields if necessary. Backup of database is done before any change. Details at info or debug logging level") - parser.add_option("--newgraph", action="store_true", dest="newgraph", help="EXPERIMENTAL: new graphing approach") + parser.add_option("--oldgraph", action="store_false", dest="newgraph", help="Turn off new graphing approach") + parser.add_option("--newgraph", action="store_true", dest="newgraph", help="Deprecated Option: Turn on new graphing approach") parser.add_option("--confdir", dest="conf_dir", help="Specify the directory where application configuration will be stored.") (options, args) = parser.parse_args() return options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nc...@us...> - 2010-12-04 08:03:11
|
Revision: 754 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=754&view=rev Author: ncjones Date: 2010-12-04 08:03:05 +0000 (Sat, 04 Dec 2010) Log Message: ----------- Remove non iso-8859-1 characters. Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-12-01 00:48:36 UTC (rev 753) +++ pytrainer/trunk/pytrainer/main.py 2010-12-04 08:03:05 UTC (rev 754) @@ -152,7 +152,7 @@ #self.webservice.stop() self.windowmain.gtk_main_quit() logging.shutdown() - sys.exit() # Any nonzero value is considered “abnormal termination” by shells and the like + sys.exit() # Any nonzero value is considered "abnormal termination" by shells and the like def loadPlugins(self): logging.debug('>>') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nc...@us...> - 2010-12-09 10:22:22
|
Revision: 755 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=755&view=rev Author: ncjones Date: 2010-12-09 10:22:16 +0000 (Thu, 09 Dec 2010) Log Message: ----------- Add startup option for choosing console or file logging. When "console" is chosen all loging messsages are sent to stdout instead of a log file. Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-12-04 08:03:05 UTC (rev 754) +++ pytrainer/trunk/pytrainer/main.py 2010-12-09 10:22:16 UTC (rev 755) @@ -60,7 +60,7 @@ self.environment = Environment(platform.get_platform(), self.startup_options.conf_dir) self.environment.create_directories() #Setup logging - self.set_logging(self.startup_options.log_level) + self.set_logging(self.startup_options.log_level, self.startup_options.log_type) logging.debug('>>') logging.debug("PyTrainer version %s, DB version %s" % (self.version, self.DB_version)) self.data_path = data_path @@ -121,7 +121,7 @@ For more help on valid options try: %prog -h ''' parser = OptionParser(usage=usage) - parser.set_defaults(log_level=logging.ERROR, validate=False, equip=False, newgraph=True, conf_dir=None) + parser.set_defaults(log_level=logging.ERROR, validate=False, equip=False, newgraph=True, conf_dir=None, log_type="file") parser.add_option("-d", "--debug", action="store_const", const=logging.DEBUG, dest="log_level", help="enable logging at debug level") parser.add_option("-i", "--info", action="store_const", const=logging.INFO, dest="log_level", help="enable logging at info level") parser.add_option("-w", "--warn", action="store_const", const=logging.WARNING, dest="log_level", help="enable logging at warning level") @@ -130,15 +130,19 @@ parser.add_option("--oldgraph", action="store_false", dest="newgraph", help="Turn off new graphing approach") parser.add_option("--newgraph", action="store_true", dest="newgraph", help="Deprecated Option: Turn on new graphing approach") parser.add_option("--confdir", dest="conf_dir", help="Specify the directory where application configuration will be stored.") + parser.add_option("--logtype", dest="log_type", metavar="TYPE", type="choice" , choices=["file", "console"], help="Specify where logging should be output to. TYPE is one of 'file' (default), or 'console'.") (options, args) = parser.parse_args() return options - def set_logging(self,level): + def set_logging(self, level, log_type): '''Setup rotating log file with customized format''' - rotHandler = logging.handlers.RotatingFileHandler(self.environment.log_file, maxBytes=100000, backupCount=5) + if("console" == log_type): + handler = logging.StreamHandler(sys.stdout) + else: + handler = logging.handlers.RotatingFileHandler(self.environment.log_file, maxBytes=100000, backupCount=5) formatter = logging.Formatter('%(asctime)s|%(levelname)s|%(module)s|%(funcName)s|%(message)s') - rotHandler.setFormatter(formatter) - logging.getLogger('').addHandler(rotHandler) + handler.setFormatter(formatter) + logger = logging.getLogger('').addHandler(handler) self.set_logging_level(self.startup_options.log_level) def set_logging_level(self, level): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nc...@us...> - 2010-12-09 19:15:54
|
Revision: 756 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=756&view=rev Author: ncjones Date: 2010-12-09 19:15:48 +0000 (Thu, 09 Dec 2010) Log Message: ----------- Remove unnecessary assignment. Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-12-09 10:22:16 UTC (rev 755) +++ pytrainer/trunk/pytrainer/main.py 2010-12-09 19:15:48 UTC (rev 756) @@ -142,7 +142,7 @@ handler = logging.handlers.RotatingFileHandler(self.environment.log_file, maxBytes=100000, backupCount=5) formatter = logging.Formatter('%(asctime)s|%(levelname)s|%(module)s|%(funcName)s|%(message)s') handler.setFormatter(formatter) - logger = logging.getLogger('').addHandler(handler) + logging.getLogger('').addHandler(handler) self.set_logging_level(self.startup_options.log_level) def set_logging_level(self, level): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2011-08-09 22:46:52
|
Revision: 839 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=839&view=rev Author: dgranda Date: 2011-08-09 22:46:46 +0000 (Tue, 09 Aug 2011) Log Message: ----------- Loading environment preferences -basically log_file- before start logging. It prevented application to start Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2011-08-09 11:25:02 UTC (rev 838) +++ pytrainer/trunk/pytrainer/main.py 2011-08-09 22:46:46 UTC (rev 839) @@ -59,9 +59,9 @@ #Process command line options self.startup_options = self.get_options() #Setup logging - self.set_logging(self.startup_options.log_level, self.startup_options.log_type) self.environment = Environment(platform.get_platform(), self.startup_options.conf_dir) self.environment.create_directories() + self.set_logging(self.startup_options.log_level, self.startup_options.log_type) logging.debug('>>') logging.debug("PyTrainer version %s" % (self.version)) self.data_path = data_path This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nc...@us...> - 2011-11-14 08:41:18
|
Revision: 933 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=933&view=rev Author: ncjones Date: 2011-11-14 08:41:11 +0000 (Mon, 14 Nov 2011) Log Message: ----------- Bumping version number following release. Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2011-11-13 09:00:35 UTC (rev 932) +++ pytrainer/trunk/pytrainer/main.py 2011-11-14 08:41:11 UTC (rev 933) @@ -55,7 +55,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.9.0" + self.version ="1.9.1" #Process command line options self.startup_options = self.get_options() #Setup logging This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nc...@us...> - 2011-11-14 08:42:37
|
Revision: 934 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=934&view=rev Author: ncjones Date: 2011-11-14 08:42:31 +0000 (Mon, 14 Nov 2011) Log Message: ----------- Bumping version number following release. Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2011-11-14 08:41:11 UTC (rev 933) +++ pytrainer/trunk/pytrainer/main.py 2011-11-14 08:42:31 UTC (rev 934) @@ -55,7 +55,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.9.1" + self.version ="1.9.1-dev" #Process command line options self.startup_options = self.get_options() #Setup logging This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |