Index: pykota/trunk/bin/pkbcodes
===================================================================
--- pykota/trunk/bin/pkbcodes (revision 3411)
+++ pykota/trunk/bin/pkbcodes (revision 3413)
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -35,30 +35,30 @@
 from pykota.storage import StorageBillingCode
 
-class PKBcodes(PyKotaTool) :        
+class PKBcodes(PyKotaTool) :
     """A class for a billing codes manager."""
     def modifyBillingCode(self, billingcode, reset, description) :
         """Modifies a billing code."""
         if reset :
-            billingcode.reset()    
+            billingcode.reset()
         if description is not None : # NB : "" is allowed !
             billingcode.setDescription(description)
-        
+
     def main(self, names, options) :
         """Manage billing codes."""
         if options.action != "list" :
             self.adminOnly()
-           
+
         islist = (options.action == "list")
         isadd = (options.action == "add")
         isdelete = (options.action == "delete")
-        
+
         if not names :
             if isdelete or isadd :
                 raise PyKotaCommandLineError, _("You must specify billing codes on the command line.")
-            names = [u"*"]    
-            
+            names = [u"*"]
+
         if not islist :
             percent = Percent(self)
-            
+
         if not isadd :
             if not islist :
@@ -73,5 +73,5 @@
             if not islist :
                 percent.setSize(len(billingcodes))
-                        
+
         if islist :
             for billingcode in billingcodes :
@@ -83,5 +83,5 @@
                        billingcode.Balance, \
                        _("credits")))
-        elif isdelete :    
+        elif isdelete :
             percent.display("\n%s..." % _("Deletion"))
             self.storage.deleteManyBillingCodes(billingcodes)
@@ -91,14 +91,14 @@
             if description :
                 description = description.strip()
-            
+
             self.storage.beginTransaction()
             try :
-                if isadd :    
+                if isadd :
                     percent.display("%s...\n" % _("Creation"))
                     percent.setSize(len(names))
                     for bname in names :
                         billingcode = StorageBillingCode(self.storage, bname)
-                        self.modifyBillingCode(billingcode, 
-                                               options.reset, 
+                        self.modifyBillingCode(billingcode,
+                                               options.reset,
                                                description)
                         oldbillingcode = self.storage.addBillingCode(billingcode)
@@ -106,29 +106,29 @@
                             if options.skipexisting :
                                 self.logdebug(_("Billing code '%(bname)s' already exists, skipping.") % locals())
-                            else :    
+                            else :
                                 self.logdebug(_("Billing code '%(bname)s' already exists, will be modified.") % locals())
-                                self.modifyBillingCode(oldbillingcode, 
-                                                       options.reset, 
+                                self.modifyBillingCode(oldbillingcode,
+                                                       options.reset,
                                                        description)
                                 oldbillingcode.save()
                         percent.oneMore()
-                else :        
+                else :
                     percent.display("\n%s...\n" % _("Modification"))
                     for billingcode in billingcodes :
-                        self.modifyBillingCode(billingcode, 
-                                               options.reset, 
+                        self.modifyBillingCode(billingcode,
+                                               options.reset,
                                                description)
-                        billingcode.save()    
+                        billingcode.save()
                         percent.oneMore()
-            except :                    
+            except :
                 self.storage.rollbackTransaction()
                 raise
-            else :    
+            else :
                 self.storage.commitTransaction()
-                        
+
         if not islist :
             percent.done()
-                     
-if __name__ == "__main__" : 
+
+if __name__ == "__main__" :
     parser = PyKotaOptionParser(description=_("A billing codes manager for PyKota."),
                                 usage="pkbcodes [options] code1 code2 ... codeN")
@@ -159,12 +159,12 @@
                             dest="skipexisting",
                             help=_("If --add is used, ensure that existing billing codes won't be modified."))
-                            
+
     parser.add_example('-D "Financial Department" financial',
                        _("Would create a billing code labelled 'financial' with the specified textual description."))
-    parser.add_example('--delete "fin*"', 
+    parser.add_example('--delete "fin*"',
                        _("Would delete all billing codes which label begins with 'fin'. Matching jobs in the printing history wouldn't be deleted though."))
     parser.add_example("--list",
                        _("Would display details about all existing billing codes."))
-                       
+
     (options, arguments) = parser.parse_args()
-    run(parser, PKBcodes)                   
+    run(parser, PKBcodes)
