Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0
This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
laydi/bin/fluents

63 lines
1.4 KiB
Plaintext
Raw Normal View History

#!/usr/bin/python2.4
from getopt import getopt
import sys
from fluents import fluents, project, workflow
import workflows
2007-02-27 17:08:22 +01:00
import cfgparse, optparse
PROGRAM_NAME = 'fluents'
VERSION = '0.1.0'
def list_workflows():
2007-02-27 17:25:48 +01:00
print 'fluents %s' % VERSION
print
2007-02-27 17:25:48 +01:00
print 'Available workflows:'
wfs = workflow.workflow_list()
2006-04-25 14:36:38 +02:00
for wf in wfs:
print ' %s (%s)' % (wf.ident, wf.name)
print
def parse_options():
2007-02-27 17:08:22 +01:00
cp = cfgparse.ConfigParser()
op = optparse.OptionParser()
2007-02-27 17:08:22 +01:00
op.add_option('-l', '--list-workflows',
action='store_true',
default=False,
help='List available workflows.')
2007-02-27 17:08:22 +01:00
op.add_option('-w', '--workflow',
default='emptyview',
help='Start with selected workflow')
2007-02-27 17:08:22 +01:00
return cp.parse(op)
if __name__ == '__main__':
2007-02-27 17:08:22 +01:00
options, params = parse_options()
2007-02-27 17:08:22 +01:00
if options.list_workflows:
list_workflows()
sys.exit(0)
import gtk
import gnome
gnome.program_init(PROGRAM_NAME, VERSION)
2007-02-27 17:08:22 +01:00
selected_wf = workflow.EmptyWorkflow
workflow_list = workflow.workflow_list()
for wf in workflow_list:
if wf.ident == options.workflow:
selected_wf = wf
app = fluents.FluentApp(selected_wf)
fluents.app = app
2007-02-27 17:08:22 +01:00
app.set_project(project.Project())
app.show()
gtk.main()
2007-02-27 17:08:22 +01:00