Ejemplo n.º 1
0
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")
	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;
		preferences.setPreferencesDirectoryPath(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")
		else:
			preferences.addPreferenceOverride("Raft", "Activate Raft:", "false")
			preferences.addPreferenceOverride("Raftless", "Activate Raftless:", "true")
		
	if options.preferences:
		for prefSpec in options.preferences:
			(moduleName,prefSpec) = prefSpec.split(":",1)
			(prefName,valueName) = prefSpec.split("=",1)
			preferences.addPreferenceOverride(moduleName,prefName,valueName)

	sys.argv = [sys.argv[0]] + args
	if len( args ) > 0:
		writeOutput( ' '.join(args) )
	else:
		preferences.displayDialog( SkeinforgePreferences() )
Ejemplo n.º 2
0
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("--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;
		preferences.setPreferencesDirectoryPath(pdir)
	if options.startFile:
		preferences.setStartFile(options.startFile)
	else:
		preferences.setStartFile(defaultStart)
	if options.endFile:
		preferences.setEndFile(options.endFile)
	else:
		preferences.setEndFile(defaultEnd)

        preferences.addPreferenceOverride("Skeinview", "Activate Skeinview", "False")
        preferences.addPreferenceOverride("Behold", "Activate Behold", "False")

	if options.useRaft != None:
		if options.useRaft:
			preferences.addPreferenceOverride("Raft", "Activate Raft:", "true")
			preferences.addPreferenceOverride("Raftless", "Activate Raftless:", "false")
		else:
			preferences.addPreferenceOverride("Raft", "Activate Raft:", "false")
			preferences.addPreferenceOverride("Raftless", "Activate Raftless:", "true")
		
		

	sys.argv = [sys.argv[0]] + args
	if len( args ) > 0:
		writeOutput( ' '.join(args) )
	else:
		preferences.displayDialog( SkeinforgePreferences() )
Ejemplo n.º 3
0
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("--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;
		preferences.setPreferencesDirectoryPath(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")
		else:
			preferences.addPreferenceOverride("Raft", "Activate Raft:", "false")
			preferences.addPreferenceOverride("Raftless", "Activate Raftless:", "true")
		
		

	sys.argv = [sys.argv[0]] + args
	if len( args ) > 0:
		writeOutput( ' '.join(args) )
	else:
		preferences.displayDialog( SkeinforgePreferences() )
Ejemplo n.º 4
0
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")
    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
        preferences.setPreferencesDirectoryPath(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")
        else:
            preferences.addPreferenceOverride("Raft", "Activate Raft:",
                                              "false")
            preferences.addPreferenceOverride("Raftless", "Activate Raftless:",
                                              "true")

    if options.preferences:
        for prefSpec in options.preferences:
            (moduleName, prefSpec) = prefSpec.split(":", 1)
            (prefName, valueName) = prefSpec.split("=", 1)
            preferences.addPreferenceOverride(moduleName, prefName, valueName)

    sys.argv = [sys.argv[0]] + args
    if len(args) > 0:
        writeOutput(' '.join(args))
    else:
        preferences.displayDialog(SkeinforgePreferences())