def test(self): tpl = parse_literals("0 0 596 842", "iiii") self.assertEqual(tpl, (0, 0, 596, 842,)) tpl = parse_literals("procset Adobe_AGM_Utils 1.0 0", "ssff") self.assertEqual(tpl, ('procset', 'Adobe_AGM_Utils', 1.0, 0.0,)) tpl = parse_literals("Copyright (C) 1997-2003 Adobe Systems, Inc. All Rights Reserved.", "l") self.assertEqual(tpl, ("Copyright (C) 1997-2003 Adobe Systems, Inc. All Rights Reserved.", ))
def from_string(cls, s): """ Initialize from a PostScript (DSC) string using the dsc.parse_literal() function. """ from psg.document import dsc tpl = dsc.parse_literals(s, "ffff") return cls.from_tuple(tpl)