def reload_constraints():
 global SWIFT_CONSTRAINTS_LOADED, OVERRIDE_CONSTRAINTS
 SWIFT_CONSTRAINTS_LOADED = False
 OVERRIDE_CONSTRAINTS = {}
 constraints_conf = ConfigParser()
 if constraints_conf.read(utils.SWIFT_CONF_FILE):
  SWIFT_CONSTRAINTS_LOADED = True
  for name in DEFAULT_CONSTRAINTS:
   try:
    value = constraints_conf.get('swift-constraints', name)
   except NoOptionError:
    pass
   except NoSectionError:
    break
   else:
    try:
     value = int(value)
    except ValueError:
     value = utils.list_from_csv(value)
    OVERRIDE_CONSTRAINTS[name] = value
 for (name, default) in DEFAULT_CONSTRAINTS.items():
  value = OVERRIDE_CONSTRAINTS.get(name, default)
  EFFECTIVE_CONSTRAINTS[name] = value
  globals()[name.upper()] = value

def reload_constraints ( ) : global SWIFT_CONSTRAINTS_LOADED , OVERRIDE_CONSTRAINTS SWIFT_CONSTRAINTS_LOADED = False OVERRIDE_CONSTRAINTS = { } constraints_conf = ConfigParser ( ) if constraints_conf . read ( utils . SWIFT_CONF_FILE ) : SWIFT_CONSTRAINTS_LOADED = True for name in DEFAULT_CONSTRAINTS : try : value = constraints_conf . get ( 'swift-constraints' , name ) except NoOptionError : pass except NoSectionError : break else : try : value = int ( value ) except ValueError : value = utils . list_from_csv ( value ) OVERRIDE_CONSTRAINTS [ name ] = value for ( name , default ) in DEFAULT_CONSTRAINTS . items ( ) : value = OVERRIDE_CONSTRAINTS . get ( name , default ) EFFECTIVE_CONSTRAINTS [ name ] = value globals ( ) [ name . upper ( ) ] = value
parse swift_conf_file and reset module level global constraint attrs .