MCPcopy Create free account
hub / github.com/RUB-NDS/PRET / do_known

Method do_known

postscript.py:862–878  ·  view source on GitHub ↗

List supported PostScript operators: known

(self, arg)

Source from the content-addressed store, hash-verified

860
861 # ------------------------[ known <operator> ]-------------------------
862 def do_known(self, arg):
863 "List supported PostScript operators: known <operator>"
864 if arg:
865 functionlist = {'User-supplied Operators': arg.split()}
866 else:
867 functionlist = operators.oplist
868
869# may want to find unknown ops using: systemdict {dup type /operatortype eq {exch == pop}{pop pop} ifelse} forall
870
871 # ask interpreter if functions are known to systemdict
872 for desc, funcs in sorted(functionlist.items()):
873 output().chitchat(desc)
874 commands = ['(' + func + ': ) print systemdict /'
875 + func + ' known ==' for func in funcs]
876 str_recv = self.cmd(c.EOL.join(commands), False)
877 for line in str_recv.splitlines():
878 output().green(line) if " true" in line else output().warning(line)
879
880 # ------------------------[ search <key> ]----------------------------
881 def do_search(self, arg):

Callers

nothing calls this directly

Calls 5

cmdMethod · 0.95
outputClass · 0.90
greenMethod · 0.80
warningMethod · 0.80
chitchatMethod · 0.45

Tested by

no test coverage detected