3 # Copyright (C) 2010-2013 CEA/DEN
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 import src.debug as DBG
26 rem The following variables are used only in case of a sat package
27 set out_dir_Path=%~dp0
33 ##########################################################################
36 # cleanup a path (first parameter) from duplicated entries;
37 # second parameter is the separator
39 out_var=`echo $1 | awk -v sep=$2 '{ \\
40 na = split($1,a,sep); \\
42 for(i=0;i<=na;i++) { \\
59 }' | sed -e 's|\\(.*\\)$1|\\1|g' -e 's|^[:;]||' -e 's|[:;]$||'`
66 out_var=`cleandup $xenv $2`
70 # This line is used only in case of a sat package
71 export out_dir_Path=$(cd $(dirname ${BASH_SOURCE[0]});pwd)
73 ###########################################################################
77 [SALOME Configuration]
81 # a generated SALOME Configuration file using python syntax
84 def get_file_environ(output, shell, environ=None):
85 """Instantiate correct FileEnvironment sub-class.
87 :param output file: the output file stream.
88 :param shell str: the type of shell syntax to use.
89 :param environ dict: a potential additional environment.
92 return BashFileEnviron(output, environ)
94 return BatFileEnviron(output, environ)
95 if shell == "cfgForPy":
96 return LauncherFileEnviron(output, environ)
98 return ContextFileEnviron(output, environ)
99 raise Exception("FileEnviron: Unknown shell = %s" % shell)
101 class FileEnviron(object):
103 Base class for shell environment
105 def __init__(self, output, environ=None):
109 :param output file: the output file stream.
110 :param environ dict: a potential additional environment.
112 self._do_init(output, environ)
116 easy non exhaustive quick resume for debug print"""
118 "output" : self.output,
119 "environ" : self.environ,
121 return "%s(\n%s\n)" % (self.__class__.__name__, PP.pformat(res))
124 def _do_init(self, output, environ=None):
128 :param output file: the output file stream.
129 :param environ dict: a potential additional environment.
133 if environ is not None:
134 #if str(type(environ)) == "<type 'instance'>":
135 if id(environ) == id(os.environ):
136 DBG.tofix("set %s environ as python os.environ, are you sure it is safe ?" % self.__class__.__name__, True)
137 self.environ = environ
139 DBG.tofix("set %s environ as COPY of python os.environ, are you sure it is safe ?" % self.__class__.__name__, True)
140 self.environ = dict(os.environ) #make a copy cvw 180320
142 def add_line(self, number):
144 Add some empty lines in the shell file
146 :param number int: the number of lines to add
148 self.output.write("\n" * number)
150 def add_comment(self, comment):
152 Add a comment in the shell file
154 :param comment str: the comment to add
156 self.output.write("# %s\n" % comment)
158 def add_echo(self, text):
160 Add a "echo" in the shell file
162 :param text str: the text to echo
164 self.output.write('echo %s"\n' % text)
166 def add_warning(self, warning):
168 Add a warning "echo" in the shell file
170 :param warning str: the text to echo
172 self.output.write('echo "WARNING %s"\n' % warning)
174 def append_value(self, key, value, sep=os.pathsep):
176 append value to key using sep,
177 if value contains ":" or ";" then raise error
179 :param key str: the environment variable to append
180 :param value str: the value to append to key
181 :param sep str: the separator string
183 for c in [";", ":"]: # windows or linux path separators
185 raise Exception("FileEnviron append key '%s' value '%s' contains forbidden character '%s'" % (key, value, c))
186 self.set(key, self.get(key) + sep + value)
187 if (key, sep) not in self.toclean:
188 self.toclean.append((key, sep))
190 def append(self, key, value, sep=os.pathsep):
192 Same as append_value but the value argument can be a list
194 :param key str: the environment variable to append
195 :param value str or list: the value(s) to append to key
196 :param sep str: the separator string
198 if isinstance(value, list):
200 self.append_value(key, v, sep)
202 self.append_value(key, value, sep)
204 def prepend_value(self, key, value, sep=os.pathsep):
206 prepend value to key using sep,
207 if value contains ":" or ";" then raise error
209 :param key str: the environment variable to prepend
210 :param value str: the value to prepend to key
211 :param sep str: the separator string
213 for c in [";", ":"]: # windows or linux path separators
215 raise Exception("FileEnviron prepend key '%s' value '%s' contains forbidden character '%s'" % (key, value, c))
216 self.set(key, value + sep + self.get(key))
217 if (key, sep) not in self.toclean:
218 self.toclean.append((key, sep))
220 def prepend(self, key, value, sep=os.pathsep):
222 Same as prepend_value but the value argument can be a list
224 :param key str: the environment variable to prepend
225 :param value str or list: the value(s) to prepend to key
226 :param sep str: the separator string
228 if isinstance(value, list):
229 for v in reversed(value): # prepend list, first item at last to stay first
230 self.prepend_value(key, v, sep)
232 self.prepend_value(key, value, sep)
234 def is_defined(self, key):
236 Check if the key exists in the environment
238 :param key str: the environment variable to check
240 return (key in self.environ)
242 def set(self, key, value):
244 Set the environment variable 'key' to value 'value'
246 :param key str: the environment variable to set
247 :param value str: the value
249 raise NotImplementedError("set is not implement for this shell!")
253 Get the value of the environment variable "key"
255 :param key str: the environment variable
259 def get_value(self, key):
260 """Get the real value of the environment variable "key"
261 It can help env scripts
262 :param key str: the environment variable
264 return self.environ[key]
266 def command_value(self, key, command):
268 Get the value given by the system command "command"
269 and put it in the environment variable key.
270 Has to be overwritten in the derived classes
271 This can be seen as a virtual method
273 :param key str: the environment variable
274 :param command str: the command to execute
276 raise NotImplementedError("command_value is not implement "
279 def finish(self, required=True):
280 """Add a final instruction in the out file (in case of file generation)
282 :param required bool: Do nothing if required is False
284 for (key, sep) in self.toclean:
286 self.output.write('clean %s "%s"\n' % (key, sep))
288 class BashFileEnviron(FileEnviron):
290 Class for bash shell.
292 def __init__(self, output, environ=None):
295 :param output file: the output file stream.
296 :param environ dict: a potential additional environment.
298 self._do_init(output, environ)
299 self.output.write(bash_header)
301 def set(self, key, value):
302 """Set the environment variable "key" to value "value"
304 :param key str: the environment variable to set
305 :param value str: the value
307 self.output.write('export %s="%s"\n' % (key, value))
308 self.environ[key] = value
310 def command_value(self, key, command):
312 Get the value given by the system command "command"
313 and put it in the environment variable key.
314 Has to be overwritten in the derived classes
315 This can be seen as a virtual method
317 :param key str: the environment variable
318 :param command str: the command to execute
320 self.output.write('export %s=$(%s)\n' % (key, command))
322 def finish(self, required=True):
323 """Add a final instruction in the out file (in case of file generation)
325 :param required bool: Do nothing if required is False
329 FileEnviron.finish(self, required)
331 class BatFileEnviron(FileEnviron):
333 for Windows batch shell.
335 def __init__(self, output, environ=None):
338 :param output file: the output file stream.
339 :param environ dict: a potential additional environment.
341 self._do_init(output, environ)
342 self.output.write(bat_header)
344 def add_comment(self, comment):
345 """Add a comment in the shell file
347 :param comment str: the comment to add
349 self.output.write("rem %s\n" % comment)
352 """Get the value of the environment variable "key"
354 :param key str: the environment variable
356 return '%%%s%%' % key
358 def set(self, key, value):
359 """Set the environment variable "key" to value "value"
361 :param key str: the environment variable to set
362 :param value str: the value
364 self.output.write('set %s=%s\n' % (key, value))
365 self.environ[key] = value
367 def command_value(self, key, command):
369 Get the value given by the system command "command"
370 and put it in the environment variable key.
371 Has to be overwritten in the derived classes
372 This can be seen as a virtual method
374 :param key str: the environment variable
375 :param command str: the command to execute
377 self.output.write('%s > tmp.txt\n' % (command))
378 self.output.write('set /p %s =< tmp.txt\n' % (key))
380 def finish(self, required=True):
382 Add a final instruction in the out file (in case of file generation)
383 In the particular windows case, do nothing
385 :param required bool: Do nothing if required is False
389 class ContextFileEnviron(FileEnviron):
390 """Class for a salome context configuration file.
392 def __init__(self, output, environ=None):
395 :param output file: the output file stream.
396 :param environ dict: a potential additional environment.
398 self._do_init(output, environ)
399 self.output.write(cfg_header)
401 def set(self, key, value):
402 """Set the environment variable "key" to value "value"
404 :param key str: the environment variable to set
405 :param value str: the value
407 self.output.write('%s="%s"\n' % (key, value))
408 self.environ[key] = value
411 """Get the value of the environment variable "key"
413 :param key str: the environment variable
415 return '%({0})s'.format(key)
417 def command_value(self, key, command):
419 Get the value given by the system command "command"
420 and put it in the environment variable key.
421 Has to be overwritten in the derived classes
422 This can be seen as a virtual method
424 :param key str: the environment variable
425 :param command str: the command to execute
427 raise NotImplementedError("command_value is not implement "
428 "for salome context files!")
430 def add_echo(self, text):
433 :param text str: the comment to add
435 self.add_comment(text)
437 def add_warning(self, warning):
440 :param text str: the warning to add
442 self.add_comment("WARNING %s" % warning)
444 def prepend_value(self, key, value, sep=os.pathsep):
445 """prepend value to key using sep
447 :param key str: the environment variable to prepend
448 :param value str: the value to prepend to key
449 :param sep str: the separator string
451 self.output.write('ADD_TO_%s: %s\n' % (key, value))
453 def append_value(self, key, value, sep=os.pathsep):
454 """append value to key using sep
456 :param key str: the environment variable to append
457 :param value str: the value to append to key
458 :param sep str: the separator string
460 self.prepend_value(key, value)
462 def finish(self, required=True):
463 """Add a final instruction in the out file (in case of file generation)
465 :param required bool: Do nothing if required is False
469 def special_path_separator(name):
471 TCLLIBPATH, TKLIBPATH, PV_PLUGIN_PATH environments variables need
472 some exotic path separator.
473 This function gives the separator regarding the name of the variable
474 to append or prepend.
476 :param name str: The name of the variable to find the separator
478 special_blanks_keys=["TCLLIBPATH", "TKLIBPATH"]
479 special_semicolon_keys=["PV_PLUGIN_PATH"]
481 if name in special_blanks_keys: res=" "
482 if name in special_semicolon_keys: res=";"
485 class LauncherFileEnviron:
487 Class to generate a launcher file script
488 (in python syntax) SalomeContext API
490 def __init__(self, output, environ=None):
493 :param output file: the output file stream.
494 :param environ dict: a potential additional environment.
498 if environ is not None:
499 self.environ = environ
501 self.environ = os.environ
502 # Initialize some variables
503 if not "PATH" in self.environ.keys():
504 self.environ["PATH"]=""
505 if not "LD_LIBRARY_PATH" in self.environ.keys():
506 self.environ["LD_LIBRARY_PATH"]=""
507 if not "PYTHONPATH" in self.environ.keys():
508 self.environ["PYTHONPATH"]=""
509 if not "TCLLIBPATH" in self.environ.keys():
510 self.environ["TCLLIBPATH"]=""
511 if not "TKLIBPATH" in self.environ.keys():
512 self.environ["TKLIBPATH"]=""
514 # four whitespaces for first indentation in a python script
516 self.prefix="context."
517 self.setVarEnv="setVariable"
519 self.begin=self.indent+self.prefix
520 self.output.write(Launcher_header)
521 self.specialKeys={"PATH": "Path",
522 "LD_LIBRARY_PATH": "LdLibraryPath",
523 "PYTHONPATH": "PythonPath"}
525 def change_to_launcher(self, value):
529 def add_line(self, number):
530 """Add some empty lines in the launcher file
532 :param number int: the number of lines to add
534 self.output.write("\n" * number)
536 def add_echo(self, text):
539 :param text str: the comment to add
541 self.output.write('# %s"\n' % text)
543 def add_warning(self, warning):
546 :param text str: the warning to add
548 self.output.write('# "WARNING %s"\n' % warning)
550 def append_value(self, key, value, sep=":"):
551 """append value to key using sep,
552 if value contains ":" or ";" then raise error
554 :param key str: the environment variable to append
555 :param value str: the value to append to key
556 :param sep str: the separator string
558 for c in [";", ":"]: # windows or linux path separators
560 raise Exception("LauncherFileEnviron append key '%s' value '%s' contains forbidden character '%s'" % (key, value, c))
561 if self.is_defined(key) :
566 def append(self, key, value, sep=":"):
567 """Same as append_value but the value argument can be a list
569 :param key str: the environment variable to append
570 :param value str or list: the value(s) to append to key
571 :param sep str: the separator string
573 if isinstance(value, list):
575 self.append_value(key, v, sep)
577 self.append_value(key, value, sep)
579 def prepend_value(self, key, value, sep=":"):
580 """prepend value to key using sep,
581 if value contains ":" or ";" then raise error
583 :param key str: the environment variable to prepend
584 :param value str: the value to prepend to key
585 :param sep str: the separator string
587 for c in [";", ":"]: # windows or linux path separators
589 raise Exception("LauncherFileEnviron prepend key '%s' value '%s' contains forbidden character '%s'" % (key, value, c))
590 if self.is_defined(key) :
595 def prepend(self, key, value, sep=":"):
596 """Same as prepend_value but the value argument can be a list
598 :param key str: the environment variable to prepend
599 :param value str or list: the value(s) to prepend to key
600 :param sep str: the separator string
602 if isinstance(value, list):
604 self.prepend_value(key, v, sep)
606 self.prepend_value(key, value, sep)
608 def is_defined(self, key):
609 """Check if the key exists in the environment
611 :param key str: the environment variable to check
613 return key in self.environ.keys()
616 """Get the value of the environment variable "key"
618 :param key str: the environment variable
622 def set(self, key, value):
623 """Set the environment variable "key" to value "value"
625 :param key str: the environment variable to set
626 :param value str: the value
628 self.output.write(self.begin+self.setVarEnv+
629 '(r"%s", r"%s", overwrite=True)\n' %
630 (key, self.change_to_launcher(value)))
631 self.environ[key] = value
633 def get_value(self, key):
634 """Get the real value of the environment variable "key", not ${key}
635 It can help env scripts
636 :param key str: the environment variable
638 return self.environ[key]
640 def add(self, key, value):
641 """prepend value to key using sep
643 :param key str: the environment variable to prepend
644 :param value str: the value to prepend to key
646 if key in self.specialKeys.keys():
647 self.output.write(self.begin+'addTo%s(r"%s")\n' %
648 (self.specialKeys[key],
649 self.change_to_launcher(value)))
650 self.environ[key]+=":"+value
652 sep=special_path_separator(key)
653 self.output.write(self.indent+
654 '#temporary solution!!! have to be defined in API a '
655 '?dangerous? addToSpecial(r"%s", r"%s")\n' %
657 #pathsep not precised because do not know future os launch?
658 self.output.write(self.begin+'addToSpecial(r"%s", r"%s")\n'
659 % (key, self.change_to_launcher(value)))
660 self.environ[key]+=sep+value #here yes we know os for current execution
662 def command_value(self, key, command):
664 Get the value given by the system command "command"
665 and put it in the environment variable key.
667 :param key str: the environment variable
668 :param command str: the command to execute
670 self.output.write(self.indent+'#`%s`\n' % command)
672 import shlex, subprocess
673 args = shlex.split(command)
674 res=subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
675 out, __ = res.communicate()
676 self.output.write(self.begin+
678 '(r"%s", r"%s", overwrite=True)\n' % (key, out))
680 def add_comment(self, comment):
681 # Special comment in case of the distène licence
682 if comment=="DISTENE license":
683 self.output.write(self.indent+
687 '(r"%s", r"%s", overwrite=True)\n' %
688 ('DISTENE_LICENSE_FILE',
689 self.change_to_launcher(
690 'Use global envvar: DLIM8VAR')))
691 self.output.write(self.indent+
695 '(r"%s", r"%s", overwrite=True)\n' %
697 self.change_to_launcher(
700 if "setting environ for" in comment:
701 self.output.write(self.indent+"#[%s]\n" %
702 comment.split("setting environ for ")[1])
705 self.output.write(self.indent+"# %s\n" % comment)
707 def finish(self, required=True):
709 Add a final instruction in the out file (in case of file generation)
710 In the particular launcher case, do nothing
712 :param required bool: Do nothing if required is False
716 class ScreenEnviron(FileEnviron):
717 def __init__(self, output, environ=None):
718 self._do_init(output, environ)
721 def add_line(self, number):
724 def add_comment(self, comment):
727 def add_echo(self, text):
730 def add_warning(self, warning):
733 def write(self, command, name, value, sign="="):
735 self.output.write(" %s%s %s %s %s\n" % \
736 (src.printcolors.printcLabel(command),
737 " " * (12 - len(command)),
738 src.printcolors.printcInfo(name), sign, value))
740 def is_defined(self, name):
741 return name in self.defined
744 return "${%s}" % name
746 def set(self, name, value):
747 self.write("set", name, value)
748 self.defined[name] = value
750 def prepend(self, name, value, sep=":"):
751 if isinstance(value, list):
752 value = sep.join(value)
753 value = value + sep + self.get(name)
754 self.write("prepend", name, value)
756 def append(self, name, value, sep=":"):
757 if isinstance(value, list):
758 value = sep.join(value)
759 value = self.get(name) + sep + value
760 self.write("append", name, value)
762 def command_value(self, key, command):
765 def run_env_script(self, module, script):
766 self.write("load", script, "", sign="")
768 # The SALOME launcher template
770 #! /usr/bin/env python
772 ################################################################
773 # WARNING: this file is automatically generated by SalomeTools #
774 # WARNING: and so could be overwritten at any time. #
775 ################################################################
782 # Add the pwdPath to able to run the launcher after unpacking a package
783 # Used only in case of a salomeTools package
784 out_dir_Path=os.path.dirname(os.path.realpath(__file__))
786 # Preliminary work to initialize path to SALOME Python modules
789 sys.path[:0] = [ 'BIN_KERNEL_INSTALL_DIR' ]
790 os.environ['ABSOLUTE_APPLI_PATH'] = 'KERNEL_INSTALL_DIR'
792 # define folder to store omniorb config (initially in virtual application folder)
794 from salomeContextUtils import setOmniOrbUserPath
796 except Exception as e:
799 # End of preliminary work
801 # salome doc only works for virtual applications. Therefore we overwrite it with this function
802 def _showDoc(modules):
803 for module in modules:
804 modulePath = os.getenv(module+"_ROOT_DIR")
805 if modulePath != None:
806 baseDir = os.path.join(modulePath, "share", "doc", "salome")
807 docfile = os.path.join(baseDir, "gui", module.upper(), "index.html")
808 if not os.path.isfile(docfile):
809 docfile = os.path.join(baseDir, "tui", module.upper(), "index.html")
810 if not os.path.isfile(docfile):
811 docfile = os.path.join(baseDir, "dev", module.upper(), "index.html")
812 if os.path.isfile(docfile):
813 out, err = subprocess.Popen(["xdg-open", docfile]).communicate()
815 print "Online documentation is not accessible for module:", module
817 print module+"_ROOT_DIR not found!"
820 # Identify application path then locate configuration files
823 if args == ['--help']:
824 from salomeContext import usage
828 #from salomeContextUtils import getConfigFileNames
829 #configFileNames, args, unexisting = getConfigFileNames( args, checkExistence=True )
830 #if len(unexisting) > 0:
831 # print "ERROR: unexisting configuration file(s): " + ', '.join(unexisting)
834 # Create a SalomeContext which parses configFileNames to initialize environment
836 from salomeContext import SalomeContext, SalomeContextException
837 SalomeContext.addToSpecial=addToSpecial
838 context = SalomeContext(None)
840 # Here set specific variables, if needed
841 # context.addToPath('mypath')
842 # context.addToLdLibraryPath('myldlibrarypath')
843 # context.addToPythonPath('mypythonpath')
844 # context.setVariable('myvarname', 'value')
847 context.getLogger().setLevel(40)
849 # here your local standalone environment
851 if len(args) >1 and args[0]=='doc':
855 # Start SALOME, parsing command line arguments
856 out, err, status = context.runSalome(args)
859 except SalomeContextException, e:
861 logging.getLogger("salome").error(e)
864 def addToSpecial(self, name, value, pathSep=None):
865 # add special dangerous cases: TCLLIBPATH PV_PLUGIN_PATH etc...
866 # http://computer-programming-forum.com/57-tcl/1dfddc136afccb94.htm
867 # TCLLIBPATH: Tcl treats the contents of that variable as a list. Be happy, for you can now use drive letters on windows.
871 specialBlanksKeys=["TCLLIBPATH", "TKLIBPATH"]
872 specialSemicolonKeys=["PV_PLUGIN_PATH"]
874 if name in specialBlanksKeys: res=" "
875 if name in specialSemicolonKeys: res=";"
881 value = os.path.expandvars(value) # expand environment variables
882 self.getLogger().debug("Add to %s: %s", name, value)
883 env = os.getenv(name, None)
885 os.environ[name] = value
887 os.environ[name] = value + sep + env #explicitely or not special path separator ?whitespace, semicolon?
889 if __name__ == "__main__":
896 #! /usr/bin/env python3
898 ################################################################
899 # WARNING: this file is automatically generated by SalomeTools #
900 # WARNING: and so could be overwritten at any time. #
901 ################################################################
908 # Add the pwdPath to able to run the launcher after unpacking a package
909 # Used only in case of a salomeTools package
910 out_dir_Path=os.path.dirname(os.path.realpath(__file__))
912 # Preliminary work to initialize path to SALOME Python modules
915 sys.path[:0] = [ 'BIN_KERNEL_INSTALL_DIR' ]
916 os.environ['ABSOLUTE_APPLI_PATH'] = 'KERNEL_INSTALL_DIR'
918 # define folder to store omniorb config (initially in virtual application folder)
920 from salomeContextUtils import setOmniOrbUserPath
922 except Exception as e:
925 # End of preliminary work
927 # salome doc only works for virtual applications. Therefore we overwrite it with this function
928 def _showDoc(modules):
929 for module in modules:
930 modulePath = os.getenv(module+"_ROOT_DIR")
931 if modulePath != None:
932 baseDir = os.path.join(modulePath, "share", "doc", "salome")
933 docfile = os.path.join(baseDir, "gui", module.upper(), "index.html")
934 if not os.path.isfile(docfile):
935 docfile = os.path.join(baseDir, "tui", module.upper(), "index.html")
936 if not os.path.isfile(docfile):
937 docfile = os.path.join(baseDir, "dev", module.upper(), "index.html")
938 if os.path.isfile(docfile):
939 out, err = subprocess.Popen(["xdg-open", docfile]).communicate()
941 print("Online documentation is not accessible for module:", module)
943 print(module+"_ROOT_DIR not found!")
946 # Identify application path then locate configuration files
949 if args == ['--help']:
950 from salomeContext import usage
954 #from salomeContextUtils import getConfigFileNames
955 #configFileNames, args, unexisting = getConfigFileNames( args, checkExistence=True )
956 #if len(unexisting) > 0:
957 # print("ERROR: unexisting configuration file(s): " + ', '.join(unexisting))
960 # Create a SalomeContext which parses configFileNames to initialize environment
962 from salomeContext import SalomeContext, SalomeContextException
963 SalomeContext.addToSpecial=addToSpecial
964 context = SalomeContext(None)
966 # Here set specific variables, if needed
967 # context.addToPath('mypath')
968 # context.addToLdLibraryPath('myldlibrarypath')
969 # context.addToPythonPath('mypythonpath')
970 # context.setVariable('myvarname', 'value')
973 context.getLogger().setLevel(40)
975 # here your local standalone environment
977 if len(args) >1 and args[0]=='doc':
981 # Start SALOME, parsing command line arguments
982 out, err, status = context.runSalome(args)
985 except SalomeContextException as e:
987 logging.getLogger("salome").error(e)
990 def addToSpecial(self, name, value, pathSep=None):
991 # add special dangerous cases: TCLLIBPATH PV_PLUGIN_PATH etc...
992 # http://computer-programming-forum.com/57-tcl/1dfddc136afccb94.htm
993 # TCLLIBPATH: Tcl treats the contents of that variable as a list. Be happy, for you can now use drive letters on windows.
997 specialBlanksKeys=["TCLLIBPATH", "TKLIBPATH"]
998 specialSemicolonKeys=["PV_PLUGIN_PATH"]
1000 if name in specialBlanksKeys: res=" "
1001 if name in specialSemicolonKeys: res=";"
1007 value = os.path.expandvars(value) # expand environment variables
1008 self.getLogger().debug("Add to %s: %s", name, value)
1009 env = os.getenv(name, None)
1011 os.environ[name] = value
1013 os.environ[name] = value + sep + env #explicitely or not special path separator ?whitespace, semicolon?
1015 if __name__ == "__main__":