From: <nc...@us...> - 2011-10-23 11:10:18
|
Revision: 903 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=903&view=rev Author: ncjones Date: 2011-10-23 11:10:12 +0000 (Sun, 23 Oct 2011) Log Message: ----------- Remove unnecessary "check DB integrity" function. ticket:132 Modified Paths: -------------- pytrainer/trunk/glade/profile.glade pytrainer/trunk/pytrainer/gui/windowprofile.py pytrainer/trunk/pytrainer/lib/ddbb.py pytrainer/trunk/pytrainer/lib/mysqlUtils.py pytrainer/trunk/pytrainer/lib/sqliteUtils.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/upgrade/data.py Modified: pytrainer/trunk/glade/profile.glade =================================================================== --- pytrainer/trunk/glade/profile.glade 2011-10-23 11:09:38 UTC (rev 902) +++ pytrainer/trunk/glade/profile.glade 2011-10-23 11:10:12 UTC (rev 903) @@ -1837,51 +1837,6 @@ </packing> </child> <child> - <widget class="GtkLabel" id="labelCheck"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="label" translatable="yes">Check</property> - </widget> - <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="checkbuttonCheck"> - <property name="label">--check</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_checkbuttonCheck_toggled"/> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_padding">10</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="labelCheckDescription"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="xpad">5</property> - <property name="label" translatable="yes"><small>Was a configuration and database check requested?</small></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - </packing> - </child> - <child> <widget class="GtkLabel" id="labelNewGraph"> <property name="visible">True</property> <property name="xalign">0</property> Modified: pytrainer/trunk/pytrainer/gui/windowprofile.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowprofile.py 2011-10-23 11:09:38 UTC (rev 902) +++ pytrainer/trunk/pytrainer/gui/windowprofile.py 2011-10-23 11:10:12 UTC (rev 903) @@ -200,12 +200,6 @@ else: self.checkbuttonValidate.set_active(False) - #Show if database and config check requested - if self.pytrainer_main.startup_options.check: - self.checkbuttonCheck.set_active(True) - else: - self.checkbuttonCheck.set_active(False) - #Show if new graph activated if self.pytrainer_main.startup_options.newgraph: self.checkbuttonNewGraph.set_active(True) @@ -236,18 +230,6 @@ logging.debug("Validate deactivated") self.pytrainer_main.startup_options.validate = False - def on_checkbuttonCheck_toggled(self, widget): - if self.checkbuttonCheck.get_active(): - logging.debug( "Check activated") - if self.pytrainer_main.startup_options.check is not True: - #Need to do sanitycheck - logging.debug("Need to do sanitycheck") - self.pytrainer_main.sanityCheck() - self.pytrainer_main.startup_options.check = True - else: - logging.debug("Check deactivated") - self.pytrainer_main.startup_options.check = False - def on_checkbuttonNewGraph_toggled(self, widget): if self.checkbuttonNewGraph.get_active(): logging.debug("NewGraph activated") Modified: pytrainer/trunk/pytrainer/lib/ddbb.py =================================================================== --- pytrainer/trunk/pytrainer/lib/ddbb.py 2011-10-23 11:09:38 UTC (rev 902) +++ pytrainer/trunk/pytrainer/lib/ddbb.py 2011-10-23 11:10:12 UTC (rev 903) @@ -20,10 +20,7 @@ #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import logging -import traceback -import commands, os import dateutil -from pytrainer.lib.date import Date #Define the tables and their columns that should be in the database #Obviously, this is not a list but a dict -> TODO: ammend name to avoid confusion!!! @@ -135,9 +132,9 @@ def connect(self): connection_ok, connection_msg = self.ddbbObject.connect() if not connection_ok: - print "ERROR: Unable to connect to database" - print connection_msg - sys.exit(connection_ok) + print "ERROR: Unable to connect to database" + print connection_msg + sys.exit(connection_ok) def disconnect(self): self.ddbbObject.disconnect() @@ -296,95 +293,15 @@ return ret_val[0][0] def create_tables(self): - global tablesList - global tablesDefaultData - logging.debug('>>') - logging.info('Checking PyTrainer database') - #if self.ddbb_type != "sqlite": - # logging.error('Support for MySQL database is decommissioned, please migrate to SQLite. Exiting check') - # exit(-2) - try: - tablesDB = self.ddbbObject.getTableList() - except: - logging.error('Not able to retrieve which tables are in DB. Printing traceback') - traceback.print_exc() - exit(-1) - - logging.debug('Found '+ str(len(tablesDB))+' tables in DB: '+ str(tablesDB)) - - # Create a compressed copy of current DB - try: - self.ddbbObject.createDatabaseBackup() - except: - logging.error('Not able to make a copy of current DB. Printing traceback and exiting') - traceback.print_exc() - exit(-1) - - #Check Tables + """Initialise the database schema from an empty database.""" + logging.info("Creating database tables") for entry in tablesList: - if entry not in tablesDB: - logging.warn('Table '+str(entry)+' does not exist in DB') - self.ddbbObject.createTableDefault(entry,tablesList[entry]) - #Check if this table has default data to add.. - if entry in tablesDefaultData: - logging.debug("Adding default data to %s" % entry) - for data_dict in tablesDefaultData[entry]: - self.insert_dict(entry, data_dict) - else: - self.ddbbObject.checkTable(entry,tablesList[entry]) - - def checkDBIntegrity(self): - '''17.11.2009 - dgranda - Retrieves tables and columns from database, checks current ones and adds something if missed. New in version 1.7.0 - args: none - returns: none''' - self.create_tables() - - #Run any functions to update or correct data - #These functions _must_ be safe to run at any time (i.e. not be version specfic or only safe to run once) - self.populate_date_time_local() - logging.debug('<<') - - def checkDBDataValues(self): - ''' Check all data in DB and report values that do not match the type ''' - global tablesList - - for table in tablesList.keys(): - pass - - def populate_date_time_local(self): - ''' Populate date_time_local and date from date_time_utc - only access records that date_time_local is NULL - using OS timezone to create local_time - - also updates date if date != local_time - - TODO - leaves date_time_local blank for records that have been manually created (as date_time_utc will actually be local time) - ''' - logging.debug('--') - listOfRecords = self.ddbbObject.select("records","id_record,date,date_time_utc,date_time_local", "date_time_local is NULL") - logging.debug("Found %d records in DB without date_time_local field populated" % (len(listOfRecords) ) ) - for record in listOfRecords: - try: - gpxfile = self.configuration.gpxdir+"/%s.gpx"%(record[0]) - dateFromUTC = Date().getDateTime(record[2]) - if os.path.isfile(gpxfile) : #GPX file exists for this record - probably not a manual record - date_time_local = str(dateFromUTC[1]) - dateFromLocal = dateFromUTC[1].strftime("%Y-%m-%d") - if record[1] != dateFromLocal: - #date field incorrect - update it - logging.debug("Updating record id: %s with date: %s and date_time_local: %s" % (record[0], dateFromLocal, date_time_local) ) - self.ddbbObject.update("records","date, date_time_local",[dateFromLocal, date_time_local], "id_record = %d" %record[0]) - else: - #date field OK, just update date_time_local - logging.debug("Updating record id: %s with date_time_local: %s" % (record[0], date_time_local) ) - self.ddbbObject.update("records","date_time_local",[date_time_local], "id_record = %d" %record[0]) - else: #Manual entry? - #For manual entries, the UTC time is the local time - #TODO figure out a way to correct this... - pass - except Exception as e: - print "Error updating record: " + str(record) - print e - logging.debug("Error updating record: " + str(record)) - logging.debug(str(e)) + self.ddbbObject.createTableDefault(entry, tablesList[entry]) + if entry in tablesDefaultData: + logging.debug("Adding default data to %s" % entry) + for data_dict in tablesDefaultData[entry]: + self.insert_dict(entry, data_dict) + + def create_backup(self): + """Create a backup of the current database.""" + self.ddbbObject.createDatabaseBackup() Modified: pytrainer/trunk/pytrainer/lib/mysqlUtils.py =================================================================== --- pytrainer/trunk/pytrainer/lib/mysqlUtils.py 2011-10-23 11:09:38 UTC (rev 902) +++ pytrainer/trunk/pytrainer/lib/mysqlUtils.py 2011-10-23 11:10:12 UTC (rev 903) @@ -168,61 +168,6 @@ sql = "update %s set %s" %(table,string) self.db.query(sql) - def checkTable(self,tableName,columns): - ''' - Checks column names and values from table and adds something if missed. New in version 1.7.0 - args: - tableName - string with name of the table - columns - dictionary containing column names and data types coming from definition - returns: none''' - logging.debug('>>') - logging.info('Inspecting '+str(tableName)+' table') - logging.debug('Columns definition: '+str(columns)) - - # Retrieving data from DB - tableInfo = self.retrieveTableInfo(tableName) - logging.debug('Raw data retrieved from DB '+str(tableName)+': '+str(tableInfo)) - #print('Raw data retrieved from DB '+str(tableName)+': '+str(tableInfo)) - #Raw data retrieved from DB sports: [('met', 'float', 'YES', '', None, ''), ('id_sports', 'int(11)', 'NO', 'PRI', None, 'auto_increment'), ('max_pace', 'int(11)', 'YES', '', None, ''), ('name', 'varchar(100)', 'YES', '', None, ''), ('weight', 'float', 'YES', '', None, '')] - - # Comparing data retrieved from DB with what comes from definition - columnsDB = {} - for field in tableInfo: - newField = {field[0]:field[1]} - columnsDB.update(newField) - logging.debug('Useful data retrieved from '+str(tableName)+' in DB: '+str(columnsDB)) - #print('Useful data retrieved from '+str(tableName)+' in DB: '+str(columnsDB)) - - # http://mail.python.org/pipermail/python-list/2002-May/141458.html - #tempDict = dict(zip(columns,columns)) - tempDict = dict(columns) - #Test for columns that are in DB that shouldn't be - result = [x for x in columnsDB if x not in tempDict] - #Test for columns that are not in the DB that should be - result2 = [x for x in tempDict if x not in columnsDB] - - logging.debug("Columns in DB that shouldnt be: "+str(result)) - logging.debug("Columns missing from DB: "+str(result2)) - - table_ok = True - if len(result) > 0: - logging.debug('Found columns in DB that should not be: '+ str(result)) - table_ok = False - for entry in result: - logging.debug('Column '+ str(entry) +' in DB but not in definition') - print "Column %s in DB but not in definition - please fix manually" % (str(entry)) - print "#TODO need to add auto fix code" - sys.exit(1) - if len(result2) > 0: # may have also different data type - logging.debug('Found columns missed in DB: '+ str(result2)) - table_ok = False - for entry in result2: - logging.debug('Column '+ str(entry) +' not found in DB') - self.addColumn(tableName,str(entry),columns[entry]) - if table_ok: - logging.info('Table '+ str(tableName) +' is OK') - logging.debug('<<') - def retrieveTableInfo(self,tableName): cur = self.db.cursor() sql = "desc %s;" %tableName @@ -245,6 +190,4 @@ traceback.print_exc() def createDatabaseBackup(self): - logging.debug('>>') logging.info("Unable to create backup for MySQL DB") - logging.debug('<<') Modified: pytrainer/trunk/pytrainer/lib/sqliteUtils.py =================================================================== --- pytrainer/trunk/pytrainer/lib/sqliteUtils.py 2011-10-23 11:09:38 UTC (rev 902) +++ pytrainer/trunk/pytrainer/lib/sqliteUtils.py 2011-10-23 11:10:12 UTC (rev 903) @@ -163,60 +163,6 @@ retorno.append(row) return retorno - def checkTable(self,tableName,columns): - '''19.11.2009 - dgranda - Checks column names and values from table and adds something if missed. New in version 1.7.0 - args: - tableName - string with name of the table - columns - dictionary containing column names and data types coming from definition - returns: none''' - logging.debug('>>') - logging.info('Inspecting '+str(tableName)+' table') - logging.debug('Columns definition: '+str(columns)) - - # Retrieving data from DB - tableInfo = self.retrieveTableInfo(tableName) - logging.debug('Raw data retrieved from DB '+str(tableName)+': '+str(tableInfo)) - #Raw data retrieved from DB laps: [(0, u'elapsed_time', u'varchar(20)', 0, None, 0), (1, u'record', u'integer', 0, None, 0), (2, u'end_lon', u'float', 0, None, 0), (3, u'lap_number', u'integer', 0, None, 0), (4, u'end_lat', u'float', 0, None, 0), (5, u'distance', u'float', 0, None, 0), (6, u'start_lon', u'float', 0, None, 0), (7, u'id_lap', u'integer', 0, None, 1), (8, u'calories', u'int', 0, None, 0), (9, u'start_lat', u'float', 0, None, 0)] - - # Comparing data retrieved from DB with what comes from definition - columnsDB = {} - for field in tableInfo: - newField = {field[1]:field[2]} - columnsDB.update(newField) - logging.debug('Useful data retrieved from '+str(tableName)+' in DB: '+str(columnsDB)) - #Useful data retrieved from laps in DB: {u'elapsed_time': u'varchar(20)', u'record': u'integer', u'end_lon': u'float', u'start_lon': u'float', u'end_lat': u'float', u'distance': u'float', u'id_lap': u'integer', u'lap_number': u'integer', u'calories': u'int', u'start_lat': u'float'} - - # http://mail.python.org/pipermail/python-list/2002-May/141458.html - #tempDict = dict(zip(columns,columns)) - tempDict = dict(columns) - #Test for columns that are in DB that shouldn't be - result = [x for x in columnsDB if x not in tempDict] - #Test for columns that are not in the DB that should be - result2 = [x for x in tempDict if x not in columnsDB] - - logging.debug("Columns in DB that shouldnt be: "+str(result)) - logging.debug("Columns missing from DB: "+str(result2)) - - table_ok = True - if len(result) > 0: - logging.debug('Found columns in DB that should not be: '+ str(result)) - table_ok = False - for entry in result: - logging.debug('Column '+ str(entry) +' in DB but not in definition') - print "Column %s in DB but not in definition - please fix manually" % (str(entry)) - print "#TODO need to add auto fix code" - sys.exit(1) - if len(result2) > 0: # may have also different data type - logging.debug('Found columns missed in DB: '+ str(result2)) - table_ok = False - for entry in result2: - logging.debug('Column '+ str(entry) +' not found in DB') - self.addColumn(tableName,str(entry),columns[entry]) - if table_ok: - logging.info('Table '+ str(tableName) +' is OK') - logging.debug('<<') - def retrieveTableInfo(self,tableName): cur = self.db.cursor() sql = "PRAGMA table_info(%s);" %tableName @@ -237,11 +183,9 @@ def createDatabaseBackup(self): - logging.debug('>>') + logging.info("Creating compressed copy of current DB") logging.debug('Database path: '+str(self.ddbb)) result = commands.getstatusoutput('gzip -c '+self.ddbb+' > '+self.ddbb+'_`date +%Y%m%d_%H%M`.gz') if result[0] != 0: raise Exception, "Copying current database does not work, error #"+str(result[0]) - else: - logging.info('Database backup successfully created') - logging.debug('<<') + logging.info('Database backup successfully created') Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2011-10-23 11:09:38 UTC (rev 902) +++ pytrainer/trunk/pytrainer/main.py 2011-10-23 11:10:12 UTC (rev 903) @@ -77,9 +77,6 @@ self.ddbb.connect() initialize_data(self.ddbb, self.environment.conf_dir) - if self.startup_options.check: - logging.debug("Checking DB as per user's request") - self.sanityCheck() self._sport_service = SportService(self.ddbb) self.record = Record(self._sport_service, data_path, self) @@ -119,7 +116,6 @@ 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("--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.") @@ -490,13 +486,3 @@ self.activitypool.clear_pool() self.windowmain.setup() logging.debug('<<') - - def sanityCheck(self): - """23.11.2009 - dgranda - Checks database and configuration file - args: none - returns: none""" - logging.debug('>>') - logging.info('Checking database integrity') - self.ddbb.checkDBIntegrity() - logging.debug('<<') Modified: pytrainer/trunk/pytrainer/upgrade/data.py =================================================================== --- pytrainer/trunk/pytrainer/upgrade/data.py 2011-10-23 11:09:38 UTC (rev 902) +++ pytrainer/trunk/pytrainer/upgrade/data.py 2011-10-23 11:10:12 UTC (rev 903) @@ -130,6 +130,7 @@ def upgrade(self): logging.info("Upgrading data from version '%s' to version '%s'.", self.get_version(), self.get_available_version()) + self._ddbb.create_backup() pytrainer.upgrade.context.UPGRADE_CONTEXT = self._upgrade_context self._migratable_db.upgrade() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2011-10-24 22:11:44
|
Revision: 910 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=910&view=rev Author: dgranda Date: 2011-10-24 22:11:37 +0000 (Mon, 24 Oct 2011) Log Message: ----------- Updating changelog. Minor changes in INSTALL file Modified Paths: -------------- pytrainer/trunk/CHANGES pytrainer/trunk/INSTALL Modified: pytrainer/trunk/CHANGES =================================================================== --- pytrainer/trunk/CHANGES 2011-10-24 21:30:25 UTC (rev 909) +++ pytrainer/trunk/CHANGES 2011-10-24 22:11:37 UTC (rev 910) @@ -1,15 +1,16 @@ See the pytrainer roadmap for more information http://sourceforge.net/apps/trac/pytrainer/roadmap -- PyTrainer changes for 1.9.0: +- pytrainer changes for 1.9.0: * New functionality + - Added portuguese localization (thanks to Pedro Ribeiro) - [896] - Option added in localization script (utils/translator.sh) to generate only .pot file - [888 - 892] - Galician localization (thanks to Kaptan) - [885 - 887] [893] - Manpage for pytrainer - #125 [872] [874] - Create sport service - #138 [838] [840 - 845] [850] [850 - 856] [875] [880] - Provide means to run all unit tests - #139 [837] - - Discrete version migration - #132 [815 - 836] [839] [864] [865] + - Discrete version migration - #132 [815 - 836] [839] [864] [865] [899 - 906] - Totals tab - #60 [766] [800] [801] [802] [803] - Display projected times in record view, including ranking - #116 [782] [785] [811] - Ascent and descent figures shown in all views. Added time spent moving and paused in record view (thanks to Friso) - #114 [781] @@ -17,14 +18,17 @@ - Display laps information on record summary page - #109 #122 [768 - 772] [775] [777] [778] [788] [812] [813] - Coloring Google Maps path by speed/pace - thanks to Jonathan - #107 [765] - Added swedish localization (thanks to Per) - #98 [756 - 760] - - Add startup option for choosing console or file logging. When "console" is chosen all logging messsages are sent to stdout instead of a log file. [755] + - Added startup option for choosing console or file logging. When "console" is chosen all logging messsages are sent to stdout instead of a log file. [755] * Fixes - - Cannot edit record created from GPX import with null sport reference #147 [881] + - Fixed support to import TCXv2 files - [907 - 909] + - Date value was not saved in "Athlete" tab - #149 [898] + - Fixed encoding issue that prevented some days of the week and associated information to be shown in stacked bars graph under week tab [897] + - Cannot edit record created from GPX import with null sport reference - #147 [881] - Pytrainer crashes when closing edit record dialog - #146 [879] - Added zero padding to overcome lap order issue - #145 [878] - - Updated french localization - thanks to Vincent [876] + - Updated french localization - thanks to Vincent, Pierr [876] [895] - Heartrate figures from profile are retrieved independently so only those which fail are set to default value [873] - Active/Rest times are not calculated for activities with only one lap - [811] - Activity's data (equipment and title) missing when importing activity from file - #105 #137 [866 - 868] @@ -52,7 +56,7 @@ - Fix so only once instance of preferences dialog can be open at a time - #74 [753] -- PyTrainer changes for 1.8.0: +- pytrainer changes for 1.8.0: * New functionality - Equipment management (thx to Nathan) [571] [572] [573] [598] [678] [679] [680] [685] [698] [699] [707] [708] [711] [717] [718] #12 @@ -117,7 +121,7 @@ - Update DB check to ensure time == duration [736] - Updating credits [740] [743] -- PyTrainer changes for 1.7.2: +- pytrainer changes for 1.7.2: * Lap DB table created and code changed to populate and use the table [507] [508] [509] * Moved some global variables to class variables in main.py [513] @@ -150,7 +154,7 @@ - plugins tab added - provides alternative way of viewing and running import plugins [512] - device import NOT functional -- PyTrainer changes for 1.7.1: +- pytrainer changes for 1.7.1: * New import plugin - Garmintools - svn [430], [431], [436], [452], [453], [459], [460], [461], [463], [464], [486], [487], [488] - both file (dump file) and device import implemented @@ -183,7 +187,7 @@ - file import functional - device import NOT functional -- PyTrainer changes for 1.7.0: +- pytrainer changes for 1.7.0: Updated Spanish translation (svn rev 420,423,424) Updated French translation (svn rev 421) @@ -203,7 +207,7 @@ Several improvements in plugins handling (svn rev 350,353,360,378,422) Import GPX files (svn rev 349) -- PyTrainer tasks for 1.6.0.9: +- pytrainer tasks for 1.6.0.9: Added dynamic loading and unloading of plugin menu items (svn rev 344) Removal of decommissioned plugin (garmin301) and addition of new ones (garmingpx). Update of project data (version and url) (svn rev 343) @@ -214,7 +218,7 @@ Updated german translation - bug ID: 2811507 (thanks to Noèl) (svn revs 338, 333) Minor project and license information updated (svn revs 337, 335, 334, 329) -- PyTrainer tasks for 1.6.0.8: +- pytrainer tasks for 1.6.0.8: Rotating log file support added (rev 322, http://sourceforge.net/tracker/?func=detail&aid=2717142&group_id=213157&atid=1024595) Translations reviewed and added script to facilitate them (rev 319-321,323) @@ -223,7 +227,7 @@ Removing redundant calls improving graphical performance (rev 310, linked to http://sourceforge.net/tracker/?func=detail&aid=2717135&group_id=213157&atid=1024592, not yet fully fixed) Optimizing xml files parsing when retrieving data from them (rev 309) -- PyTrainer tasks for 1.6.0.7: +- pytrainer tasks for 1.6.0.7: Removing pytrainer gui minimal window size (svn rev 304) Ordered shutdown of logging stuff (svn rev 303) @@ -237,7 +241,7 @@ Bug #2100647 - Quick entry doesn't work if no gpx file - Fixed (svn rev. 287) FR #2126411 - Package python-sqlite2 not needed anymore: http://www.python.org/doc/2.5.2/lib/module-sqlite3.html (svn rev. 286) -- PyTrainer tasks for 1.6.0.6: +- pytrainer tasks for 1.6.0.6: Close button in "About" dialog now works. Migrating from Glade to GTKBuilder Fixed some properties in pytrainer.desktop (ID#2126616) @@ -245,30 +249,30 @@ Removal of garmin301 plugin Fixed some issues with MySql tables creation (email from Jonas Liljenfeldt) -- PyTrainer tasks for 1.6.0.5: +- pytrainer tasks for 1.6.0.5: mozpytrainer launch script with log level support -> DONE (24.08.2008) MET and extra weight values swapped when adding a new sport -> DONE (22.08.2008) -PyTrainer crashes when adding an activity which sport is not yet in DB -> DONE (31.08.2008) +pytrainer crashes when adding an activity which sport is not yet in DB -> DONE (31.08.2008) Should be enough to check timestamps when adding new activities -> DONE (31.08.2008) Correct initialization of pace and maxpace values -> DONE (31.08.2008) -- PyTrainer tasks for 1.6.0.4: +- pytrainer tasks for 1.6.0.4: Added support for date_time_utc field when importing new tracks via file upload pytrainer/profile.py: fixed logging issue when removing sport from database -- PyTrainer tasks for 1.6.0.3: +- pytrainer tasks for 1.6.0.3: Complete review of migration scripts. Special attention to ~/.pytrainer/conf.xml file -> DONE (31.07.2008) Number output always with two figures to avoid confusion -> DONE (02.08.2008) -- PyTrainer tasks for 1.6.0.2: +- pytrainer tasks for 1.6.0.2: Check paces in DB (maxspeed<->maxpace | average<->pace) -> DONE (19.07.2008) Error when updating records because of new date_time_utc field in DB -> FIXED (20.07.2008) -- PyTrainer tasks for 1.6.0.1: +- pytrainer tasks for 1.6.0.1: Adjust migration scripts Sports saved in ddbb (new column in table sports) -> id_sports in table sports (nothing to do) Modified: pytrainer/trunk/INSTALL =================================================================== --- pytrainer/trunk/INSTALL 2011-10-24 21:30:25 UTC (rev 909) +++ pytrainer/trunk/INSTALL 2011-10-24 22:11:37 UTC (rev 910) @@ -1,13 +1,13 @@ -PyTrainer basic installation +pytrainer basic installation =========================== These are generic installation instructions to use with *.tar.gz files 1.- Dependency Overview -Here you are dependencies for PyTrainer. Of course you must have a working environment with proper shell configuration and typical GNU tools to uncompress (gunzip) and untar (tar) files. +Here you are dependencies for pytrainer. Of course you must have a working environment with proper shell configuration and typical GNU tools to uncompress (gunzip) and untar (tar) files. -1.1.- Packages (Fedora 15 working versions as of 2011.08.28 for 1.9.0) +1.1.- Packages (Fedora 15 working versions as of 2011.08.28 for 1.9.0, package names might change in other distributions) python-2.7.1 python-devel-2.7.1 (to run installation from tarball) @@ -22,13 +22,13 @@ libxml2-2.7.8 libxslt-python-1.1.26 libxslt-1.1.26 -sqlite-3.7.5 (sqlite is preferred as db than mysql, MySQL-python has been reported to be installed if so) +sqlite-3.7.5 (sqlite is preferred to mysql as databas as database, MySQL-python has been reported to be installed if so) python-sqlalchemy-0.6.8 (sqlalchemy >= 0.6.4) python-migrate-0.6 (sqlalchemy-migrate >=0.6.0) - Only needed if correspondent plugin is enabled: gpsbabel-1.3.5 ("Garmin via GPSBabel 1.3.5" aka garmin_hr) - No longer available in official F15 repositories -garmintools-0.10 ("Garmin via garmintools" aka garmintools_full) - No longer available in officia F15 repositories +garmintools-0.10 ("Garmin via garmintools" aka garmintools_full) - No longer available in official F15 repositories 2.- Installation process @@ -43,4 +43,4 @@ 3.- USB access -Currently PyTrainer is using gpsbabel (http://www.gpsbabel.org) to retrieve information from the Garmin device. There are some problems regarding driver to access usb ports, please take a look at http://www.gpsbabel.org/os/Linux_Hotplug.html +pytrainer can use gpsbabel (http://www.gpsbabel.org) to retrieve information from Garmin devices. There are some problems regarding driver to access usb ports, please take a look at http://www.gpsbabel.org/os/Linux_Hotplug.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2011-11-04 11:20:45
|
Revision: 916 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=916&view=rev Author: dgranda Date: 2011-11-04 11:20:39 +0000 (Fri, 04 Nov 2011) Log Message: ----------- Pace and speed calculated in same method - ticket #152 Modified Paths: -------------- pytrainer/trunk/glade/newrecord.glade pytrainer/trunk/pytrainer/gui/windowrecord.py pytrainer/trunk/pytrainer/record.py pytrainer/trunk/pytrainer/waypoint.py Modified: pytrainer/trunk/glade/newrecord.glade =================================================================== --- pytrainer/trunk/glade/newrecord.glade 2011-11-01 09:26:11 UTC (rev 915) +++ pytrainer/trunk/glade/newrecord.glade 2011-11-04 11:20:39 UTC (rev 916) @@ -560,7 +560,7 @@ <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> - <signal name="clicked" handler="on_calcaverage_clicked"/> + <signal name="clicked" handler="on_calcavs_clicked"/> </widget> <packing> <property name="left_attach">4</property> @@ -699,7 +699,7 @@ <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> - <signal name="clicked" handler="on_calcpace_clicked"/> + <signal name="clicked" handler="on_calcavs_clicked"/> </widget> <packing> <property name="left_attach">4</property> Modified: pytrainer/trunk/pytrainer/gui/windowrecord.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowrecord.py 2011-11-01 09:26:11 UTC (rev 915) +++ pytrainer/trunk/pytrainer/gui/windowrecord.py 2011-11-04 11:20:39 UTC (rev 916) @@ -86,7 +86,7 @@ if time != None: self.setTime(time) if distance!=None and time!=None: - self.on_calcaverage_clicked(None) + self.on_calcavs_clicked(None) if upositive != None: self.rcd_upositive.set_text(self.uc.height(upositive)) if unegative != None: @@ -608,41 +608,32 @@ while gtk.events_pending(): # This allows the GUI to update gtk.main_iteration() # before completion of this entire action self.show_treeviewEntries_row(path[0]) - - def on_calcaverage_clicked(self,widget): - try: - hour = self.rcd_hour.get_value_as_int() - min = self.rcd_min.get_value_as_int() - sec = self.rcd_second.get_value_as_int() - time = sec + (min*60) + (hour*3600) - time_in_hour = time/3600.0 - distance = float(self.rcd_distance.get_text()) - average = distance/time_in_hour - self.rcd_average.set_text("%0.2f" %average) - except: - pass - - def on_calcpace_clicked(self,widget): + + def on_calcavs_clicked(self,widget): + logging.debug(">>") hour = self.rcd_hour.get_value_as_int() min = self.rcd_min.get_value_as_int() sec = self.rcd_second.get_value_as_int() time = sec + (min*60) + (hour*3600) if time<1: + logging.debug("Seems no time value (%s) has been entered, nothing to calculate." %time) return False - time_in_min = time/60.0 distance = float(self.rcd_distance.get_text()) if distance<1: + logging.debug("Seems no distance value (%s) has been entered, nothing to calculate." %distance) return False - #Calc Pace - average = time_in_min/distance - #Tranform pace to mm.ss - min = int(average) - per_min = average - min - sec = float(per_min) * 60 / 100 - dec_pace = min + sec + logging.debug("Time: %d seconds | Distance: %0.2f km (mi)" %(time,distance)) + # Average speed + average_speed = distance*3600.0/time + logging.debug("Average speed: %0.2f" %average_speed) + self.rcd_average.set_text("%0.2f" %average_speed) + # Average pace + dec_pace = 60/average_speed #Transform pace to mm:ss pace = self.parent.pace_from_float(dec_pace) + logging.debug("Average pace: %s" %pace) self.rcd_pace.set_text(pace) + logging.debug("<<") def on_calccalories_clicked(self,widget): sport = self.rcd_sport.get_active_text() Modified: pytrainer/trunk/pytrainer/record.py =================================================================== --- pytrainer/trunk/pytrainer/record.py 2011-11-01 09:26:11 UTC (rev 915) +++ pytrainer/trunk/pytrainer/record.py 2011-11-04 11:20:39 UTC (rev 916) @@ -489,8 +489,7 @@ self.recordwindow.set_maxspeed(maxspeed) self.recordwindow.set_maxhr(maxheartrate) self.recordwindow.set_recordtime(time/60.0/60.0) - self.recordwindow.on_calcaverage_clicked(None) - self.recordwindow.on_calcpace_clicked(None) + self.recordwindow.on_calcavs_clicked(None) self.recordwindow.on_calccalories_clicked(None) self.recordwindow.rcd_maxpace.set_text("%d.%02d" %((3600/maxspeed)/60,(3600/maxspeed)%60)) logging.debug('<<') Modified: pytrainer/trunk/pytrainer/waypoint.py =================================================================== --- pytrainer/trunk/pytrainer/waypoint.py 2011-11-01 09:26:11 UTC (rev 915) +++ pytrainer/trunk/pytrainer/waypoint.py 2011-11-04 11:20:39 UTC (rev 916) @@ -100,5 +100,5 @@ self.recordwindow.rcd_unegative.set_text(str(unegative)) self.recordwindow.set_distance(distance) self.recordwindow.set_recordtime(time/60.0/60.0) - self.recordwindow.on_calcaverage_clicked(None) + self.recordwindow.on_calcavs_clicked(None) logging.debug("<<") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2011-11-04 18:50:52
|
Revision: 919 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=919&view=rev Author: dgranda Date: 2011-11-04 18:50:42 +0000 (Fri, 04 Nov 2011) Log Message: ----------- Graying out pace, elevation and heartbeat data frames when editing an activity with GPX file associated Modified Paths: -------------- pytrainer/trunk/glade/newrecord.glade pytrainer/trunk/pytrainer/gui/windowrecord.py Modified: pytrainer/trunk/glade/newrecord.glade =================================================================== --- pytrainer/trunk/glade/newrecord.glade 2011-11-04 18:47:39 UTC (rev 918) +++ pytrainer/trunk/glade/newrecord.glade 2011-11-04 18:50:42 UTC (rev 919) @@ -620,7 +620,7 @@ <widget class="GtkVBox" id="vbox26"> <property name="visible">True</property> <child> - <widget class="GtkFrame" id="frame20"> + <widget class="GtkFrame" id="framePace"> <property name="visible">True</property> <property name="border_width">5</property> <property name="label_xalign">0</property> @@ -651,7 +651,6 @@ <child> <widget class="GtkEntry" id="rcd_maxpace"> <property name="visible">True</property> - <property name="sensitive">False</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> <property name="width_chars">7</property> @@ -680,7 +679,6 @@ <child> <widget class="GtkEntry" id="rcd_pace"> <property name="visible">True</property> - <property name="sensitive">False</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> <property name="width_chars">7</property> @@ -730,7 +728,7 @@ </packing> </child> <child> - <widget class="GtkFrame" id="frame21"> + <widget class="GtkFrame" id="frameElevation"> <property name="visible">True</property> <property name="border_width">5</property> <property name="label_xalign">0</property> @@ -825,7 +823,7 @@ </packing> </child> <child> - <widget class="GtkFrame" id="frame22"> + <widget class="GtkFrame" id="frameBeats"> <property name="visible">True</property> <property name="border_width">5</property> <property name="label_xalign">0</property> Modified: pytrainer/trunk/pytrainer/gui/windowrecord.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowrecord.py 2011-11-04 18:47:39 UTC (rev 918) +++ pytrainer/trunk/pytrainer/gui/windowrecord.py 2011-11-04 18:50:42 UTC (rev 919) @@ -384,6 +384,9 @@ self.rcd_gpxfile.set_text(activity.gpx_file) self.frameGeneral.set_sensitive(0) #Currently record values not changed if a GPX file is present self.frameVelocity.set_sensitive(0) #Greying out options to indicate this to user + self.framePace.set_sensitive(0) + self.frameElevation.set_sensitive(0) + self.frameBeats.set_sensitive(0) logging.debug("<<") def setValues(self,values): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2011-11-13 08:53:09
|
Revision: 930 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=930&view=rev Author: dgranda Date: 2011-11-13 08:53:03 +0000 (Sun, 13 Nov 2011) Log Message: ----------- Getting rid of capital letters in application name Modified Paths: -------------- pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/record.py pytrainer/trunk/pytrainer.desktop Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2011-11-13 08:50:30 UTC (rev 929) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2011-11-13 08:53:03 UTC (rev 930) @@ -95,7 +95,7 @@ def new(self): self.menublocking = 0 self.selected_view="day" - self.window1.set_title ("pyTrainer %s" % self.version) + self.window1.set_title ("pytrainer %s" % self.version) try: width, height = self.pytrainer_main.profile.getValue("pytraining","window_size").split(',') self.window1.resize(int(width), int(height)) Modified: pytrainer/trunk/pytrainer/record.py =================================================================== --- pytrainer/trunk/pytrainer/record.py 2011-11-13 08:50:30 UTC (rev 929) +++ pytrainer/trunk/pytrainer/record.py 2011-11-13 08:53:03 UTC (rev 930) @@ -474,7 +474,7 @@ logging.debug('Found '+str(len(tracks))+' tracks') self._select_trkfromgpx(gpxfile,tracks) else: - msg = _("pyTrainer can't import data from your gpx file") + msg = _("pytrainer can't import data from your gpx file") from gui.warning import Warning warning = Warning(self.data_path) warning.set_text(msg) Modified: pytrainer/trunk/pytrainer.desktop =================================================================== --- pytrainer/trunk/pytrainer.desktop 2011-11-13 08:50:30 UTC (rev 929) +++ pytrainer/trunk/pytrainer.desktop 2011-11-13 08:53:03 UTC (rev 930) @@ -1,7 +1,7 @@ [Desktop Entry] -Version=1.0 +Version=1.9.0 Type=Application -Name=pyTrainer +Name=pytrainer Comment=The Free Sport Training Center Exec=pytrainer Icon=pytrainer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2011-11-13 08:54:56
|
Revision: 931 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=931&view=rev Author: dgranda Date: 2011-11-13 08:54:50 +0000 (Sun, 13 Nov 2011) Log Message: ----------- Updating changelog and version number before tagging and releasing 1.9.0 Modified Paths: -------------- pytrainer/trunk/CHANGES pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/CHANGES =================================================================== --- pytrainer/trunk/CHANGES 2011-11-13 08:53:03 UTC (rev 930) +++ pytrainer/trunk/CHANGES 2011-11-13 08:54:50 UTC (rev 931) @@ -8,7 +8,7 @@ * New functionality or improvement - - Updated DE localization. Thanks to Erik Pfannenstein from Debian DE group - [923] + - Updated DE localization. Thanks to Erik Pfannenstein from Debian DE group and Andreas Mair - [923] [927] - Added portuguese localization (thanks to Pedro Ribeiro) - [896] - Option added in localization script (utils/translator.sh) to generate only .pot file - [888 - 892] - Galician localization (thanks to Kaptan) - [885 - 887] [893] @@ -27,7 +27,7 @@ * Fixes - - Syncing calculations of distance, time, speed and pace. Normalized pace format - #71 #152 [916] [918 - 919] [922] [924] + - Syncing calculations of distance, time, speed and pace. Normalized pace format - #71 #152 [916] [918 - 919] [922] [924] [928] - pytrainer quits when exporting activities in csv format [912] - Importing TCXv2 files failed - [907 - 909] - Date value was not saved in "Athlete" tab - #149 [898] Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2011-11-13 08:53:03 UTC (rev 930) +++ pytrainer/trunk/pytrainer/main.py 2011-11-13 08:54:50 UTC (rev 931) @@ -55,7 +55,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.9.0-dev" + self.version ="1.9.0" #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-15 10:14:14
|
Revision: 935 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=935&view=rev Author: ncjones Date: 2011-11-15 10:14:08 +0000 (Tue, 15 Nov 2011) Log Message: ----------- Add support for sqlalchemy-migrate 0.5.4 ticket:153 Modified Paths: -------------- pytrainer/trunk/INSTALL pytrainer/trunk/pytrainer/upgrade/context.py pytrainer/trunk/pytrainer/upgrade/data.py pytrainer/trunk/pytrainer/upgrade/migratedb.py pytrainer/trunk/pytrainer/upgrade/versions/007_populate_record_duration.py pytrainer/trunk/pytrainer/upgrade/versions/011_populate_lap_details.py pytrainer/trunk/pytrainer/upgrade/versions/013_remove_db_version.py pytrainer/trunk/pytrainer/upgrade/versions/014_clean_sport_data.py Modified: pytrainer/trunk/INSTALL =================================================================== --- pytrainer/trunk/INSTALL 2011-11-14 08:42:31 UTC (rev 934) +++ pytrainer/trunk/INSTALL 2011-11-15 10:14:08 UTC (rev 935) @@ -24,7 +24,7 @@ libxslt-python >= 1.1.26 sqlite >= 3.2.0 (sqlite is preferred to mysql as database, MySQL-python has been reported to be installed if so) sqlalchemy >= 0.6.4 -sqlalchemy-migrate >= 0.6.0 +sqlalchemy-migrate >= 0.5.4 zenity >= 2.30 - Only needed if correspondent plugin or extension is enabled: Modified: pytrainer/trunk/pytrainer/upgrade/context.py =================================================================== --- pytrainer/trunk/pytrainer/upgrade/context.py 2011-11-14 08:42:31 UTC (rev 934) +++ pytrainer/trunk/pytrainer/upgrade/context.py 2011-11-15 10:14:08 UTC (rev 935) @@ -22,8 +22,9 @@ Provides access to the application base dir.""" - def __init__(self, conf_dir): + def __init__(self, conf_dir, db_url): self.conf_dir = conf_dir + self.db_url = db_url # sqlalchemy-migrate does not provide any means to inject the context object in # to upgrade scripts so instead we provide access via this global which must be Modified: pytrainer/trunk/pytrainer/upgrade/data.py =================================================================== --- pytrainer/trunk/pytrainer/upgrade/data.py 2011-11-14 08:42:31 UTC (rev 934) +++ pytrainer/trunk/pytrainer/upgrade/data.py 2011-11-15 10:14:08 UTC (rev 935) @@ -28,7 +28,7 @@ """Initializes the installation's data.""" db_url = ddbb.get_connection_url() migratable_db = MigratableDb(MIGRATE_REPOSITORY_PATH, db_url) - InstalledData(migratable_db, ddbb, LegacyVersionProvider(conf_dir), UpgradeContext(conf_dir)).update_to_current() + InstalledData(migratable_db, ddbb, LegacyVersionProvider(conf_dir), UpgradeContext(conf_dir, db_url)).update_to_current() class InstalledData(object): Modified: pytrainer/trunk/pytrainer/upgrade/migratedb.py =================================================================== --- pytrainer/trunk/pytrainer/upgrade/migratedb.py 2011-11-14 08:42:31 UTC (rev 934) +++ pytrainer/trunk/pytrainer/upgrade/migratedb.py 2011-11-15 10:14:08 UTC (rev 935) @@ -17,6 +17,7 @@ #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. from migrate.versioning.api import db_version, upgrade, version, version_control +from sqlalchemy.exc import NoSuchTableError # sqlalchemy-migrate 0.6.1 broke backwards compatibility # so we need to try importing exceptions from one of two packages try: @@ -59,6 +60,10 @@ self.get_version() except DatabaseNotControlledError: return False + except NoSuchTableError: + # prior to 0.6.0, sqlalchemy-migrate did not handle querying + # against unversioned databases. + return False return True def get_version(self): Modified: pytrainer/trunk/pytrainer/upgrade/versions/007_populate_record_duration.py =================================================================== --- pytrainer/trunk/pytrainer/upgrade/versions/007_populate_record_duration.py 2011-11-14 08:42:31 UTC (rev 934) +++ pytrainer/trunk/pytrainer/upgrade/versions/007_populate_record_duration.py 2011-11-15 10:14:08 UTC (rev 935) @@ -1,9 +1,14 @@ +from pytrainer.upgrade.context import UPGRADE_CONTEXT from sqlalchemy.sql.expression import text import logging +import sqlalchemy # record duration added in version 1.8.0 -def upgrade(migrate_engine): +def upgrade(migrate_engine=None): + if migrate_engine is None: + # sqlalchemy-migrate 0.5.4 does not provide migrate engine to upgrade scripts + migrate_engine = sqlalchemy.create_engine(UPGRADE_CONTEXT.db_url) logging.info("Populating records.duration column") records = migrate_engine.execute("select id_record, time from records where duration is null") for record in records: @@ -23,5 +28,5 @@ import migrate.versioning.exceptions as ex1 import migrate.changeset.exceptions as ex2 ex1.MigrateDeprecationWarning = ex2.MigrateDeprecationWarning -except ImportError: +except: pass Modified: pytrainer/trunk/pytrainer/upgrade/versions/011_populate_lap_details.py =================================================================== --- pytrainer/trunk/pytrainer/upgrade/versions/011_populate_lap_details.py 2011-11-14 08:42:31 UTC (rev 934) +++ pytrainer/trunk/pytrainer/upgrade/versions/011_populate_lap_details.py 2011-11-15 10:14:08 UTC (rev 935) @@ -1,11 +1,15 @@ +from pytrainer.lib import gpx from pytrainer.upgrade.context import UPGRADE_CONTEXT -from pytrainer.lib import gpx from sqlalchemy.sql.expression import text import logging import os.path +import sqlalchemy # lap info added in version 1.9.0 -def upgrade(migrate_engine): +def upgrade(migrate_engine=None): + if migrate_engine is None: + # sqlalchemy-migrate 0.5.4 does not provide migrate engine to upgrade scripts + migrate_engine = sqlalchemy.create_engine(UPGRADE_CONTEXT.db_url) logging.info("Populating laps details columns") resultset = migrate_engine.execute(text("select distinct record from laps where intensity is null")) record_ids = [] @@ -50,5 +54,5 @@ import migrate.versioning.exceptions as ex1 import migrate.changeset.exceptions as ex2 ex1.MigrateDeprecationWarning = ex2.MigrateDeprecationWarning -except ImportError: +except: pass Modified: pytrainer/trunk/pytrainer/upgrade/versions/013_remove_db_version.py =================================================================== --- pytrainer/trunk/pytrainer/upgrade/versions/013_remove_db_version.py 2011-11-14 08:42:31 UTC (rev 934) +++ pytrainer/trunk/pytrainer/upgrade/versions/013_remove_db_version.py 2011-11-15 10:14:08 UTC (rev 935) @@ -1,7 +1,7 @@ from lxml import etree from pytrainer.upgrade.context import UPGRADE_CONTEXT -def upgrade(migrate_engine): +def upgrade(migrate_engine=None): config_file = UPGRADE_CONTEXT.conf_dir + "/conf.xml" parser = etree.XMLParser(encoding="UTF8", recover=True) xml_tree = etree.parse(config_file, parser=parser) Modified: pytrainer/trunk/pytrainer/upgrade/versions/014_clean_sport_data.py =================================================================== --- pytrainer/trunk/pytrainer/upgrade/versions/014_clean_sport_data.py 2011-11-14 08:42:31 UTC (rev 934) +++ pytrainer/trunk/pytrainer/upgrade/versions/014_clean_sport_data.py 2011-11-15 10:14:08 UTC (rev 935) @@ -1,4 +1,9 @@ +from pytrainer.upgrade.context import UPGRADE_CONTEXT import pytrainer.upgrade.versions.version014 as version14 +import sqlalchemy -def upgrade(migrate_engine): +def upgrade(migrate_engine=None): + if migrate_engine is None: + # sqlalchemy-migrate 0.5.4 does not provide migrate engine to upgrade scripts + migrate_engine = sqlalchemy.create_engine(UPGRADE_CONTEXT.db_url) version14.upgrade(migrate_engine) \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2011-11-25 18:05:35
|
Revision: 939 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=939&view=rev Author: dgranda Date: 2011-11-25 18:05:29 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Updating version and changelog to 1.9.1 Modified Paths: -------------- pytrainer/trunk/CHANGES pytrainer/trunk/plugins/garmintools_full/garmintools_full.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/setup.py Modified: pytrainer/trunk/CHANGES =================================================================== --- pytrainer/trunk/CHANGES 2011-11-25 18:03:12 UTC (rev 938) +++ pytrainer/trunk/CHANGES 2011-11-25 18:05:29 UTC (rev 939) @@ -1,5 +1,19 @@ See the pytrainer roadmap for more information http://sourceforge.net/apps/trac/pytrainer/roadmap +- pytrainer changes for 1.9.1: + +* Known issues + + - Can't maximize main window. Issue related to graph subtab in register tab - tickets #113 #124 + +* Fixes + + - Corrected german localization (thanks to Andreas) - [938] + - Amended typo in translator credits - [937] + - Coloring graph not working when selecting speed as reference - #154 [936] + - Added support for sqlalchemy-migrate 0.5.4 - #153 [935] + + - pytrainer changes for 1.9.0: * Known issues Modified: pytrainer/trunk/plugins/garmintools_full/garmintools_full.py =================================================================== --- pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2011-11-25 18:03:12 UTC (rev 938) +++ pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2011-11-25 18:05:29 UTC (rev 939) @@ -144,6 +144,8 @@ #read file into string with open(filename, 'r') as f: xmlString = f.read() + # Double check encoding from dump files. ASCII? + # http://docs.python.org/library/stringio.html#module-cStringIO fileString = StringIO.StringIO("<root>"+xmlString+"</root>") #parse string as xml try: Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2011-11-25 18:03:12 UTC (rev 938) +++ pytrainer/trunk/pytrainer/main.py 2011-11-25 18:05:29 UTC (rev 939) @@ -55,7 +55,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.9.1-dev" + self.version ="1.9.1" #Process command line options self.startup_options = self.get_options() #Setup logging Modified: pytrainer/trunk/setup.py =================================================================== --- pytrainer/trunk/setup.py 2011-11-25 18:03:12 UTC (rev 938) +++ pytrainer/trunk/setup.py 2011-11-25 18:05:29 UTC (rev 939) @@ -15,7 +15,7 @@ return "share/pytrainer/extensions/%s"%extension_name, glob("extensions/%s/*"%extension_name) setup( name="pytrainer", - version="1.9.0", + version="1.9.1", description="The free sport tracking center", long_description="Pytrainer is a tool to log all your sport excursion coming from GPS devices (with a focus on ForeRunner 205, 305 and 405) or GPX (http://www.topografix.com) files. Pytrainer supports GPS track files and displays it in graphs, maps... ", author="Fiz Vazquez, John Blance, David Garcia Granda, Arnd Zapletal, Nathan Jones", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2011-11-25 18:10:32
|
Revision: 941 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=941&view=rev Author: dgranda Date: 2011-11-25 18:10:26 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Appending development suffix to version number Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py pytrainer/trunk/setup.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2011-11-25 18:06:34 UTC (rev 940) +++ pytrainer/trunk/pytrainer/main.py 2011-11-25 18:10:26 UTC (rev 941) @@ -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.2-dev" #Process command line options self.startup_options = self.get_options() #Setup logging Modified: pytrainer/trunk/setup.py =================================================================== --- pytrainer/trunk/setup.py 2011-11-25 18:06:34 UTC (rev 940) +++ pytrainer/trunk/setup.py 2011-11-25 18:10:26 UTC (rev 941) @@ -15,7 +15,7 @@ return "share/pytrainer/extensions/%s"%extension_name, glob("extensions/%s/*"%extension_name) setup( name="pytrainer", - version="1.9.1", + version="1.9.2-dev", description="The free sport tracking center", long_description="Pytrainer is a tool to log all your sport excursion coming from GPS devices (with a focus on ForeRunner 205, 305 and 405) or GPX (http://www.topografix.com) files. Pytrainer supports GPS track files and displays it in graphs, maps... ", author="Fiz Vazquez, John Blance, David Garcia Granda, Arnd Zapletal, Nathan Jones", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |