def load_conf(path=None, file=None):
 conf = ConfigParser()
 if file:
  conf.readfp(file)
  return conf
 confpath = None
 if (not path):
  try:
   confpath = os.environ['DULWICH_SWIFT_CFG']
  except KeyError:
   raise Exception('You need to specify a configuration file')
 else:
  confpath = path
 if (not os.path.isfile(confpath)):
  raise Exception(('Unable to read configuration file %s' % confpath))
 conf.read(confpath)
 return conf

def load_conf ( path = None , file = None ) : conf = ConfigParser ( ) if file : conf . readfp ( file ) return conf confpath = None if ( not path ) : try : confpath = os . environ [ 'DULWICH_SWIFT_CFG' ] except KeyError : raise Exception ( 'You need to specify a configuration file' ) else : confpath = path if ( not os . path . isfile ( confpath ) ) : raise Exception ( ( 'Unable to read configuration file %s' % confpath ) ) conf . read ( confpath ) return conf
load configuration in global var conf .