Changed the way workflows are handled. You now specify a workflow by naming the
containing python module. The module must be in python's path.
This commit is contained in:
parent
0e8d864ace
commit
ba7d8fc34f
26
bin/fluents
26
bin/fluents
|
@ -4,7 +4,7 @@ from getopt import getopt
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from fluents import fluents, project, workflow, main
|
from fluents import fluents, project, workflow, main
|
||||||
import workflows
|
#import workflows
|
||||||
import cfgparse, optparse
|
import cfgparse, optparse
|
||||||
|
|
||||||
PROGRAM_NAME = 'fluents'
|
PROGRAM_NAME = 'fluents'
|
||||||
|
@ -50,24 +50,26 @@ def parse_options():
|
||||||
return cp.parse(op)
|
return cp.parse(op)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
import gtk
|
||||||
|
import gnome
|
||||||
|
|
||||||
|
foo = gnome.program_init(PROGRAM_NAME, VERSION)
|
||||||
|
print foo
|
||||||
|
|
||||||
options, params = parse_options()
|
options, params = parse_options()
|
||||||
|
|
||||||
if options.list_workflows:
|
if options.list_workflows:
|
||||||
list_workflows()
|
list_workflows()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
import gtk
|
selected_wf = workflow.find_workflow(options.workflow)
|
||||||
import gnome
|
print selected_wf
|
||||||
|
if selected_wf == None: selected_wf = workflow.EmptyWorkflow
|
||||||
gnome.program_init(PROGRAM_NAME, VERSION)
|
|
||||||
|
|
||||||
selected_wf = workflow.EmptyWorkflow
|
|
||||||
|
|
||||||
workflow_list = workflow.workflow_list()
|
|
||||||
for wf in workflow_list:
|
|
||||||
if wf.ident == options.workflow:
|
|
||||||
selected_wf = wf
|
|
||||||
|
|
||||||
|
# workflow_list = workflow.workflow_list()
|
||||||
|
# for wf in workflow_list:
|
||||||
|
# if wf.ident == options.workflow:
|
||||||
|
# selected_wf = wf
|
||||||
|
|
||||||
main.set_workflow(selected_wf())
|
main.set_workflow(selected_wf())
|
||||||
main.set_options(options)
|
main.set_options(options)
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
## To be able to run fluents without installing it, we have to set
|
## To be able to run fluents without installing it, we have to set
|
||||||
## PYTHONPATH.
|
## PYTHONPATH.
|
||||||
|
|
||||||
export PYTHONPATH=$PYTHONPATH:.
|
export PYTHONPATH=$PYTHONPATH:.:./workflows
|
||||||
./bin/fluents $@
|
./bin/fluents $@
|
||||||
|
|
||||||
|
|
Reference in New Issue