Index: /pykota/trunk/bin/edpykota
===================================================================
--- /pykota/trunk/bin/edpykota (revision 825)
+++ /pykota/trunk/bin/edpykota (revision 843)
@@ -17,4 +17,7 @@
 #
 # $Log$
+# Revision 1.25  2003/03/09 23:56:21  jalet
+# Option noquota added to do accounting only.
+#
 # Revision 1.24  2003/02/27 23:48:41  jalet
 # Correctly maps PyKota's log levels to syslog log levels
@@ -128,4 +131,6 @@
                        print quotas
                        
+  -n | --noquota       Doesn't set a quota but only does accounting.
+  
   -r | --reset         Resets the printed page counter for the user
                        or group to zero. The life time page counter 
@@ -170,4 +175,10 @@
   well as every user whose name begins with 'jo'.
   Their life time page counter on each printer will be kept unchanged.
+  
+  $ edpykota --noquota jerome
+  
+  This will tell PyKota to not limit jerome when printing. All his
+  jobs will be allowed, but accounting of the pages he used will
+  still be kept.
 
 This program is free software; you can redistribute it and/or modify
@@ -239,5 +250,5 @@
                 softlimit = hardlimit
                 self.logger.log_message(_("Undefined soft limit set to hard limit (%s) on printer %s.") % (str(softlimit), printer))
-            if (not options["reset"]) and ((hardlimit is None) or (softlimit is None)) :        
+            if (not options["reset"] and not options["noquota"]) and ((hardlimit is None) or (softlimit is None)) :
                 raise PyKotaToolError, _("Both hard and soft limits must be set ! Aborting.")
             if options["add"] :    
@@ -276,10 +287,10 @@
                 else :    
                     if options["users"] :
-                        if (softlimit is not None) and (hardlimit is not None) :
+                        if options["noquota"] or ((softlimit is not None) and (hardlimit is not None)) :
                             self.storage.setUserPQuota(name, printer, softlimit, hardlimit)
                         if options["reset"] :
                             self.storage.resetUserPQuota(name, printer)
                     else :
-                        if (softlimit is not None) and (hardlimit is not None) :
+                        if options["noquota"] or ((softlimit is not None) and (hardlimit is not None)) :
                             self.storage.setGroupPQuota(name, printer, softlimit, hardlimit)
                         if options["reset"] :
@@ -293,6 +304,6 @@
                      "printer" : "*", \
                    }
-        short_options = "vhaugrp:P:S:H:"
-        long_options = ["help", "version", "add", "users", "groups", "reset", "prototype=", "printer=", "softlimit=", "hardlimit="]
+        short_options = "vhnaugrp:P:S:H:"
+        long_options = ["help", "version", "noquota", "add", "users", "groups", "reset", "prototype=", "printer=", "softlimit=", "hardlimit="]
         
         # Initializes the command line tool
@@ -313,4 +324,5 @@
         options["hardlimit"] = options["H"] or options["hardlimit"] 
         options["reset"] = options["r"] or options["reset"] 
+        options["noquota"] = options["n"] or options["noquota"]
         
         if options["help"] :
@@ -319,9 +331,11 @@
             editor.display_version_and_quit()
         elif options["users"] and options["groups"] :    
-            raise PyKotaToolError, _("edpykota: options --users and --groups are incompatible.")
+            raise PyKotaToolError, _("incompatible options, see help.")
         elif (options["softlimit"] or options["hardlimit"]) and options["prototype"] :    
-            raise PyKotaToolError, _("edpykota: options --softlimit or --hardlimit and --prototype are incompatible.")
+            raise PyKotaToolError, _("incompatible options, see help.")
+        elif options["noquota"] and (options["prototype"] or options["hardlimit"] or options["softlimit"]) :
+            raise PyKotaToolError, _("incompatible options, see help.")
         elif options["groups"] :    
-            raise PyKotaToolError, _("edpykota: option --groups is currently not implemented.")
+            raise PyKotaToolError, _("option --groups is currently not implemented.")
         else :
             sys.exit(editor.main(args, options))
Index: /pykota/trunk/bin/repykota
===================================================================
--- /pykota/trunk/bin/repykota (revision 842)
+++ /pykota/trunk/bin/repykota (revision 843)
@@ -17,4 +17,7 @@
 #
 # $Log$
+# Revision 1.16  2003/03/09 23:56:21  jalet
+# Option noquota added to do accounting only.
+#
 # Revision 1.15  2003/03/09 23:39:14  jalet
 # Simplified translations.
@@ -159,6 +162,6 @@
             lifepagecounter = quota["lifepagecounter"]
             pagecounter = quota["pagecounter"]
-            softlimit = quota["softlimit"] or 0
-            hardlimit = quota["hardlimit"] or 0
+            softlimit = quota["softlimit"]
+            hardlimit = quota["hardlimit"]
             datelimit = quota["datelimit"]
             if datelimit is not None :
@@ -169,6 +172,6 @@
             else :    
                 datelimit = ""
-            reached = ((pagecounter >= softlimit) and "+") or "-"
-            print "%-10.10s %c %8i %8i %8i %10s %9i" % (name, reached, pagecounter, softlimit, hardlimit, str(datelimit)[:10], lifepagecounter)
+            reached = ((softlimit is not None) and (pagecounter >= softlimit) and "+") or "-"
+            print "%-10.10s %c %8i %8s %8s %10s %9i" % (name, reached, pagecounter, str(softlimit), str(hardlimit), str(datelimit)[:10], lifepagecounter)
             return lifepagecounter
         
