Changeset 3103 for pykota/trunk

Show
Ignore:
Timestamp:
12/01/06 23:14:47 (18 years ago)
Author:
jerome
Message:

Simplified the import of printers.
Linked to pkpgcounter v2.12.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pksetup

    r3085 r3103  
    197197         
    198198    otherpackages = [ { "name" : "pkpgcounter", 
    199                         "version" : "2.10", 
     199                        "version" : "2.12", 
    200200                        "url" : "http://www.pykota.com/software/%(name)s/download/tarballs/%(name)s-%(version)s.tar.gz", 
    201201                        "commands" : [ "tar -zxf %(name)s-%(version)s.tar.gz", 
     
    349349                self.confirmCommand("to improve PyKota's configuration wrt your existing printers", 'echo "%(suffix)s" >>%(home)s/pykota.conf' % locals()) 
    350350         
    351     def importPrinters(self) : 
    352         """Imports the existing print queues in the database.""" 
    353         self.confirmCommand("to import your existing print queues into PyKota's database", "pkturnkey --force 2>/dev/null") 
    354              
    355351    def addPyKotaUser(self) : 
    356352        """Adds a system user named pykota, returns its home directory or None""" 
     
    378374        """For each printer, asks if it should be managed with PyKota or not.""" 
    379375        for (queuename, deviceuri) in printers : 
    380             if not deviceuri.startswith("cupspykota:") : 
    381                 newdeviceuri = "cupspykota://%s" % deviceuri 
    382                 command = "lpadmin -p %(queuename)s -v %(newdeviceuri)s" % locals() 
    383                 self.confirmCommand("to manage the %(queuename)s print queue with PyKota" % locals(), command) 
     376            command = 'pkprinters --add --cups --description "Printer created with pksetup" "%(queuename)s"' % locals() 
     377            self.confirmCommand("to import the %(queuename)s print queue into PyKota's database and reroute it through PyKota" % locals(), command) 
    384378     
    385379    def setup(self) : 
     
    402396            self.setupBackend() 
    403397            self.managePrinters(self.listPrinters()) 
    404             self.importPrinters() 
    405398            print nowready 
    406399            print "The script %s can be used to reinstall in unattended mode.\n" % self.genInstaller()