Changeset 1972 for pykota

Show
Ignore:
Timestamp:
12/03/04 21:29:33 (20 years ago)
Author:
jalet
Message:

ipp.py can now be run in standalone mode for testing purposes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/ipp.py

    r1901 r1972  
    2222# 
    2323# $Log$ 
     24# Revision 1.2  2004/12/03 20:29:33  jalet 
     25# ipp.py can now be run in standalone mode for testing purposes 
     26# 
    2427# Revision 1.1  2004/11/06 22:35:58  jalet 
    2528# Added a miniparser for IPP messages (RFC 2910). The job-originating-host-name 
     
    174177            raise PyKotaIPPError, "Unexpected end of IPP message." 
    175178             
     179if __name__ == "__main__" :             
     180    if len(sys.argv) < 2 : 
     181        print "usage : python ipp.py /var/spool/cups/c00005 (for example)\n" 
     182    else :     
     183        infile = open(sys.argv[1]) 
     184        message = IPPMessage(infile.read()) 
     185        infile.close() 
     186        print "Client hostname : %s" % message["job-originating-host-name"]