OILS_NS_PERSIST='http://open-ils.org/spec/opensrf/IDL/persistence/v1'
OILS_NS_REPORTER='http://open-ils.org/spec/opensrf/IDL/reporter/v1'
-OILS_APP_CSTORE='open-ils.cstore'
+OILS_EVENT_SUCCESS = 'SUCCESS'
+
+OILS_APP_AUTH = 'open-ils.auth'
+OILS_APP_CIRC = 'open-ils.circ'
+OILS_APP_CSTORE='open-ils.cstore'
# GNU General Public License for more details.
# -----------------------------------------------------------------------
-import re
+import re, md5
+
# -----------------------------------------------------------------------
# Grab-bag of general utility functions
return re.compile(pattern).sub(replace, str)
+def isEvent(evt):
+ return (evt and isinstance(evt, dict) and evt.get('ilsevent') != None)
-
+def eventCode(evt):
+ if isEvent(evt):
+ return evt['ilsevent']
+ return None
+def eventText(evt):
+ if isEvent(evt):
+ return evt['textcode']
+ return None
+
+
+def md5sum(str):
+ m = md5.new()
+ m.update(str)
+ return m.hexdigest()