/[circus]/circus/circus/config.py
ViewVC logotype

Diff of /circus/circus/config.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by tvon, Sun Nov 17 03:26:20 2002 UTC revision 1.13 by tvon, Sun Nov 17 04:22:16 2002 UTC
# Line 63  class Config(ConfigParser.ConfigParser): Line 63  class Config(ConfigParser.ConfigParser):
63          checking.  If <path> is not given, then add the path from          checking.  If <path> is not given, then add the path from
64          the config.          the config.
65          """          """
66            
67          if path == None:          if path == None:
68              addpath = self.get('main', 'module_path')              addpath = self.get('main', 'module_path')
69                    
70          # no non-existant paths          # pass over non-existant paths
         # XXX: Should raise an exception here, returning -1 is for kids :)  
71          if not os.path.exists(addpath):          if not os.path.exists(addpath):
72              return -1              return
73    
74          # Clean it up in case its relative from circus_home          # Clean it up in case its relative from circus_home
75          path = os.path.abspath(addpath)          path = os.path.abspath(addpath)
76    
77            # No dupes
78          for p in sys.path:          for p in sys.path:
79              p = os.path.abspath(p)              p = os.path.abspath(p)
80              if addpath in (p, p + os.sep):              if addpath in (p, p + os.sep):
81                  return 0                  return
82                    
83          sys.path.append(addpath)          sys.path.append(addpath)
84    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26