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 #1932 (closed defect: fixed)

Opened 11 years ago

Last modified 10 years ago

Pylons always assumes default paths for the controllers

Reported by: Gustavo Owned by: anonymous
Priority: high Milestone:
Component: TurboGears Version: trunk
Severity: critical Keywords:
Cc:

Description

TG2 supports custom paths for the controllers (for example, {mypackage}.web.controllers instead of {mypackage}.controllers), but Pylons doesn't support them - and I don't know if it's because of a bug or just because this behavior is not intended to be supported.

I'm using Pylons 0.9.7beta5 and lines 263, 264 and 265 of wsgiapp.py look like this, respectively:

        # Pull the controllers class name, import controller
        full_module_name = self.package_name + '.controllers.' \
            + controller.replace('/', '.')

This is the source of the problem: Here Pylons assumes that my controllers are in {mypackage}.controllers

So, what's exactly the problem? Is TG2 relying on a non-existing feature of Pylons? Or this is a Pylons bug? I asked this question on IRC, but I got no answer.

In the mean time, all I can do hack Pylons by replacing the lines above by:

        # Pull the controllers class name, import controller
        full_module_name = self.package_name + '.web.controllers.' \
            + controller.replace('/', '.')

Change History

comment:1 in reply to: ↑ description Changed 11 years ago by Gustavo

Replying to Gustavo:

So, what's exactly the problem? Is TG2 relying on a non-existing feature of Pylons? Or this is a Pylons bug? I asked this question on IRC, but I got no answer.

OK, I've just confirmed that Pylons doesn't support custom controller paths, so  I think TG2 should subclass !PylonsApp.

comment:2 Changed 11 years ago by mramm

  • Milestone set to 2.0-preview-3

comment:3 Changed 11 years ago by mramm

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

At least for now, this is fixed in TG by subclassing PylonsApp? and updating the way controllers are found.

comment:4 Changed 10 years ago by anonymous

  • Milestone 1.9.7a4 deleted

Milestone 1.9.7a4 deleted

Note: See TracTickets for help on using tickets.