Default viewer is read from the configuration file
authorDmitriy Morozov <dmitriy@mrzv.org>
Fri, 05 Sep 2008 15:57:47 -0700
changeset 15 73c27c2afa65
parent 14 53e32c952ebd
child 16 eccbe49587f2
Default viewer is read from the configuration file
alexandria.py
--- a/alexandria.py	Wed Sep 03 14:25:49 2008 -0700
+++ b/alexandria.py	Fri Sep 05 15:57:47 2008 -0700
@@ -16,7 +16,6 @@
          'hash':    term.RED + term.BOLD,
          'error':   term.RED + term.BOLD,
          'normal':  term.NORMAL}
-default_viewer = '/usr/bin/evince'
 
 def find_database(starting_path = None):
     if not starting_path: starting_path = '.'
@@ -303,6 +302,11 @@
     config.read([os.path.expanduser('~/.alexandria')])
     dbpath = os.path.expanduser(config.get('paths', 'dbpath'))
     commonpath = os.path.expanduser(config.get('paths', 'common'))
+    
+    try:
+        default_viewer = config.get('setup', 'viewer')
+    except:
+        default_viewer = 'acroread'
 
     # Parse options
     parser = OptionParser(usage = usage, add_help_option = False)