Ticket #384: lpr.debathena.diff

File lpr.debathena.diff, 672 bytes (added by mitchb, 13 years ago)

Patch to use the default queue set in cups before looking in hesiod

  • lpr.debathena

    old new  
    88# intended for should go to CUPS or LPRng and sends it off in the 
    99# right direction 
    1010 
     11import cups 
    1112import errno 
    1213import hesiod 
    1314import getopt 
     
    155156    if default: 
    156157        return (preference, default, args) 
    157158    try: 
     159        cupsdef = cups.Connection().getDefault() 
     160        if cupsdef: 
     161            return (preference, cupsdef, args) 
     162    except RuntimeError: 
     163        pass 
     164    try: 
    158165        h = hesiod.Lookup(os.uname()[1], 'cluster') 
    159166        for result in h.results: 
    160167            (key, value) = result.split(None, 1)