41 | | answerfd.close() |
42 | | if answer.startswith("[/") and answer.endswith("]") : |
43 | | devices = [ dev[1:] for dev in answer[1:-1].split() \ |
44 | | if dev.startswith("/") \ |
45 | | and (not dev.startswith("/x11")) \ |
46 | | and (not dev == "/ijs") \ |
47 | | and (not dev == "/nullpage") \ |
48 | | and (not dev == "/bbox") ] |
49 | | devices.sort() |
50 | | return devices |
51 | | else : |
52 | | return [] |
| 41 | if not answerfd.close() : |
| 42 | if answer.startswith("[/") and answer.endswith("]") : |
| 43 | devices = [ dev[1:] for dev in answer[1:-1].split() \ |
| 44 | if dev.startswith("/") \ |
| 45 | and (not dev.startswith("/x11")) \ |
| 46 | and (not dev == "/ijs") \ |
| 47 | and (not dev == "/nullpage") \ |
| 48 | and (not dev == "/bbox") ] |
| 49 | devices.sort() |
| 50 | return devices |
| 51 | return [] |
54 | | def genTestSuite(infilename, root) : |
55 | | """Generate the testsuite.""" |
56 | | for device in getAvailableDevices() : |
| 53 | def getAvailableIJSPrintClasses() : |
| 54 | """Returns a list of available IJS Print Classes. |
| 55 | |
| 56 | Currently the list is a static one and doesn't contain all the available print classes. |
| 57 | """ |
| 58 | return [ "DJ3600", "DJ3320", "DJ9xx", "DJGenericVIP", "LJColor", |
| 59 | "DJ850", "DJ890", "DJ9xxVIP", "DJ8xx", "DJ540", "DJ660", |
| 60 | "DJ6xx", "DJ350", "DJ6xxPhoto", "DJ630", "DJ8x5", "DJ4100", |
| 61 | "AP21xx", "AP2560", "AP2xxx", "PSP100", "PSP470", "Undefined", |
| 62 | "Postscript", "LJJetReady", "LJMono", "LJFastRaster", |
| 63 | "LJZjsMono", ] |
| 64 | |
| 65 | def batchGeneration(infilename, devices, root, command) : |
| 66 | """Loops over a set of devices calling a particular command.""" |
| 67 | for device in devices : |
| 79 | |
| 80 | def genTestSuite(infilename, root) : |
| 81 | """Generate the testsuite.""" |
| 82 | batchGeneration(infilename, getAvailableDevices(), |
| 83 | root, |
| 84 | 'gs -dQUIET -dBATCH -dNOPAUSE -dPARANOIDSAFER -sOutputFile="%(outfilename)s" -sDEVICE="%(device)s" "%(infilename)s"') |
| 85 | |
| 86 | batchGeneration(infilename, getAvailableIJSPrintClasses(), |
| 87 | "%(root)s.hpijs" % locals(), |
| 88 | 'gs -dBATCH -dQUIET -dPARANOIDSAFER -dNOPAUSE -sDEVICE=ijs -sIjsServer=hpijs -dIjsUseOutputFD -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="%(device)s" -sOutputFile="%(outfilename)s" "%(infilename)s"') |