Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1202 (closed enhancement: fixed)

Opened 12 years ago

Last modified 12 years ago

add a PylonsHostFramework

Reported by: gldnspud Owned by: alberto
Priority: normal Milestone:
Component: ToscaWidgets Version: trunk
Severity: normal Keywords:
Cc:

Description

The Pylons example included with Toscawidgets mentions that some boilerplate code in appname/config/middleware.py could probably go into a PylonsHostFramework?.

Attached is a patch that implements this in a straightforward manner.

Attachments

toscawidgets-pylonshf.patch Download (2.4 KB) - added by gldnspud 12 years ago.
patch for adding PylonsHostFramework? to toscawidgets

Change History

Changed 12 years ago by gldnspud

patch for adding PylonsHostFramework? to toscawidgets

comment:1 Changed 12 years ago by alberto

Thanks for the patch :). However, I'm not able to make the sample app work. I get the following traceback:

jal:~/src/ToscaWidgets/examples/PylonsTWSample alberto$ paster serve development.ini 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/Current/bin/paster", line 5, in ?
    pkg_resources.run_script('PasteScript==1.0', 'paster')
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6c3-py2.4.egg/pkg_resources.py", line 407, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6c3-py2.4.egg/pkg_resources.py", line 1084, in run_script
    execfile(script_filename, namespace, namespace)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteScript-1.0-py2.4.egg/EGG-INFO/scripts/paster", line 18, in ?
    command.run()
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteScript-1.0-py2.4.egg/paste/script/command.py", line 76, in run
    invoke(command, command_name, options, args[1:])
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteScript-1.0-py2.4.egg/paste/script/command.py", line 115, in invoke
    exit_code = runner.run(args)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteScript-1.0-py2.4.egg/paste/script/command.py", line 210, in run
    result = self.command()
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteScript-1.0-py2.4.egg/paste/script/serve.py", line 184, in command
    relative_to=base)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteScript-1.0-py2.4.egg/paste/script/serve.py", line 204, in loadapp
    return loadapp(app_spec, name=name, relative_to=relative_to)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 193, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 213, in loadobj
    global_conf=global_conf)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 235, in loadcontext
    global_conf=global_conf)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 263, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 383, in get_context
    section)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 404, in _context_from_use
    context = self.get_context(
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 335, in get_context
    global_conf=global_conf)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 235, in loadcontext
    global_conf=global_conf)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 270, in _loadegg
    return loader.get_context(object_type, name, global_conf)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 531, in get_context
    entry_point, protocol, ep_name = self.find_egg_entry_point(
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/deploy/loadwsgi.py", line 558, in find_egg_entry_point
    possible.append((entry.load(), protocol, entry.name))
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6c3-py2.4.egg/pkg_resources.py", line 1830, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/Users/alberto/src/ToscaWidgets/examples/PylonsTWSample/pylonstwsample/__init__.py", line 8, in ?
    from pylonstwsample.config.middleware import make_app
  File "/Users/alberto/src/ToscaWidgets/examples/PylonsTWSample/pylonstwsample/config/middleware.py", line 12, in ?
    from toscawidgets.mods.pylonshf import PylonsHostFramework
  File "/Users/alberto/src/ToscaWidgets/toscawidgets/mods/pylonshf.py", line 6, in ?
    from pylons.util import AttribSafeContextObj, ContextObj
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Myghty-1.1-py2.4.egg/myghty/importer.py", line 54, in import_module
    return builtin_importer(name, globals, locals, fromlist)
  File "/Users/alberto/src/ToscaWidgets/toscawidgets/mods/pylons.py", line 7, in ?
    from pylons.util import AttribSafeContextObj, ContextObj
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Myghty-1.1-py2.4.egg/myghty/importer.py", line 54, in import_module
    return builtin_importer(name, globals, locals, fromlist)
ImportError: No module named util

strangely enough, python -c "from pylons.util import AttribSafeContextObj, ContextObj seems to work.

Alberto

comment:2 Changed 12 years ago by jorge.vargas

  • Component changed from Widgets to toscaWidgets
  • Summary changed from toscawidgets: add a PylonsHostFramework to add a PylonsHostFramework

I took the liberty of making toscawidgets a component :)

comment:3 Changed 12 years ago by alberto

You sort of read my mind... Thanks :)

comment:4 Changed 12 years ago by alberto

  • Status changed from new to closed
  • Resolution set to fixed

My fault. I had tweaked the patch to rename pylonshf.py to pylons.py which seems to confuse the importer. Comitted at [2232]. Thanks :)

Note: See TracTickets for help on using tickets.