Changeset 1483 for pykota/trunk/bin

Show
Ignore:
Timestamp:
05/18/04 16:49:34 (21 years ago)
Author:
jalet
Message:

Big code changes to completely remove the need for "requester" directives,
jsut use "hardware(... your previous requester directive's content ...)"

Location:
pykota/trunk/bin
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1478 r1483  
    2424# 
    2525# $Log$ 
     26# Revision 1.44  2004/05/18 14:48:47  jalet 
     27# Big code changes to completely remove the need for "requester" directives, 
     28# jsut use "hardware(... your previous requester directive's content ...)" 
     29# 
    2630# Revision 1.43  2004/05/17 11:46:05  jalet 
    2731# First try at cupspykota's main loop rewrite 
     
    186190from pykota.storage import PyKotaStorageError 
    187191from pykota.accounter import PyKotaAccounterError 
    188 from pykota.requester import PyKotaRequesterError 
    189192     
    190193class PyKotaPopen4(popen2.Popen4) : 
     
    508511            kotabackend = PyKotaBackend()     
    509512            retcode = kotabackend.mainWork() 
    510         except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, PyKotaRequesterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
     513        except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
    511514            import traceback 
    512515            mm = [((f.endswith('\n') and f) or (f + '\n')) for f in traceback.format_exception(*sys.exc_info())] 
  • pykota/trunk/bin/pkhint

    r1475 r1483  
    2424# 
    2525# $Log$ 
     26# Revision 1.8  2004/05/18 14:48:47  jalet 
     27# Big code changes to completely remove the need for "requester" directives, 
     28# jsut use "hardware(... your previous requester directive's content ...)" 
     29# 
    2630# Revision 1.7  2004/05/13 13:59:27  jalet 
    2731# Code simplifications 
     
    214218                    snmpcommand = self.accepts(SNMPTESTS, hostname) 
    215219                    if snmpcommand is not None : 
    216                         accounter = "hardware" 
    217                         requester = 'external(/usr/share/pykota/waitprinter.sh %(printer)s && ' + snmpcommand + ')' 
    218                         configuration.append((printer, accounter, requester)) 
     220                        accounter = 'hardware(/usr/share/pykota/waitprinter.sh %(printer)s && ' + snmpcommand + ')' 
     221                        configuration.append((printer, accounter)) 
    219222                    else :     
    220223                        netpjlcommand = self.accepts(NETPJLTESTS, hostname, port) 
    221224                        if netpjlcommand is not None : 
    222                             accounter = "hardware" 
    223                             requester = 'external(' + netpjlcommand + ')' 
    224                             configuration.append((printer, accounter, requester)) 
     225                            accounter = 'hardware(' + netpjlcommand + ')' 
     226                            configuration.append((printer, accounter)) 
    225227                elif devicetype == "direct" :  
    226228                    sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer)) 
     
    234236        else : 
    235237            print "\nPut the following lines into your /etc/pykota/pykota.conf file :\n" 
    236             for (printer, accounter, requester) in configuration : 
     238            for (printer, accounter) in configuration : 
    237239                print "[%s]" % printer 
    238240                print "accounter: %s" % accounter 
    239                 if requester is not None : 
    240                     print "requester: %s" % requester 
    241241                print     
    242242         
  • pykota/trunk/bin/pykota

    r1400 r1483  
    2424# 
    2525# $Log$ 
     26# Revision 1.58  2004/05/18 14:48:47  jalet 
     27# Big code changes to completely remove the need for "requester" directives, 
     28# jsut use "hardware(... your previous requester directive's content ...)" 
     29# 
    2630# Revision 1.57  2004/03/15 10:47:56  jalet 
    2731# This time the traceback formatting should be correct ! 
     
    233237from pykota.storage import PyKotaStorageError 
    234238from pykota.accounter import PyKotaAccounterError 
    235 from pykota.requester import PyKotaRequesterError 
    236239 
    237240class PyKotaFilter(PyKotaFilterOrBackend) :         
     
    359362        kotafilter = PyKotaFilter()     
    360363        retcode = kotafilter.mainWork() 
    361     except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, PyKotaRequesterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
     364    except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
    362365        import traceback 
    363366        mm = [((f.endswith('\n') and f) or (f + '\n')) for f in traceback.format_exception(*sys.exc_info())]