def loadProfile(filename, allMachines=False):
 global settingsList
 profileParser = ConfigParser.ConfigParser()
 try:
  profileParser.read(filename)
 except ConfigParser.ParsingError:
  return
 if allMachines:
  n = 0
  while profileParser.has_section(('profile_%d' % n)):
   for set in settingsList:
    if set.isPreference():
     continue
    section = ('profile_%d' % n)
    if set.isAlteration():
     section = ('alterations_%d' % n)
    if profileParser.has_option(section, set.getName()):
     set.setValue(unicode(profileParser.get(section, set.getName()), 'utf-8', 'replace'), n)
   n += 1
 else:
  for set in settingsList:
   if set.isPreference():
    continue
   section = 'profile'
   if set.isAlteration():
    section = 'alterations'
   if profileParser.has_option(section, set.getName()):
    set.setValue(unicode(profileParser.get(section, set.getName()), 'utf-8', 'replace'))
 if (getProfileSetting('retraction_combing') == '1'):
  putProfileSetting('retraction_combing', 'All')

def loadProfile ( filename , allMachines = False ) : global settingsList profileParser = ConfigParser . ConfigParser ( ) try : profileParser . read ( filename ) except ConfigParser . ParsingError : return if allMachines : n = 0 while profileParser . has_section ( ( 'profile_%d' % n ) ) : for set in settingsList : if set . isPreference ( ) : continue section = ( 'profile_%d' % n ) if set . isAlteration ( ) : section = ( 'alterations_%d' % n ) if profileParser . has_option ( section , set . getName ( ) ) : set . setValue ( unicode ( profileParser . get ( section , set . getName ( ) ) , 'utf-8' , 'replace' ) , n ) n += 1 else : for set in settingsList : if set . isPreference ( ) : continue section = 'profile' if set . isAlteration ( ) : section = 'alterations' if profileParser . has_option ( section , set . getName ( ) ) : set . setValue ( unicode ( profileParser . get ( section , set . getName ( ) ) , 'utf-8' , 'replace' ) ) if ( getProfileSetting ( 'retraction_combing' ) == '1' ) : putProfileSetting ( 'retraction_combing' , 'All' )
read a profile file as active profile settings .