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

Method do_pagecount

pjl.py:446–464  ·  view source on GitHub ↗

Manipulate printer's page counter: pagecount

(self, arg)

Source from the content-addressed store, hash-verified

444
445 # ------------------------[ pagecount <number> ]----------------------
446 def do_pagecount(self, arg):
447 "Manipulate printer's page counter: pagecount <number>"
448 if not arg:
449 output().raw("Hardware page counter: ", "")
450 self.onecmd("info pagecount")
451 else:
452 output().raw("Old page counter: ", "")
453 self.onecmd("info pagecount")
454 # set page counter for older HP LaserJets
455 # self.cmd('@PJL SET SERVICEMODE=HPBOISEID' + c.EOL
456 # + '@PJL DEFAULT OEM=ON' + c.EOL
457 # + '@PJL DEFAULT PAGES=' + arg + c.EOL
458 # + '@PJL DEFAULT PRINTPAGECOUNT=' + arg + c.EOL
459 # + '@PJL DEFAULT SCANPAGECOUNT=' + arg + c.EOL
460 # + '@PJL DEFAULT COPYPAGECOUNT=' + arg + c.EOL
461 # + '@PJL SET SERVICEMODE=EXIT', False)
462 self.do_set("PAGES=" + arg, False)
463 output().raw("New page counter: ", "")
464 self.onecmd("info pagecount")
465
466 # ====================================================================
467

Callers

nothing calls this directly

Calls 4

do_setMethod · 0.95
outputClass · 0.90
rawMethod · 0.80
onecmdMethod · 0.80

Tested by

no test coverage detected