Changeset 3470 for pykota/trunk/pykota

Show
Ignore:
Timestamp:
12/16/08 22:54:18 (15 years ago)
Author:
jerome
Message:

Now pkrefund features a -i|--info command line option allowing the
refunding informations prefix to be changed from the default.
This change fixes #30.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storage.py

    r3445 r3470  
    475475    def refund(self, reason) : 
    476476        """Refund a particular print job.""" 
    477         if (not self.JobSize) or (self.JobAction in ("DENY", "CANCEL", "REFUND")) : 
    478             return 
    479         try : 
    480             loginname = os.getlogin() 
    481         except OSError : 
    482             import pwd 
    483             loginname = pwd.getpwuid(os.getuid()).pw_name 
    484         basereason = _("Refunded %i pages and %.3f credits by %s (%s) on %s") \ 
    485                         % (self.JobSize, 
    486                            self.JobPrice, 
    487                            self.parent.tool.effectiveUserName, 
    488                            loginname, 
    489                            str(DateTime.now())[:19]) 
    490         if reason : 
    491             reason = "%s : %s" % (basereason, reason) 
    492         else : 
    493             reason = basereason 
    494477        self.parent.tool.logdebug("Refunding job %s..." % self.ident) 
    495478        self.parent.beginTransaction()