def saveSetting(self, repo, name, oldValue, newValue):
     repoSettingsFilename = os.path.join(archive.getProfilesPath() , settings.getProfileBaseName(repo))
     if (type(oldValue).__name__ == 'float'):
         newValue = '{0:g}'.format(float(newValue))
     for line in fileinput.FileInput(repoSettingsFilename, inplace=1):
         if line.startswith(name + "\t"):
             line = "{0}\t{1}\n".format(name, str(newValue))
         sys.stdout.write(line)
     print('Saved: ' + name + ' = ' + str(newValue) + ' (was: ' + str(oldValue) + ')')
    def setActiveProfileName(self, newProfileName):
        ap = self.getActiveProfileName()

        extrusionRepository = extrusion.getNewRepository()
        extrusionSettingsFilename = os.path.join(archive.getProfilesPath() , settings.getProfileBaseName(extrusionRepository))
        for line in fileinput.FileInput(extrusionSettingsFilename, inplace=1):
            if "Profile Selection:\t"+ap in line:
                line = line.replace(ap, newProfileName)
            sys.stdout.write(line)
        print "Skeinforge Profile is " + newProfileName