changeset 690:5e8d3f68a997

shlex
author Jeff Hammel <k0scist@gmail.com>
date Mon, 02 Jun 2014 12:38:40 -0700
parents 34af6d5ac73c
children d586ea538d36
files python/gview.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/python/gview.py	Sat May 24 15:27:16 2014 -0700
+++ b/python/gview.py	Mon Jun 02 12:38:40 2014 -0700
@@ -10,6 +10,7 @@
 # imports
 import argparse
 import os
+import shlex
 import subprocess
 import sys
 import tempfile
@@ -28,7 +29,7 @@
         self.add_argument('-e', '--program', dest='program',
                           default='fdp',
                           help="GraphViz program to invoke [DEFAULT: %(default)s]")
-        self.add_argument('-v', '--view', dest='viewer', default='feh',
+        self.add_argument('-v', '--view', dest='viewer', default='feh -F',
                           help="viewer")
 
 
@@ -52,7 +53,8 @@
 
     try:
         if options.viewer:
-            subprocess.call([options.viewer, output])
+            viewer = shlex.split(options.viewer)
+            subprocess.call(viewer + [output])
     finally:
         if not options.output:
             os.remove(output)