def main(): "Display the skeinforge dialog." parser = OptionParser() parser.add_option("-p", "--prefdir", help="set path to preference directory", action="store", type="string", dest="preferencesDirectory") parser.add_option("-s", "--start", help="set start file to use", action="store", type="string", dest="startFile") parser.add_option("-e", "--end", help="set end file to use", action="store", type="string", dest="endFile") parser.add_option("-o", "--option", help='set an individual option in the format "module:preference=value"', action="append", type="string", dest="preferences") (options, args) = parser.parse_args() defaultStart = 'start.txt' defaultEnd = 'end.txt' if options.preferencesDirectory: pdir = options.preferencesDirectory; archive.setSettingsPath(pdir) if options.preferences: for prefSpec in options.preferences: (moduleName,prefSpec) = prefSpec.split(":",1) (prefName,valueName) = prefSpec.split("=",1) settings.addPreferenceOverride(moduleName,prefName,valueName) sys.argv = [sys.argv[0]] + args if len( args ) > 0: writeOutput( ' '.join(args) ) else: settings.startMainLoopFromConstructor( getNewRepository() )
def main(): "Display the skeinforge dialog." # if len(sys.argv) > 1: # writeOutput(' '.join(sys.argv[1 :])) parser = OptionParser() parser.add_option("-p", "--prefdir", help="set path to preference directory", action="store", type="string", dest="preferencesDirectory") parser.add_option("-s", "--start", help="set start file to use", action="store", type="string", dest="startFile") parser.add_option("-e", "--end", help="set end file to use", action="store", type="string", dest="endFile") parser.add_option("--raft", action="store_true", dest="useRaft") parser.add_option("--no-raft", action="store_false", dest="useRaft") (options, args) = parser.parse_args() defaultStart = 'start.txt' defaultEnd = 'end.txt' if options.preferencesDirectory: pdir = options.preferencesDirectory archive.setSettingsPath(pdir) # if options.startFile: # preferences.setStartFile(options.startFile) # else: # preferences.setStartFile(defaultStart) # if options.endFile: # preferences.setEndFile(options.endFile) # else: # preferences.setEndFile(defaultEnd) if options.useRaft != None: if options.useRaft: # preferences.addPreferenceOverride("Raft", "Activate Raft:", "true") # preferences.addPreferenceOverride("Raftless", "Activate Raftless:", "false") settings.addPreferenceOverride("raft.csv", "Activate Raft", "true") else: # preferences.addPreferenceOverride("Raft", "Activate Raft:", "false") # preferences.addPreferenceOverride("Raftless", "Activate Raftless:", "true") settings.addPreferenceOverride("raft.csv", "Activate Raft", "false") sys.argv = [sys.argv[0]] + args if len(args) > 0: writeOutput(' '.join(args)) else: settings.startMainLoopFromConstructor(getNewRepository())
def main(): "Display the skeinforge dialog." parser = OptionParser() parser.add_option("-p", "--prefdir", help="set path to preference directory", action="store", type="string", dest="preferencesDirectory") parser.add_option("-s", "--start", help="set start file to use", action="store", type="string", dest="startFile") parser.add_option("-e", "--end", help="set end file to use", action="store", type="string", dest="endFile") parser.add_option( "-o", "--option", help='set an individual option in the format "module:preference=value"', action="append", type="string", dest="preferences") (options, args) = parser.parse_args() defaultStart = 'start.txt' defaultEnd = 'end.txt' if options.preferencesDirectory: pdir = options.preferencesDirectory archive.setSettingsPath(pdir) # if options.startFile: # preferences.setStartFile(options.startFile) # else: # preferences.setStartFile(defaultStart) # if options.endFile: # preferences.setEndFile(options.endFile) # else: # preferences.setEndFile(defaultEnd) if options.preferences: for prefSpec in options.preferences: (moduleName, prefSpec) = prefSpec.split(":", 1) (prefName, valueName) = prefSpec.split("=", 1) settings.addPreferenceOverride(moduleName, prefName, valueName) sys.argv = [sys.argv[0]] + args if len(args) > 0: writeOutput(' '.join(args)) else: settings.startMainLoopFromConstructor(getNewRepository())
def main(): "Display the skeinforge dialog." # if len(sys.argv) > 1: # writeOutput(' '.join(sys.argv[1 :])) parser = OptionParser() parser.add_option("-p", "--prefdir", help="set path to preference directory", action="store", type="string", dest="preferencesDirectory") parser.add_option("-s", "--start", help="set start file to use", action="store", type="string", dest="startFile") parser.add_option("-e", "--end", help="set end file to use", action="store", type="string", dest="endFile") parser.add_option("--raft", action="store_true", dest="useRaft") parser.add_option("--no-raft", action="store_false", dest="useRaft") (options, args) = parser.parse_args() defaultStart = 'start.txt' defaultEnd = 'end.txt' if options.preferencesDirectory: pdir = options.preferencesDirectory; archive.setSettingsPath(pdir) # if options.startFile: # preferences.setStartFile(options.startFile) # else: # preferences.setStartFile(defaultStart) # if options.endFile: # preferences.setEndFile(options.endFile) # else: # preferences.setEndFile(defaultEnd) if options.useRaft != None: if options.useRaft: # preferences.addPreferenceOverride("Raft", "Activate Raft:", "true") # preferences.addPreferenceOverride("Raftless", "Activate Raftless:", "false") settings.addPreferenceOverride("raft.csv", "Activate Raft", "true") else: # preferences.addPreferenceOverride("Raft", "Activate Raft:", "false") # preferences.addPreferenceOverride("Raftless", "Activate Raftless:", "true") settings.addPreferenceOverride("raft.csv", "Activate Raft", "false") sys.argv = [sys.argv[0]] + args if len( args ) > 0: writeOutput( ' '.join(args) ) else: settings.startMainLoopFromConstructor( getNewRepository() )