Changeset 5964
- Timestamp:
- 08/27/10 11:21:09 (1 year ago)
- Files:
-
- trunk/dabo/lib/reportUtils.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/lib/reportUtils.py
r5932 r5964 1 1 # -*- coding: utf-8 -*- 2 import datetime3 4 from decimal import Decimal5 2 import os 6 3 import sys 4 import subprocess 7 5 import tempfile 6 import datetime 7 from decimal import Decimal 8 8 9 9 … … 41 41 """Preview the passed PDF file in the default PDF viewer.""" 42 42 try: 43 # On Windows, use the default PDF viewer (probably Adobe Acrobat) 43 44 os.startfile(path) 44 45 except AttributeError: 45 # startfile only available on Windows46 # On Mac, use the default PDF viewer (probably Preview.app) 46 47 if sys.platform == "darwin": 47 48 os.system("open %s" % path) … … 61 62 62 63 if viewer: 63 if modal: 64 sysfunc = os.system 65 else: 66 sysfunc = os.popen2 67 sysfunc("%s '%s'" % (viewer, path)) 64 subprocess.call((viewer, path)) 68 65 69 66 … … 75 72 except AttributeError: 76 73 # startfile() only available on Windows 77 os.system("lpr %s" % path)74 subprocess.call(("lpr", path)) 78 75 79 76
