Changeset 2725

Show
Ignore:
Timestamp:
02/21/06 01:01:02 (18 years ago)
Author:
jerome
Message:

Doesn't list anymore entries which don't exist.

Location:
pykota/trunk/bin
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkbcodes

    r2723 r2725  
    131131            if options["list"] : 
    132132                for billingcode in billingcodes : 
    133                     print "%s [%s] %s %s %s %.2f %s" % \ 
     133                    if billingcode.Exists : 
     134                        print "%s [%s] %s %s %s %.2f %s" % \ 
    134135                          (billingcode.BillingCode, billingcode.Description, \ 
    135136                           billingcode.PageCounter, \ 
  • pykota/trunk/bin/pkprinters

    r2724 r2725  
    174174            if options["list"] : 
    175175                for printer in printers : 
    176                     parents = ", ".join([p.Name for p in self.storage.getParentPrinters(printer)]) 
    177                     if parents :  
    178                         parents = "%s %s" % (_("in"), parents) 
    179                     print "%s [%s] (%s + #*%s)" % \ 
    180                           (printer.Name, printer.Description, printer.PricePerJob, \ 
    181                            printer.PricePerPage) 
    182                     print "    %s" % (_("Passthrough mode : %s") % ((printer.PassThrough and _("ON")) or _("OFF"))) 
    183                     print "    %s" % (_("Maximum job size : %s") % ((printer.MaxJobSize and (_("%s pages") % printer.MaxJobSize)) or _("Unlimited"))) 
    184                     if parents :        
    185                         print "    %s" % parents 
    186                     print     
     176                    if printer.Exists : 
     177                        parents = ", ".join([p.Name for p in self.storage.getParentPrinters(printer)]) 
     178                        print "%s [%s] (%s + #*%s)" % \ 
     179                              (printer.Name, printer.Description, printer.PricePerJob, \ 
     180                               printer.PricePerPage) 
     181                        print "    %s" % (_("Passthrough mode : %s") % ((printer.PassThrough and _("ON")) or _("OFF"))) 
     182                        print "    %s" % (_("Maximum job size : %s") % ((printer.MaxJobSize and (_("%s pages") % printer.MaxJobSize)) or _("Unlimited"))) 
     183                        if parents :  
     184                            print "    %s %s" % (_("in"), parents) 
     185                        print     
    187186            else : 
    188187                self.display("%s...\n" % _("Modification")) 
  • pykota/trunk/bin/pkusers

    r2724 r2725  
    241241                    smtpserver = self.config.getSMTPServer() 
    242242                    for entry in entries : 
    243                         email = entry.Email 
    244                         if not email : 
    245                             if maildomain :      
    246                                 email = "%s@%s" % (entry.Name, maildomain) 
    247                             elif smtpserver :     
    248                                 email = "%s@%s" % (entry.Name, smtpserver) 
    249                             else :     
    250                                 email = "%s@%s" % (entry.Name, "localhost") 
    251                         msg = "%s - <%s>" % (entry.Name, email) 
    252                         if entry.Description : 
    253                             msg += " - %s" % entry.Description 
    254                         print msg     
    255                         print "    %s" % (_("Limited by : %s") % entry.LimitBy) 
    256                         print "    %s" % (_("Account balance : %.2f") % (entry.AccountBalance or 0.0)) 
    257                         print "    %s" % (_("Total paid so far : %.2f") % (entry.LifeTimePaid or 0.0)) 
    258                         print "    %s" % (_("Overcharging factor : %.2f") % entry.OverCharge) 
    259                         print 
     243                        if entry.Exists : 
     244                            email = entry.Email 
     245                            if not email : 
     246                                if maildomain :      
     247                                    email = "%s@%s" % (entry.Name, maildomain) 
     248                                elif smtpserver :     
     249                                    email = "%s@%s" % (entry.Name, smtpserver) 
     250                                else :     
     251                                    email = "%s@%s" % (entry.Name, "localhost") 
     252                            msg = "%s - <%s>" % (entry.Name, email) 
     253                            if entry.Description : 
     254                                msg += " - %s" % entry.Description 
     255                            print msg     
     256                            print "    %s" % (_("Limited by : %s") % entry.LimitBy) 
     257                            print "    %s" % (_("Account balance : %.2f") % (entry.AccountBalance or 0.0)) 
     258                            print "    %s" % (_("Total paid so far : %.2f") % (entry.LifeTimePaid or 0.0)) 
     259                            print "    %s" % (_("Overcharging factor : %.2f") % entry.OverCharge) 
     260                            print 
    260261                else :     
    261262                    for entry in entries : 
    262                         msg = "%s" % entry.Name 
    263                         if entry.Description : 
    264                             msg += " - %s" % entry.Description 
    265                         print msg     
    266                         print "    %s" % (_("Limited by : %s") % entry.LimitBy) 
    267                         print "    %s" % (_("Group balance : %.2f") % (entry.AccountBalance or 0.0)) 
    268                         print "    %s" % (_("Total paid so far : %.2f") % (entry.LifeTimePaid or 0.0)) 
    269                         print 
     263                        if entry.Exists : 
     264                            msg = "%s" % entry.Name 
     265                            if entry.Description : 
     266                                msg += " - %s" % entry.Description 
     267                            print msg     
     268                            print "    %s" % (_("Limited by : %s") % entry.LimitBy) 
     269                            print "    %s" % (_("Group balance : %.2f") % (entry.AccountBalance or 0.0)) 
     270                            print "    %s" % (_("Total paid so far : %.2f") % (entry.LifeTimePaid or 0.0)) 
     271                            print 
    270272            else : 
    271273                self.display("%s...\n" % _("Modification"))