Re: how to structure a directory with many scripts and shared code

2010-02-16 Thread Benedict Verheyen
Jean-Michel Pichavant wrote: > Benedict Verheyen wrote: >> Hhhm, i can see how it makes the maintenance cleaner. >> However, in the case of a single setup.py, i will end up installing >> scripts on servers >> that will never use them, only some. >> > You should care about this only if your scr

Re: how to structure a directory with many scripts and shared code

2010-02-16 Thread Jean-Michel Pichavant
Benedict Verheyen wrote: sstein...@gmail.com wrote: On Feb 16, 2010, at 3:28 AM, Benedict Verheyen wrote: python_scripts | |-->trunk ..|-> my big script 1 |-> setup.py ..|-> my big script 2 |-> setup.py ..|-> database

Re: how to structure a directory with many scripts and shared code

2010-02-16 Thread Benedict Verheyen
sstein...@gmail.com wrote: > On Feb 16, 2010, at 3:28 AM, Benedict Verheyen wrote: >> python_scripts >> | >> |-->trunk >> ..|-> my big script 1 >> |-> setup.py >> ..|-> my big script 2 >> |-> setup.py >> ..|-> database >> ...

Re: how to structure a directory with many scripts and shared code

2010-02-16 Thread sstein...@gmail.com
On Feb 16, 2010, at 3:28 AM, Benedict Verheyen wrote: > Steven D'Aprano wrote: >> On Mon, 15 Feb 2010 16:29:05 +0100, Benedict Verheyen wrote: >> >>> However, when i make a subdirectory, for example database and put a >>> script in there, how would i import logutils or mailtutils from within >>>

Re: how to structure a directory with many scripts and shared code

2010-02-16 Thread Benedict Verheyen
Steven D'Aprano wrote: > On Mon, 15 Feb 2010 16:29:05 +0100, Benedict Verheyen wrote: > >> However, when i make a subdirectory, for example database and put a >> script in there, how would i import logutils or mailtutils from within >> the database subdirectory? This fails: >> from tools.logut

Re: how to structure a directory with many scripts and shared code

2010-02-15 Thread Steven D'Aprano
On Mon, 15 Feb 2010 16:29:05 +0100, Benedict Verheyen wrote: > However, when i make a subdirectory, for example database and put a > script in there, how would i import logutils or mailtutils from within > the database subdirectory? This fails: > from tools.logutils import logger Sounds like

Re: how to structure a directory with many scripts and shared code

2010-02-15 Thread sstein...@gmail.com
On Feb 15, 2010, at 11:06 AM, Jean-Michel Pichavant wrote: > 3/ make sure your working copy of myBeautifulPackage is in your PYTHONPATH. Or, make a simple setup.py which imports distribute or setuptools and use: # python setup.py develop which will put your code into the PYTHONPATH by

Re: how to structure a directory with many scripts and shared code

2010-02-15 Thread Benedict Verheyen
Jean-Michel Pichavant wrote: > Hi, > > 1/ Provide the output of the error so we can provide some useful help. > 2/ Embed your structure into a package. Names like 'tools', 'lib', > 'mail', 'log' are too generic and will clash with other badly designed > module/package names. Choose a name for yo

Re: how to structure a directory with many scripts and shared code

2010-02-15 Thread Jean-Michel Pichavant
Benedict Verheyen wrote: Hi, i wanted to ask how you guys structure your code. I mainly have scripts that automate small tasks. These scripts use a common set of utility code. My code is structured like this, for example: script_1.py script_2.py script_3.py tools\ |->__init__.py |->logu

how to structure a directory with many scripts and shared code

2010-02-15 Thread Benedict Verheyen
Hi, i wanted to ask how you guys structure your code. I mainly have scripts that automate small tasks. These scripts use a common set of utility code. My code is structured like this, for example: script_1.py script_2.py script_3.py tools\ |->__init__.py |->logutils.py |->mailutils.py