diff options
author | vidon | 2005-06-10 10:29:10 +0000 |
---|---|---|
committer | vidon | 2005-06-10 10:29:10 +0000 |
commit | 3fc9c4bc1d6f70db41ad418992bf3d461059d3c0 (patch) | |
tree | e1a9bc02cd25cf4dbd910abe773b60937d1239a9 | |
parent | 226477259cf1028665ba48f94719ae72ec718f15 (diff) | |
download | tkzinc-3fc9c4bc1d6f70db41ad418992bf3d461059d3c0.zip tkzinc-3fc9c4bc1d6f70db41ad418992bf3d461059d3c0.tar.gz tkzinc-3fc9c4bc1d6f70db41ad418992bf3d461059d3c0.tar.bz2 tkzinc-3fc9c4bc1d6f70db41ad418992bf3d461059d3c0.tar.xz |
closes #14
add auto_path environment var
-rw-r--r-- | Python/library/Zinc.py.in | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/library/Zinc.py.in b/Python/library/Zinc.py.in index a2bc40e..33ffdd8 100644 --- a/Python/library/Zinc.py.in +++ b/Python/library/Zinc.py.in @@ -23,6 +23,7 @@ from Tkinter import * from Tkinter import _cnfmerge, _flatten import traceback import new +import os ZINC_NO_PART=-1 ZINC_CURRENT_POSITION=-2 @@ -31,7 +32,7 @@ ZINC_LEADER=-4 ZINC_CONNECTION=-5 _LIBLOADED=0 _VERSION="" -ZINC_NO_PART = " " +ZINC_NO_PART = "" # current part dictionnary ZINC_DPART = { 'position' : ZINC_CURRENT_POSITION, @@ -48,6 +49,11 @@ if nok : return 0 ''' global _VERSION if (_LIBLOADED==1) : return _VERSION try: + if os.environ.has_key('auto_path'): + ldir = os.environ['auto_path'].split(':') + ldir.reverse() + for adir in ldir : + window.tk.call('eval', "set auto_path [linsert $auto_path 0 %s]" % (adir)) window.tk.call('eval', 'package require Tkzinc') # Call a function from the package to autoload it # and verify that all is OK. @@ -300,7 +306,7 @@ class Zinc(Widget): ''' num=zinc.currentpart() ''' - return self.tk.call(self._w,'currentpart') + return str(self.tk.call(self._w,'currentpart')) def cursor(self,*args): |