Ejemplo n.º 1
0
 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) + ')')
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
 def getProfileNames(self):
     return settings.getFolders(archive.getProfilesPath('extrusion'))