[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tinkering with sketch as module

From: Terry Hancock
Subject: Tinkering with sketch as module
Date: Mon, 21 Jun 2004 07:12:26 -0500
User-agent: KMail/1.5.4

Hi all,
As you may recall, we had a discussion on the list about 
making a sketch gallery, and I suggested that I might be 
able to do it in Zope with VarImage (write a rendering 
layer for VarImage so the source "image" can actually be a 
vector graphic .sk file).  I'm guessing that once I do 
this, I can go on to support .fig, .svg, and anything else 
Sketch has a loader for.

Well, I'm actually getting around to trying it...

And as this is really the first time I've messed with using 
sketch as a python module (BTW -- is it going to remain the 
"Sketch" module and the "Skencil" application, or are both 
names changing?), I have some newbie questions.

What the heck does this code do:

for dir in ('Lib', 'Filter', 'Pax'):
    dir = os.path.join(sys.path[0], dir)
    if os.path.isdir(dir):
        sys.path.insert(1, dir)

As I read it, it will generally have no effect at all -- 
it's adding "./Lib", "./Filter", and "./Pax" to the Python 
path if they exist?  But of course, they usually won't, 
since we're looking for them (I think) in the current 
directory.  It seems to be in all the scripts, so it seems 
like it might be necessary, but I don't understand why. I'm 
wondering if I'm missing something clever.

Also, what's the prognosis on getting Sketch to work with 
two python installations (Python 2.1 and 2.3)?  Do I need 
to do a separate installation of sketch for each?  I'm 
guessing so, since the .so files won't be compatible.

Finally, can sketch be made to install like a regular python 
module -- such as might be desireable on a server, where 
I'm only interested in using it for conversions?  And if I 
do this, can I trim some library dependencies -- the server
might not have TK or GTK libs and stuff if it is normally 
run headless.


Terry Hancock ( hancock at )
Anansi Spaceworks

reply via email to

[Prev in Thread] Current Thread [Next in Thread]