Index: pykota/trunk/bin/edpykota
===================================================================
--- pykota/trunk/bin/edpykota (revision 3489)
+++ pykota/trunk/bin/edpykota (revision 3549)
@@ -36,5 +36,5 @@
 class EdPyKota(PyKotaTool) :
     """A class for edpykota."""
-    def modifyPQEntry(self, pqkey, pqentry, noquota, softlimit, hardlimit, increase, reset, hardreset, suffix, used) :
+    def modifyPQEntry(self, pqkey, pqentry, noquota, softlimit, hardlimit, increase, reset, hardreset, suffix, used, maxjobsize) :
         """Modifies a print quota entry."""
         if noquota or ((softlimit is not None) and (hardlimit is not None)) :
@@ -54,4 +54,9 @@
             if used :
                 pqentry.setUsage(used)
+            if maxjobsize is not None :
+                if maxjobsize == "unlimited" :
+                    pqentry.setMaxJobSize(None)
+                else :
+                    pqentry.setMaxJobSize(maxjobsize)
 
     def main(self, names, options) :
@@ -77,6 +82,8 @@
                                       or options.noquota \
                                       or options.increase \
+                                      or options.maxjobsize \
                                       or options.skipexisting))) \
              or (options.groups and (options.used \
+                                  or options.maxjobsize \
                                   or options.increase \
                                   or options.reset \
@@ -106,5 +113,6 @@
                         self.display("    %s\n" % (_("Hard limit : %s") % pqentry.HardLimit))
                         self.display("    %s\n" % (_("Date limit : %s") % pqentry.DateLimit))
-                        self.display("    %s (Not supported yet)\n" % (_("Maximum job size : %s") % ((pqentry.MaxJobSize and (_("%s pages") % pqentry.MaxJobSize)) or _("Unlimited"))))
+                        if suffix == "User" :
+                            self.display("    %s\n" % (_("Maximum job size : %s") % (((pqentry.MaxJobSize is not None) and (_("%s pages") % pqentry.MaxJobSize)) or _("Unlimited"))))
                         if hasattr(pqentry, "WarnCount") :
                             self.display("    %s\n" % (_("Warning banners printed : %s") % pqentry.WarnCount))
@@ -159,4 +167,17 @@
                         self.printInfo(_("Undefined soft limit set to hard limit (%s).") % str(softlimit))
 
+            if options.maxjobsize :
+                if options.maxjobsize.lower() == "unlimited" :
+                    maxjobsize = "unlimited"
+                else :
+                    try :
+                        maxjobsize = int(options.maxjobsize)
+                        if maxjobsize < 0 :
+                            raise ValueError
+                    except ValueError :
+                        raise PyKotaCommandLineError, _("Invalid maximum job size value %s") % options.maxjobsize
+            else :
+                maxjobsize = None
+
             self.storage.beginTransaction()
             try :
@@ -183,5 +204,6 @@
                                                options.hardreset,
                                                suffix,
-                                               used)
+                                               used,
+                                               maxjobsize)
                             oldpqentry = getattr(self.storage, "add%sPQuota" % suffix)(pqentry)
                             if oldpqentry is not None :
@@ -201,5 +223,6 @@
                                                        options.hardreset,
                                                        suffix,
-                                                       used)
+                                                       used,
+                                                       maxjobsize)
                                     oldpqentry.save()
                             percent.oneMore()
@@ -220,5 +243,6 @@
                                                    options.hardreset,
                                                    suffix,
-                                                   used)
+                                                   used,
+                                                   maxjobsize)
                                 pqentry.save()
                             percent.oneMore()
@@ -263,4 +287,7 @@
                             dest="action",
                             help=_("Display detailed informations about the specified users or groups print quota entries."))
+    parser.add_option("-m", "--maxjobsize",
+                            dest="maxjobsize",
+                            help=_("Set the maximum job size in pages the specified users are allowed to print to the specified printers in a single job. Accepted values are '0' to forbid printing, 'unlimited' to allow unrestricted printing, or any positive integer value. This option is not supported for users groups."))
     parser.add_option("-n", "--noquota",
                             dest="noquota",
