Skip to content

Commit aa00e70

Browse files
committed
hardcopy=None works
Previously it had to be omitted
1 parent 87f9a91 commit aa00e70

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

gnuplotlib.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,10 +999,15 @@ def __str__(self): return self.err
999999

10001000
def _data_dump_only(processOptions):
10011001
'''Returns True if we're dumping a script, NOT actually running gnuplot'''
1002+
def is_gp():
1003+
h = processOptions.get('hardcopy')
1004+
return \
1005+
type(h) is str and \
1006+
re.match(".*\.gp$", h)
10021007
return \
10031008
processOptions.get('dump') or \
10041009
processOptions.get('terminal') == 'gp' or \
1005-
re.match(".*\.gp$",processOptions.get('hardcopy',''))
1010+
is_gp()
10061011

10071012
def split_dict(d, *keysets):
10081013
r'''Given a dict and some sets of keys, split into sub-dicts with keys
@@ -1065,7 +1070,7 @@ def massageProcessOptionsAndGetCmds(processOptions):
10651070

10661071
# handle 'hardcopy'. This simply ties in to 'output' and 'terminal', handled
10671072
# later
1068-
if 'hardcopy' in processOptions:
1073+
if processOptions.get('hardcopy') is not None:
10691074
# 'hardcopy' is simply a shorthand for 'terminal' and 'output', so they
10701075
# can't exist together
10711076
if 'terminal' in processOptions or 'output' in processOptions:

0 commit comments

Comments
 (0)