Proposal for TurboGears2 port

Thomas De Schampheleire patrickdepinguin at gmail.com
Mon Feb 15 19:02:16 UTC 2016


Hi Alessandro,

On Wed, Feb 10, 2016 at 2:52 PM, Alessandro Molina
<alessandro.molina at gmail.com> wrote:
>
>
> On Tue, Feb 9, 2016 at 1:28 PM, Alessandro Molina
> <alessandro.molina at gmail.com> wrote:
>>
>>
>> I'll try to manage a proper routing solution instead of trying to fake
>> standard TG routing like I'm currently doing.
>
>
> I wrote a much more robust dispatch solution that should now properly handle
> all URLs, now also the changelog works properly.
> It's already committed on my kallithea-tg repository.
>
> Only issue it relies on some features that are only available in upcoming
> TurboGears version (2.3.8) so you will have to install TurboGears and crank
> from https://github.com/TurboGears/tg2/tree/development and
> https://github.com/TurboGears/crank
>

I've been reading the Turbogears documentation over the past days, and
will now dive in more into the code you made.

I updated to the latest kallithea-tg commit (34d3039), installed the
development version of crank (448550f) and tg2 (25f5017) via 'python
setup.py develop' in my virtualenv, then ran 'python setup.py develop'
in kallithea, and 'paster serve development.ini' as I had been doing
before. However, I get the following error:

$ paster serve development.ini
2016-02-15 19:56:07.964 INFO  [kallithea.model] initializing db for
sqlite:////home/tdescham/repo/contrib/kallithea/kallithea-tg/kallithea.db?timeout=60
Traceback (most recent call last):
  File "/home/tdescham/repo/contrib/kallithea/venv/kallithea-tg/bin/paster",
line 9, in <module>
    load_entry_point('PasteScript==2.0.2', 'console_scripts', 'paster')()
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/.eggs/PasteScript-2.0.2-py2.7.egg/paste/script/command.py",
line 102, in run
    invoke(command, command_name, options, args[1:])
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/.eggs/PasteScript-2.0.2-py2.7.egg/paste/script/command.py",
line 141, in invoke
    exit_code = runner.run(args)
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/.eggs/PasteScript-2.0.2-py2.7.egg/paste/script/command.py",
line 236, in run
    result = self.command()
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/.eggs/PasteScript-2.0.2-py2.7.egg/paste/script/serve.py",
line 284, in command
    relative_to=base, global_conf=vars)
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/.eggs/PasteScript-2.0.2-py2.7.egg/paste/script/serve.py",
line 329, in loadapp
    **kw)
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/.eggs/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/loadwsgi.py",
line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/.eggs/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/loadwsgi.py",
line 272, in loadobj
    return context.create()
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/.eggs/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/loadwsgi.py",
line 710, in create
    return self.object_type.invoke(self)
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/.eggs/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/loadwsgi.py",
line 146, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/.eggs/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/util.py",
line 55, in fix_call
    val = callable(*args, **kw)
  File "/home/tdescham/repo/contrib/kallithea/kallithea-tg/kallithea/config/middleware.py",
line 36, in make_app
    app = make_base_app(global_conf, full_stack=True, **app_conf)
  File "/home/tdescham/repo/contrib/kallithea/tg2/tg/configuration/app_config.py",
line 1279, in make_base_app
    app_config = load_environment(global_conf, app_conf)
  File "/home/tdescham/repo/contrib/kallithea/tg2/tg/configuration/app_config.py",
line 923, in load_environment
    self.setup_persistence(app_config)
  File "/home/tdescham/repo/contrib/kallithea/tg2/tg/configuration/app_config.py",
line 699, in setup_persistence
    self._setup_sqlalchemy(conf)
  File "/home/tdescham/repo/contrib/kallithea/tg2/tg/configuration/app_config.py",
line 834, in _setup_sqlalchemy
    conf['SQLASession'] = model.DBSession
AttributeError: 'module' object has no attribute 'DBSession'


Am I missing something?
If I update to the previous kallithea commit, I don't see this issue.
>From the code change it's not obvious what is wrong to me.

Thanks,
Thomas


More information about the kallithea-general mailing list