Hi Nathan,
2011/8/2 Nathan Jones <nat...@ncjones.com>:
>>> For the second issue, I have added 'pytrainer.upgrade' to the list of
>>> packages in setup.py. I am not sure if this is enough to entirely fix
>>> this problem.
>>
>> It seems enough at least for installing sources and executing pytrainer ;)
>>
>>> Can you explain how you setup Pytrainer as a Python Egg
>>> so I can test this?
>>
>> Basically it should be an standard way to distribute python based
>> software regardless target platforms. The idea behind it is widely
>> explained at http://docs.python.org/library/distutils.html.
>>
>
> I ran "python setup.py install --prefix=~" and then tried launching
> pytrainer from ~/bin. This did not work because the migrate repository
> could not be found. This was due to two problems: the migrate
> repository was missing from setup.py and at runtime it was being
> loaded from the working directory instead of the python path.
>
> I suspect you did not experience this issue because your working
> directory was the pytrainer source when you executed pytrainer built
> from distutils.
Actually I did!. Maybe I mixed up things when executing the first
time, I am really a fan of shell history.
But during the weekend I wasn't able to start pytrainer from egg
installation and yesterday collected some data (see
pytrainer_error.txt attached) for my personal investigation before
asking here. It was still working when executing from sources so I
didn't put much effort in troubleshooting yet 0:)
> In revision 829 I have committed a fix for these two issues so the
> data migration should work for a properly installed pytrainer.
>
> Some thorough testing would be appreciated.
It looks good so far (I double checked installing and executing from
python egg), thanks for the fix.
Cheers,
David
PS: I didn't investigate how it works in deep yet, just see I have no
new database backup under ~/.pytrainer/ (using sqlite)
$ pytrainer -d
running pytrainer from egg installation
data_path: /usr/share/pytrainer/
gettext_path: /usr/share/locale
site_path: /usr/lib/python2.7/site-packages
Traceback (most recent call last):
File "/usr/bin/pytrainer", line 102, in <module>
main()
File "/usr/bin/pytrainer", line 99, in main
pytrainer = pyTrainer(None, data_path)
File "/usr/lib/python2.7/site-packages/pytrainer/main.py", line 79, in
__init__
initialize_data(self.ddbb, self.environment.conf_dir)
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/data.py", line 31,
in initialize_data
InstalledData(migratable_db, ddbb, conf_dir).update_to_current()
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/data.py", line 62,
in update_to_current
data_state = self.get_state()
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/data.py", line 67,
in get_state
if self.is_versioned():
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/data.py", line 115,
in is_versioned
return self._migratable_db.is_versioned()
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/migratedb.py", line
32, in is_versioned
self.get_version()
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/migratedb.py", line
41, in get_version
return db_version(self._db_url, self._repository_path)
File "<string>", line 2, in db_version
File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py",
line 160, in with_engine
return f(*a, **kw)
File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 147,
in db_version
schema = ControlledSchema(engine, repository)
File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line
26, in __init__
repository = Repository(repository)
File "/usr/lib/python2.7/site-packages/migrate/versioning/repository.py",
line 76, in __init__
self.verify(path)
File "/usr/lib/python2.7/site-packages/migrate/versioning/repository.py",
line 97, in verify
raise exceptions.InvalidRepositoryError(path)
migrate.versioning.exceptions.InvalidRepositoryError: pytrainer/upgrade
$
################################
2011-08-01 10:01:10,743|DEBUG|main|__init__|>>
2011-08-01 10:01:10,756|DEBUG|main|__init__|PyTrainer version 1.9.0-dev
2011-08-01 10:01:10,756|DEBUG|main|__init__|Checking configuration and
profile...
2011-08-01 10:01:10,756|DEBUG|profile|__init__|>>
2011-08-01 10:01:10,756|DEBUG|environment|clear_temp_dir|clearing tmp directory
/home/david/.pytrainer/tmp
2011-08-01 10:01:10,777|DEBUG|profile|_parse_config_file|Attempting to parse
content from /home/david/.pytrainer/conf.xml
2011-08-01 10:01:10,788|DEBUG|profile|__init__|Configuration retrieved:
{'prf_maxhr': '192', 'prf_ddbbhost': '', 'prf_name': 'david', 'window_size':
'1014, 722', 'prf_height': '170', 'activitypool_size': '10', 'prf_ddbb':
'sqlite', 'prf_ddbbpass': '', 'import_default_tab': '2', 'prf_us_system':
'False', 'prf_gender': u'Var\xf3n', 'prf_minhr': '48', 'prf_weight': '82',
'prf_age': '1977-06-20', 'version': '0.0', 'prf_ddbbname': '',
'auto_launch_file_selection': 'False', 'default_viewer': '0',
'prf_hrzones_karvonen': 'True', 'prf_ddbbuser': ''}
2011-08-01 10:01:10,788|DEBUG|profile|__init__|<<
2011-08-01 10:01:10,822|DEBUG|main|__init__|connecting to DDBB
2011-08-01 10:01:11,253|DEBUG|__init__|construct_engine|Constructing engine
2011-08-01 10:01:11,258|DEBUG|repository|__init__|Loading repository
pytrainer/upgrade...
2011-08-01 10:01:11,270|DEBUG|__init__|with_engine|Disposing SQLAlchemy engine
Engine(sqlite:////home/david/.pytrainer/pytrainer.ddbb)
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Pytrainer-devel mailing list
Pytrainer-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytrainer-devel