Changeset 1850 for pykota/trunk

Show
Ignore:
Timestamp:
10/20/04 00:24:00 (20 years ago)
Author:
jalet
Message:

Should fix the printer's hostname or IP address detection code.

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/NEWS

    r1848 r1850  
    2424    - 1.20alpha26 : 
    2525     
     26        - LPRng support code should now better detect network 
     27          printers' hostnames or IP addresses. 
     28           
    2629        - Fix for recently introduced bug in LPRng support. 
    2730         
  • pykota/trunk/pykota/tool.py

    r1849 r1850  
    2222# 
    2323# $Log$ 
     24# Revision 1.133  2004/10/19 22:24:00  jalet 
     25# Should fix the printer's hostname or IP address detection code. 
     26# 
    2427# Revision 1.132  2004/10/19 21:45:25  jalet 
    2528# Now correctly logs command line arguments 
     
    12371240                Kseen = 1       # we assume the user wants at least one copy... 
    12381241            if (rseen is None) and jseen and Pseen and nseen :     
    1239                 self.printInfo(_("Printer hostname undefined, set to 'localhost'"), "warn") 
    1240                 rseen = "localhost" 
     1242                lparg = [arg for arg in "".join(os.environ.get("PRINTCAP_ENTRY", "").split()).split(":") if arg.startswith("rm=") or arg.startswith("lp=")] 
     1243                try : 
     1244                    rseen = lparg[0].split("=")[-1].split("@")[-1].split("%")[0] 
     1245                except :     
     1246                    # Not found 
     1247                    self.printInfo(_("Printer hostname undefined, set to 'localhost'"), "warn") 
     1248                    rseen = "localhost" 
    12411249                 
    12421250            spooldir = os.environ.get("SPOOL_DIR", ".")