Re: where to put application init code?

2007-05-23 Thread Shannon -jj Behrens
On 5/22/07, Max Ischenko <[EMAIL PROTECTED]> wrote: > > > On 5/23/07, Shannon -jj Behrens <[EMAIL PROTECTED]> wrote: > > > So, any ideas how to detect changes in template files to re-generate > them > > > or at least generate everything at Pylons' application startup? > > > > Perhaps there's some

Re: where to put application init code?

2007-05-22 Thread Max Ischenko
On 5/23/07, Shannon -jj Behrens <[EMAIL PROTECTED]> wrote: > > > So, any ideas how to detect changes in template files to re-generate > them > > or at least generate everything at Pylons' application startup? > > Perhaps there's something more specific for your situation, but using > make would do

Re: where to put application init code?

2007-05-22 Thread Ian Bicking
Max Ischenko wrote: > Hello, > > On 5/18/07, *Max Ischenko* <[EMAIL PROTECTED] > > wrote: > > Any other superglobals won't have been setup by then, though. What > other ones do you need access to? > > > That's precisely the problem. > > I h

Re: where to put application init code?

2007-05-22 Thread Shannon -jj Behrens
On 5/22/07, Max Ischenko <[EMAIL PROTECTED]> wrote: > Hello, > > On 5/18/07, Max Ischenko <[EMAIL PROTECTED]> wrote: > > > > > > > Any other superglobals won't have been setup by then, though. What > > > other ones do you need access to? > > > > > > That's precisely the problem. > > > > I have a m

Re: where to put application init code?

2007-05-22 Thread Max Ischenko
Hello, On 5/18/07, Max Ischenko <[EMAIL PROTECTED]> wrote: > > Any other superglobals won't have been setup by then, though. What > > other ones do you need access to? > > > That's precisely the problem. > > I have a mixed PHP/Pylons site and wanted to pre-generate some Mako > templates into HTML/

Re: where to put application init code?

2007-05-17 Thread Max Ischenko
Hello Philip, On 5/17/07, Philip Jenvey <[EMAIL PROTECTED]> wrote: > > > If you're running from the latest Pylons 0.9.5 project template, the > CONFIG object is already setup by the time the Globals constructor is > called. This is done by these lines at the top of middleware.make_app: Yep. I go

Re: where to put application init code?

2007-05-17 Thread Mike Orr
On 5/17/07, Dan <[EMAIL PROTECTED]> wrote: > I don't consider myself a Pylons guru :-) , but I put my db init inside of > websetup.py and call it with paster. Hope it helps. Example below: > > command-prompt# paster setup-app development.ini Yeah, that's now QuickWiki does it. It's a good pl

Re: where to put application init code?

2007-05-17 Thread Philip Jenvey
On May 17, 2007, at 10:14 AM, Max Ischenko wrote: > Hi, > > What's the most appropriate place to put the code to run once the > application is started? > > I've used app_globals.py:Globals.__init__ but when it is called the > configuration is not yet fully loaded and that results in TypeErro

Re: where to put application init code?

2007-05-17 Thread voltron
Thats great! Just what I intended :-) On May 17, 9:16 pm, Dan <[EMAIL PROTECTED]> wrote: > I don't consider myself a Pylons guru:-), but I put my db init inside of > websetup.py and call it with paster. Hope it helps. Example below: > command-prompt# paster setup-app development.ini > #websetu

Re: where to put application init code?

2007-05-17 Thread Dan
I don't consider myself a Pylons guru :-) , but I put my db init inside of websetup.py and call it with paster.  Hope it helps.  Example below: command-prompt# paster setup-app development.ini #websetup.py def setup_config(command, filename, section, vars):     """     Place any commands to

Re: where to put application init code?

2007-05-17 Thread voltron
I was actually thinking about this yesterday. I was thinking of where to put my code that imports that uses sqlalchmey to check, drop or create databases for my application. I read somewhere that one should use the setup.py for this. But that would mean that one would have to create an egg for the

Re: where to put application init code?

2007-05-17 Thread Mike Orr
On 5/17/07, Max Ischenko <[EMAIL PROTECTED]> wrote: > What's the most appropriate place to put the code to run once the > application is started? > > I've used app_globals.py:Globals.__init__ but when it is called the > configuration is not yet fully loaded and that results in TypeError > access

where to put application init code?

2007-05-17 Thread Max Ischenko
Hi, What's the most appropriate place to put the code to run once the application is started? I've used app_globals.py:Globals.__init__ but when it is called the configuration is not yet fully loaded and that results in TypeError accessing some globals. Max. --~--~-~--~~