From 3fc9c4bc1d6f70db41ad418992bf3d461059d3c0 Mon Sep 17 00:00:00 2001 From: vidon Date: Fri, 10 Jun 2005 10:29:10 +0000 Subject: closes #14 add auto_path environment var --- Python/library/Zinc.py.in | 10 ++++++++-- 1 file 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): -- cgit v1.1