Index: pykota/trunk/bin/pknotify
===================================================================
--- pykota/trunk/bin/pknotify (revision 3441)
+++ pykota/trunk/bin/pknotify (revision 3442)
@@ -80,5 +80,5 @@
         """Checks if we could authenticate an username with a password."""
         if not hasPAM :
-            raise PyKotaToolError, _("You MUST install PyPAM for this functionnality to work !")
+            raise PyKotaToolError, "You MUST install PyPAM for this functionnality to work !"
         else :
             retcode = False
@@ -91,10 +91,10 @@
                 auth.authenticate()
                 auth.acct_mgmt()
-            except PAM.error, resp :
-                self.printInfo(_("Authentication error for user %s : %s") % (username, resp), "warn")
+            except PAM.error, response :
+                self.printInfo(_("Authentication error for user %(username)s : %(response)s") % locals(), "warn")
             except :
-                self.printInfo(_("Internal error : can't authenticate user %s") % username, "error")
+                self.printInfo(_("Internal error : can't authenticate user %(username)s") % locals(), "error")
             else :
-                self.logdebug(_("Password correct for user %s") % username)
+                self.logdebug("Entered password is correct for user %s" % username)
                 retcode = True
             return retcode
@@ -107,19 +107,12 @@
         """Notifies or asks questions to end users through PyKotIcon."""
         try :
-            (self.destination, self.port) = options["destination"].split(":")
+            (self.destination, self.port) = options.destination.split(":")
             self.port = int(self.port)
         except ValueError :
-            self.destination = options["destination"]
+            self.destination = options.destination
             self.port = 7654
 
         try :
-            denyafter = int(options["denyafter"])
-            if denyafter < 1 :
-                raise ValueError
-        except (ValueError, TypeError) :
-            denyafter = 1
-
-        try :
-            self.timeout = int(options["timeout"])
+            self.timeout = options.timeout
             if self.timeout < 0 :
                 raise ValueError
@@ -134,11 +127,10 @@
             try :
                 server = xmlrpclib.ServerProxy("http://%s:%s" % (self.destination, self.port))
-                if options["ask"] :
+                if options.action == "ask" :
                     try :
-                        denyafter = int(options["denyafter"])
-                        if denyafter < 1 :
+                        if options.denyafter < 1 :
                             raise ValueError
                     except (ValueError, TypeError) :
-                        denyafter = 1
+                        options.denyafter = 1
                     labels = []
                     varnames = []
@@ -156,7 +148,7 @@
                     passnumber = 1
                     authok = None
-                    while (authok != "AUTH=YES") and (passnumber <= denyafter) :
+                    while (authok != "AUTH=YES") and (passnumber <= options.denyafter) :
                         result = server.askDatas(labels, varnames, varvalues)
-                        if not options["checkauth"] :
+                        if not options.checkauth :
                             break
                         if result["isValid"] :
@@ -171,6 +163,6 @@
                         passnumber += 1
 
-                    if options["checkauth"] and options["denyafter"] \
-                       and (passnumber > denyafter) \
+                    if options.checkauth and options.denyafter \
+                       and (passnumber > options.denyafter) \
                        and (authok != "AUTH=YES") :
                         print "DENY"
@@ -182,13 +174,13 @@
                         if authok is not None :
                             print authok
-                elif options["confirm"] :
+                elif options.action == "confirm" :
                     print server.showDialog(self.sanitizeMessage(arguments[0]), True)
-                elif options["notify"] :
+                elif options.action == "notify" :
                     print server.showDialog(self.sanitizeMessage(arguments[0]), False)
 
-                if options["quit"] :
+                if options.quit :
                     server.quitApplication()
             except (xmlrpclib.ProtocolError, socket.error, socket.gaierror), msg :
-                print options["noremote"]
+                print options.noremote
                 #try :
                 #    errnum = msg.args[0]
