MCPcopy
hub / github.com/RUB-NDS/PRET / do_config

Method do_config

postscript.py:1086–1103  ·  view source on GitHub ↗
(self, arg)

Source from the content-addressed store, hash-verified

1084
1085 # ------------------------[ config <setting> ]------------------------
1086 def do_config(self, arg):
1087 arg = re.split("\s+", arg, 1)
1088 (arg, val) = tuple(arg) if len(arg) > 1 else (arg[0], None)
1089 if arg in list(self.options_config.keys()):
1090 key = self.options_config[arg]
1091 if arg == 'copies' and not val:
1092 return self.help_config()
1093 output().psonly()
1094 val = val or 'currentpagedevice /' + key + ' get not'
1095 output().info(self.globalcmd(
1096 'currentpagedevice /' + key + ' known\n'
1097 '{<< /' + key + ' ' + val + ' >> setpagedevice\n'
1098 '(' + key + ' ) print currentpagedevice /' + key + ' get\n'
1099 'dup type /integertype eq {(= ) print 8 string cvs print}\n'
1100 '{{(enabled)}{(disabled)} ifelse print} ifelse}\n'
1101 '{(Not available) print} ifelse'))
1102 else:
1103 self.help_config()
1104
1105 def help_config(self):
1106 print("Change printer settings: config <setting>")

Callers

nothing calls this directly

Calls 5

help_configMethod · 0.95
globalcmdMethod · 0.95
outputClass · 0.90
psonlyMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected