[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-23 Thread Jesse James
On Jul 23, 10:33 am, svilen <[EMAIL PROTECTED]> wrote: > > First, I appended the sys.path var like this (relative, was > > absolute before): > > sys.path.append( 'vor') > > IMO u should not touch sys.path unless u really really have no other > chance. Although this above is another whole

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-23 Thread Jesse James
On Jul 23, 10:33 am, svilen <[EMAIL PROTECTED]> wrote: > > First, I appended the sys.path var like this (relative, was > > absolute before): > > sys.path.append( 'vor') > > IMO u should not touch sys.path unless u really really have no other > chance. Although this above is another whole

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-23 Thread svilen
> First, I appended the sys.path var like this (relative, was > absolute before): > sys.path.append( 'vor') IMO u should not touch sys.path unless u really really have no other chance. Although this above is another wholesale solution to your initial problem (and no need of my_imports et

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-23 Thread svilen
> 1: At least I'm in a working context...since I will be the user of > this jobs module 90% of the time for a while, I'll have a fighting > chance of refining it further to handle the other things you allude > to. have fun then. As for the $100... give them to someone in _need_ (the mall is not i

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-23 Thread Jesse James
> -3: 2.5 or 2.4 all the same (Except abs/rel imports which still dont > work in 2.5 anyway). > -2: u need my_import (or similar) because __import__( 'vor.model') > will not give u want u want. > -1: u need to give _same_ full absolute paths to __import__ (or > substitute) or else u'll get duplic

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-23 Thread svilen
On Monday 23 July 2007 17:52:51 Jesse James wrote: > > aaah, u are _that_ new... > > - use it instead of the __import__() func > > - original python library reference of the version u use; > > e.g.http://docs.python.org/lib/built-in-funcs.html > > > > wow there's a level parameter now... somethi

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-23 Thread Jesse James
Ok, I just tried something that actually worked. WOO HOO! First, I appended the sys.path var like this (relative, was absolute before): sys.path.append( 'vor') combined with this: ... module = my_import('vor.'+modname) ... I realize that this is not ideal. But I'

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-23 Thread Jesse James
> aaah, u are _that_ new... > - use it instead of the __import__() func > - original python library reference of the version u use; > e.g.http://docs.python.org/lib/built-in-funcs.html > > wow there's a level parameter now... somethin to try I'm not using 2.5 (2.4 still). I tried the 'my_import

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-23 Thread svilen
On Monday 23 July 2007 16:45:15 Jesse James wrote: > which python reference (url?) are you speaking of? > how does 'import_fullname' work? how would it be applied? aaah, u are _that_ new... - use it instead of the __import__() func - original python library reference of the version u use; e.g.

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-23 Thread Jesse James
which python reference (url?) are you speaking of? how does 'import_fullname' work? how would it be applied? On Jul 21, 11:35 am, [EMAIL PROTECTED] wrote: > > In other words, should I first attempt to > > __import__('vor.'+modname) in runJob() ? > > see the python reference about how to use __imp

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-21 Thread sdobrev
> In other words, should I first attempt to > __import__('vor.'+modname) in runJob() ? see the python reference about how to use __import__ over hierarchical paths, or use this instead def import_fullname( name): m = __import__( name) subnames = name.split('.')[1:] for k in subnames

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-21 Thread sdobrev
this is the relative vs absolute import conflict, see python 2.5 news and the PEP about it. i'm not sure if last py2.5 really does all that, it didnt work here. The code u have, imports the module via different paths - some relative, e.g. current dir, and other absolute - e.g. via pythonpath,

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-21 Thread Jesse James
On Jul 20, 10:42 pm, [EMAIL PROTECTED] wrote: > this ain't SA issue, but if u want a solution, u have to provide more > data, and do some prints here-there. > > > When a scheduled job is run, its specified module is loaded using > > __import__ . This works fine unless the loaded module has an >

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-20 Thread sdobrev
this ain't SA issue, but if u want a solution, u have to provide more data, and do some prints here-there. > When a scheduled job is run, its specified module is loaded using > __import__ . This works fine unless the loaded module has an > 'import model' in it. If so, I get this: > Traceback (mo