From cc57f76e1ebedb5d039bee5af483bce0ffa14fe4 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Thu, 19 Oct 2006 19:32:48 +0000 Subject: [PATCH] - fixed how calls with dictionary args are logged --- PLC/Method.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PLC/Method.py b/PLC/Method.py index 4915893..9b4a440 100644 --- a/PLC/Method.py +++ b/PLC/Method.py @@ -4,7 +4,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: Method.py,v 1.7 2006/10/18 19:42:46 tmack Exp $ +# $Id: Method.py,v 1.9 2006/10/19 17:02:42 tmack Exp $ # import xmlrpclib @@ -125,7 +125,7 @@ class Method: # Gather necessary logging variables event_type = 'Unknown' object_type = 'Unknown' - person_id = 'Null' + person_id = None object_ids = [] call_name = self.name call_args = ", ".join([unicode(arg) for arg in list(args)[1:]]) @@ -149,9 +149,9 @@ class Method: sql_event = "INSERT INTO events " \ " (person_id, event_type, object_type, fault_code, call, runtime) VALUES" \ - " (%(person_id)s, '%(event_type)s', '%(object_type)s'," \ - " %(fault_code)d, '%(call)s', %(runtime)f)" - self.api.db.do(sql_event % locals()) + " (%(person_id)s, %(event_type)s, %(object_type)s," \ + " %(fault_code)d, %(call)s, %(runtime)f)" + self.api.db.do(sql_event, locals()) # log objects affected for object_id in object_ids: -- 2.43.0