My solution to this issue was to rename the expected myapp/gargoyle.py
to myapp/gargolye_conditions.py :
https://github.com/winhamwr/gargoyle/tree/condition_rename
Looking for "gargoyle" it seems like you're going to shadow one or the
other depending on your python path setup.
-Wes
On Jan 17, 8:18 pm, Liubomir Petrov <
liubomir.pet...@gmail.com> wrote:
> Tested the changeset and it works perfect, except...
> When I call in my app: app/gargoyle.py
> from gargoyle import gargoyle
> from gargoyle import conditions
>
> It says that conditions and gargoyle are not found in module gargoyle. After
> some debug I found that it tries to import my app.gargoyle, not the
> libs.gargoyle.gargoyle module.
> Again if I change the import to use libs.gargoyle there are 2 different
> SwitchManager's initialized. I'm not sure if this is a normal behavior of
> python, but since I have added . and ./libs/ to my import path I can import
> 2 times the same module as different instance. (Note:
> Python2.7/Windows/Devserver_plus + Werkzeug).
>
> So I'd applied again my solution:
> - imp.find_module('gargoyle*s*', app_path)
> Is there a better way of fixing this?
> I've been using this folder structure/import path for the last few months
> for several projects and I'd never found any problems on any 3rd party
> Django app, but still - if you think that the problems are from my way of
> loading external apps, I'll be happy to thing some way of fixing it :)
>
> And again - 10x for the good support. I will do some testing now and if it
> fits my needs, I'll definitely try to contribute some DTL templatetags or
> whatever I found usable while implementing it into my project :)
>
> Best regards,
> Lyubomir Petrov
>
>
>
>
>
>
>
> On Mon, Jan 17, 2011 at 10:45 PM, David Cramer <
dcra...@gmail.com> wrote:
> > This should solve the problem. I removed all references of
> > gargoyle.models.gargoyle and its now only available at gargoyle.gargoyle.
>
> >
https://github.com/disqus/gargoyle/commit/da27005bf5d16b3b5a23f11823e...
>
> > --
> > David Cramer
>
> > On Monday, January 17, 2011 at 12:34 PM, Liubomir Petrov wrote:
>
> > Ok, I will pause and wait for the upcoming changes this night :)
> > Btw, the patch does fixes some issues, but still there is something weird
> > going on when I press "add" to my new custom condition I got some KeyErrors
> > and similar.
> > If you want I cant take a deeper look into the code now and supply a patch?
>
> > Best regards,
> > Lyubomir Petrov
>