Changeset 98

Show
Ignore:
Timestamp:
01/27/06 13:09:53 (19 years ago)
Author:
jerome
Message:

The test program can now be used in the overwrite_jobticket directive
in pykota.conf, and the dialog WORKS !
It is now possible for an user to cancel or confirm the printing
of a job from a remote client. You need PyKota v1.24alpha8 for this
to work though...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykoticon/trunk/tests/test.py

    r93 r98  
    3030def main(arguments) : 
    3131    """Main function.""" 
    32     server = xmlrpclib.ServerProxy("http://%s:%s" % (arguments[0], arguments[1])) 
    33     server.nop() 
    34     print "Result : %s" % server.openConfirmDialog("HP2100", "jerome", "345", "this is the title", 5) 
    35     server.nop() 
    36     time.sleep(10) 
    37     server.quitApplication() 
    38      
     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" : 
     43        print result 
     44         
    3945if __name__ == "__main__" : 
    4046    if len(sys.argv) != 3 :