32 | | printername = os.environ.get("PYKOTAPRINTERNAME") |
33 | | username = os.environ.get("PYKOTAUSERNAME") |
34 | | jobid = os.environ.get("PYKOTAJOBID") |
35 | | jobtitle = os.environ.get("PYKOTATITLE") |
36 | | jobsize = os.environ.get("PYKOTAPRECOMPUTEDJOBSIZE") |
37 | | try : |
38 | | server = xmlrpclib.ServerProxy("http://%s:%s" % (arguments[0], arguments[1])) |
39 | | result = server.openConfirmDialog(printername, username, jobid, jobtitle, jobsize) |
40 | | except : |
41 | | sys.stderr.write("An error occured !\n") |
42 | | if result != "OK" : |
| 32 | printername = os.environ.get("PYKOTAPRINTERNAME", "Unknown") |
| 33 | username = os.environ.get("PYKOTAUSERNAME", "Unknown") |
| 34 | jobid = os.environ.get("PYKOTAJOBID", "Unknown") |
| 35 | jobtitle = os.environ.get("PYKOTATITLE", "Unknown") |
| 36 | jobsize = os.environ.get("PYKOTAPRECOMPUTEDJOBSIZE", "Unknown") |
| 37 | |
| 38 | if len(arguments) < 3 : |
| 39 | message = """Hello %(username)s, |
| 40 | |
| 41 | You sent job %(jobid)s (%(jobtitle)s) to printer %(printername)s. |
| 42 | |
| 43 | This job seems to be %(jobsize)s pages long. |
| 44 | |
| 45 | Do you really want to print it ?""" % locals() |
| 46 | yesno = True |
| 47 | else : |
| 48 | message = "\n".join(arguments[2:]) |
| 49 | yesno = False |
| 50 | |
| 51 | server = xmlrpclib.ServerProxy("http://%s:%s" % (arguments[0], arguments[1])) |
| 52 | result = server.showDialog(message, yesno) |
| 53 | if yesno and (result != "OK") : |