[Tutor] my own site-package

Jeff Shannon jeff at ccvcorp.com
Wed Oct 6 21:54:13 CEST 2004


nik wrote:

>
> My ultimate aim is to provide a software/hardware solution to my 
> customers, and a large part of the software part will be python 
> scripts that can be either used 'out of the box' or customised freely 
> (or somewhere in between, a pick and choose situation). So, they'll 
> receive a server with pre-installed software and a user account that 
> has access to those components (to keep it separate from root). I'm 
> not planning on selling it as a software only solution (yet), so 
> there'd be no conflict with personal accounts etc.
>
> Each instance of the main server app interfaces to the python scripts 
> through a single file which has three required functions. There maybe 
> several server apps running concurrently, which might require 
> different scripts.
> I'm providing a fairly comprehensive set of helper modules which can 
> be called by that script file (ie database access, socket support, XML 
> translation etc), which could be used as is, but I'm happy if the user 
> modifies them (which they probably will).
>
> My initial idea was to put the helper modules in a single package in 
> site-packages, but I'm not sure where to put the main scripts that the 
> server app accesses (/usr/local/etc, /home/serveradmin/scripts etc?).


My thought in this scenario would be to do as you suggest -- a single 
package in site-packages, just as any third-party package would be 
installed.  The main scripts (which I'd probably make fairly minimal, 
with most of the intelligence being in the library package), I'd 
probably put in /usr/local/bin -- this follows the Unix convention on 
where to put executable programs.  After all, from the user's 
perspective, the main script *is* an executable program which just 
happens to use the libraries in python/lib/site-packages ...

Another option, if you're delivering this machine with a single 
pre-configured application user, would be to put the main scripts into 
~appuser/bin.  This would then isolate the scripts from any *other* 
users on that machine (not that there should be any...)  Depends on how 
much you want to tie the application to a single user account.

Jeff Shannon
Technician/Programmer
Credit International





More information about the Tutor mailing list