diff --git a/bin/fluents b/bin/fluents index 6b21f3f..bccb995 100755 --- a/bin/fluents +++ b/bin/fluents @@ -1,6 +1,7 @@ #!/usr/bin/python2.4 from getopt import getopt +import os import sys from fluents import fluents, project, workflow import workflows @@ -20,7 +21,17 @@ def list_workflows(): print def parse_options(): + conf_files = ['/etc/fluentsrc', + os.path.join(os.environ['HOME'], '.fluents')] + cp = cfgparse.ConfigParser() + + cp.add_option('home', type='string', + default=os.environ['HOME']) + + cp.add_option('datadir', type='string', + default=os.environ['HOME']) + cp.parse() op = optparse.OptionParser() op.add_option('-l', '--list-workflows', @@ -32,6 +43,10 @@ def parse_options(): default='emptyview', help='Start with selected workflow') + for cf in conf_files: + if os.path.isfile(cf): + cp.add_file(cf) + return cp.parse(op) if __name__ == '__main__': @@ -54,6 +69,7 @@ if __name__ == '__main__': selected_wf = wf app = fluents.FluentApp(selected_wf) + app.options = options fluents.app = app app.set_project(project.Project())