def saveProfileDifferenceFromDefault(filename):
 global settingsList
 profileParser = ConfigParser.ConfigParser()
 profileParser.add_section('profile')
 for set in settingsList:
  if (set.isPreference() or set.isMachineSetting() or set.isAlteration()):
   continue
  if (set.getDefault() == set.getValue()):
   continue
  profileParser.set('profile', set.getName(), set.getValue().encode('utf-8'))
 try:
  profileParser.write(open(filename, 'w'))
 except:
  print ('Failed to write profile file: %s' % filename)

def saveProfileDifferenceFromDefault ( filename ) : global settingsList profileParser = ConfigParser . ConfigParser ( ) profileParser . add_section ( 'profile' ) for set in settingsList : if ( set . isPreference ( ) or set . isMachineSetting ( ) or set . isAlteration ( ) ) : continue if ( set . getDefault ( ) == set . getValue ( ) ) : continue profileParser . set ( 'profile' , set . getName ( ) , set . getValue ( ) . encode ( 'utf-8' ) ) try : profileParser . write ( open ( filename , 'w' ) ) except : print ( 'Failed to write profile file: %s' % filename )
save the current profile to an ini file .