Changeset 2524

Show
Ignore:
Timestamp:
09/29/05 13:39:17 (19 years ago)
Author:
jerome
Message:

More complete output for pykotme

Location:
pykota/trunk
Files:
16 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pykotme

    r2512 r2524  
    105105        print _("Job size : %i pages") % totalsize     
    106106        if user.Exists : 
    107             for printer in printers : 
    108                 userpquota = self.storage.getUserPQuota(user, printer) 
    109                 if userpquota.Exists : 
    110                     cost = userpquota.computeJobPrice(totalsize) 
    111                     print _("Cost on printer %s : %.2f") % (printer.Name, cost) 
     107            if user.LimitBy == "noprint" : 
     108                print _("Your account settings forbid you to print at this time.") 
     109            else :     
     110                for printer in printers : 
     111                    userpquota = self.storage.getUserPQuota(user, printer) 
     112                    if userpquota.Exists : 
     113                        if printer.MaxJobSize and (totalsize > printer.MaxJobSize) : 
     114                            print _("You are not allowed to print so many pages on printer %s at this time.") % printer.Name 
     115                        else :     
     116                            cost = userpquota.computeJobPrice(totalsize) 
     117                            msg = _("Cost on printer %s : %.2f") % (printer.Name, cost) 
     118                            if printer.PassThrough : 
     119                                msg = "%s (%s)" % (msg, _("won't be charged, printer is in passthrough mode")) 
     120                            elif user.LimitBy == "nochange" :     
     121                                msg = "%s (%s)" % (msg, _("won't be charged, your account is immutable")) 
     122                            print msg     
    112123             
    113124if __name__ == "__main__" :  
  • pykota/trunk/cgi-bin/pykotme.cgi

    r2381 r2524  
    167167                    user = self.storage.getUser(remuser) 
    168168                    if user.Exists : 
    169                         for printer in printers : 
    170                             upquota = self.storage.getUserPQuota(user, printer) 
    171                             if upquota.Exists : 
    172                                 cost = upquota.computeJobPrice(jobsize) 
    173                                 self.body += "<p>%s</p>" % (_("Cost on printer %s : %.2f") % (printer.Name, cost)) 
     169                        if user.LimitBy == "noprint" : 
     170                            self.body += "<p>%s</p>" % _("Your account settings forbid you to print at this time.") 
     171                        else :     
     172                            for printer in printers : 
     173                                upquota = self.storage.getUserPQuota(user, printer) 
     174                                if upquota.Exists : 
     175                                    if printer.MaxJobSize and (jobsize > printer.MaxJobSize) : 
     176                                        msg = _("You are not allowed to print so many pages on printer %s at this time.") % printer.Name 
     177                                    else :     
     178                                        cost = upquota.computeJobPrice(jobsize) 
     179                                        msg = _("Cost on printer %s : %.2f") % (printer.Name, cost) 
     180                                        if printer.PassThrough : 
     181                                            msg = "%s (%s)" % (msg, _("won't be charged, printer is in passthrough mode")) 
     182                                        elif user.LimitBy == "nochange" :     
     183                                            msg = "%s (%s)" % (msg, _("won't be charged, your account is immutable")) 
     184                                    self.body += "<p>%s</p>" % msg 
    174185                except : 
    175186                    self.body += '<p><font color="red">%s</font></p>' % self.crashed("CGI Error").replace("\n", "<br />") 
  • pykota/trunk/po/de/pykota.po

    r2515 r2524  
    20312031 
    20322032msgid "DENY" 
     2033msgstr "" 
     2034 
     2035msgid "won't be charged, printer is in passthrough mode" 
     2036msgstr "" 
     2037 
     2038msgid "won't be charged, your account is immutable" 
    20332039msgstr "" 
    20342040 
  • pykota/trunk/po/el_GR/pykota.po

    r2515 r2524  
    20222022msgstr "" 
    20232023 
     2024msgid "won't be charged, printer is in passthrough mode" 
     2025msgstr "" 
     2026 
     2027msgid "won't be charged, your account is immutable" 
     2028msgstr "" 
     2029 
    20242030#~ msgid "File number %s unregistered twice from polling object, ignored." 
    20252031#~ msgstr "" 
  • pykota/trunk/po/es/pykota.po

    r2515 r2524  
    20662066 
    20672067msgid "DENY" 
     2068msgstr "" 
     2069 
     2070msgid "won't be charged, printer is in passthrough mode" 
     2071msgstr "" 
     2072 
     2073msgid "won't be charged, your account is immutable" 
    20682074msgstr "" 
    20692075 
  • pykota/trunk/po/fr/pykota.po

    r2515 r2524  
    29572957msgid "DENY" 
    29582958msgstr "Rejet� 
     2959msgid "won't be charged, printer is in passthrough mode" 
     2960msgstr "non d�mpt�imprimante en mode 'passthrough'" 
     2961 
     2962msgid "won't be charged, your account is immutable" 
     2963msgstr "non d�mpt�votre compte est immuable" 
  • pykota/trunk/po/it/pykota.po

    r2515 r2524  
    20332033msgstr "" 
    20342034 
     2035msgid "won't be charged, printer is in passthrough mode" 
     2036msgstr "" 
     2037 
     2038msgid "won't be charged, your account is immutable" 
     2039msgstr "" 
     2040 
    20352041#~ msgid "File number %s unregistered twice from polling object, ignored." 
    20362042#~ msgstr "Numero file %s rimosso due volte dall'oggetto polling, ignorato." 
  • pykota/trunk/po/nb_NO/pykota.po

    r2515 r2524  
    20262026msgstr "" 
    20272027 
     2028msgid "won't be charged, printer is in passthrough mode" 
     2029msgstr "" 
     2030 
     2031msgid "won't be charged, your account is immutable" 
     2032msgstr "" 
     2033 
    20282034#~ msgid "Job is a duplicate. Printing is denied." 
    20292035#~ msgstr "Utskriften er en duplikat. Utskriften blir ikke skrevet." 
  • pykota/trunk/po/pt_BR/pykota.po

    r2515 r2524  
    20202020msgstr "" 
    20212021 
     2022msgid "won't be charged, printer is in passthrough mode" 
     2023msgstr "" 
     2024 
     2025msgid "won't be charged, your account is immutable" 
     2026msgstr "" 
     2027 
    20222028#~ msgid "File number %s unregistered twice from polling object, ignored." 
    20232029#~ msgstr "" 
  • pykota/trunk/po/pt/pykota.po

    r2515 r2524  
    20282028msgstr "" 
    20292029 
     2030msgid "won't be charged, printer is in passthrough mode" 
     2031msgstr "" 
     2032 
     2033msgid "won't be charged, your account is immutable" 
     2034msgstr "" 
     2035 
    20302036#~ msgid "File number %s unregistered twice from polling object, ignored." 
    20312037#~ msgstr "" 
  • pykota/trunk/po/pykota.pot

    r2515 r2524  
    19761976msgstr "" 
    19771977 
     1978msgid "won't be charged, printer is in passthrough mode" 
     1979msgstr "" 
     1980 
     1981msgid "won't be charged, your account is immutable" 
     1982msgstr "" 
  • pykota/trunk/po/sv_SE/pykota.po

    r2520 r2524  
    20392039msgstr "" 
    20402040 
     2041msgid "won't be charged, printer is in passthrough mode" 
     2042msgstr "" 
     2043 
     2044msgid "won't be charged, your account is immutable" 
     2045msgstr "" 
     2046 
    20412047#~ msgid "File number %s unregistered twice from polling object, ignored." 
    20422048#~ msgstr "" 
  • pykota/trunk/po/th/pykota.po

    r2515 r2524  
    20002000msgstr "" 
    20012001 
     2002msgid "won't be charged, printer is in passthrough mode" 
     2003msgstr "" 
     2004 
     2005msgid "won't be charged, your account is immutable" 
     2006msgstr "" 
     2007 
    20022008#~ msgid "File number %s unregistered twice from polling object, ignored." 
    20032009#~ msgstr "������� %s ������ŧ����� 2 ��駨ҡ������� ,��� 
  • pykota/trunk/po/tr/pykota.po

    r2515 r2524  
    20392039msgstr "" 
    20402040 
     2041msgid "won't be charged, printer is in passthrough mode" 
     2042msgstr "" 
     2043 
     2044msgid "won't be charged, your account is immutable" 
     2045msgstr "" 
     2046 
    20412047#~ msgid "File number %s unregistered twice from polling object, ignored." 
    20422048#~ msgstr "%s dosya numarası yoklama nesnesinde kayıtlı değil, yok sayılıyor." 
  • pykota/trunk/po/zh_TW/pykota.po

    r2515 r2524  
    19941994msgstr "" 
    19951995 
     1996msgid "won't be charged, printer is in passthrough mode" 
     1997msgstr "" 
     1998 
     1999msgid "won't be charged, your account is immutable" 
     2000msgstr "" 
     2001 
    19962002#~ msgid "File number %s unregistered twice from polling object, ignored." 
    19972003#~ msgstr "檔案編號 %s 在polling object上已兩次未能成功註冊,因此被忽略"