Changeset 2454

Show
Ignore:
Timestamp:
09/17/05 22:11:53 (19 years ago)
Author:
jerome
Message:

Added the -I | --increase command line switch to edpykota

Location:
pykota/trunk
Files:
16 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/edpykota

    r2452 r2454  
    139139   
    140140  -H | --hardlimit hl  Sets the quota hard limit to hl pages. 
     141   
     142  -I | --increase v    Increase both Soft and Hard limits by the value 
     143                       of v. You can prefix v with + or -, if no sign is 
     144                       used, + is assumed. 
    141145 
    142146  -U | --used usage    Sets the pagecounters for the user to usage pages; 
     
    270274            except ValueError : 
    271275                raise PyKotaToolError, _("Invalid used value %s.") % used 
     276                 
     277        increase = options["increase"] 
     278        if increase : 
     279            try : 
     280                increase = int(increase.strip()) 
     281            except ValueError : 
     282                raise PyKotaToolError, _("Invalid increase value %s.") % increase 
    272283 
    273284        if not options["noquota"] : 
     
    275286                try : 
    276287                    softlimit = int(options["softlimit"].strip()) 
     288                    if softlimit < 0 : 
     289                        raise ValueError 
    277290                except ValueError :     
    278291                    raise PyKotaToolError, _("Invalid softlimit value %s.") % options["softlimit"] 
     
    280293                try : 
    281294                    hardlimit = int(options["hardlimit"].strip()) 
     295                    if hardlimit < 0 : 
     296                        raise ValueError 
    282297                except ValueError :     
    283298                    raise PyKotaToolError, _("Invalid hardlimit value %s.") % options["hardlimit"] 
     
    466481                    self.printInfo(_("Quota not found for object %s on printer %s.") % (entry.Name, printer.Name)) 
    467482                else :     
    468                     if options["noquota"] or options["prototype"] or ((softlimit is not None) and (hardlimit is not None)) : 
     483                    if options["noquota"] or options["prototype"] \ 
     484                       or ((softlimit is not None) and (hardlimit is not None)) : 
    469485                        entrypquota.setLimits(softlimit, hardlimit) 
     486                    if increase : 
     487                       if (entrypquota.SoftLimit is None) \ 
     488                           or (entrypquota.HardLimit is None) : 
     489                           self.printInfo(_("You can't increase limits by %s when no limit is set.") % increase, "error") 
     490                       else : 
     491                           newsoft = entrypquota.SoftLimit + increase          
     492                           newhard = entrypquota.HardLimit + increase          
     493                           if (newsoft >= 0) and (newhard >= 0) : 
     494                               entrypquota.setLimits(newsoft, newhard) 
     495                           else :     
     496                               self.printInfo(_("You can't set negative limits."), "error") 
    470497                    if limitby : 
    471498                        if changed[entry.Name].get("limitby") is None : 
     
    527554                     "comment" : "", \ 
    528555                   } 
    529         short_options = "vhdo:c:C:l:b:i:naugrp:P:S:H:G:RU:" 
     556        short_options = "vhdo:c:C:l:b:i:naugrp:P:S:H:G:RU:I:" 
    530557        long_options = ["help", "version", "comment=", \ 
    531558                        "overcharge=", "charge=", "delete", "limitby=", \ 
     
    533560                        "groups", "reset", "hardreset", "prototype=", \ 
    534561                        "printer=", "softlimit=", "hardlimit=", "pgroups=", \ 
    535                         "used="] 
     562                        "increase=", "used="] 
    536563         
    537564        # Initializes the command line tool 
     
    564591        options["overcharge"] = options["o"] or options["overcharge"] 
    565592        options["comment"] = options["C"] or options["comment"] or defaults["comment"] 
     593        options["increase"] = options["I"] or options["increase"] 
    566594         
    567595        if options["help"] : 
  • pykota/trunk/man/de/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/el_GR/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/es/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/fr/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/it/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/nb_NO/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/pt_BR/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/pt/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/sv_SE/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/th/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/tr/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/man/zh_TW/edpykota.1

    r2453 r2454  
    131131Sets the quota hard limit to hl pages. 
    132132.TP 
     133\fB\-I\fR | \fB\-\-increase\fR v 
     134Increase both Soft and Hard limits by the value 
     135of v. You can prefix v with + or \-, if no sign is 
     136used, + is assumed. 
     137.TP 
    133138\fB\-U\fR | \fB\-\-used\fR usage 
    134139Sets the pagecounters for the user to usage pages; 
  • pykota/trunk/NEWS

    r2452 r2454  
    4040          group or groups (separated with commas). 
    4141           
     42        - The -I | --increase command line switch to edpykota allows 
     43          to increase or decrease page limits. 
     44           
    4245    - 1.23alpha29 : 
    4346     
  • pykota/trunk/TODO

    r2452 r2454  
    4949          better integrate PyKota with these. 
    5050           
    51         - Allow soft and hard limits to be increased/decreased. 
    52          
    5351        - Add most configuration directives to the database itself, 
    5452          while still allowing to overwrite them with the configuration