List supported PostScript operators: known
(self, arg)
| 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): |