Provide a top-level docstring for oils/utils/utils.py
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 19 Mar 2011 05:00:42 +0000 (05:00 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 19 Mar 2011 05:00:42 +0000 (05:00 +0000)
Also, standardize on triple-double-quoted docstrings, per PEP257.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@19819 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/python/oils/utils/utils.py

index 3f83c29..6a72aa7 100644 (file)
@@ -1,3 +1,7 @@
+"""
+Grab-bag of general utility functions
+"""
+
 # -----------------------------------------------------------------------
 # Copyright (C) 2007  Georgia Public Library Service
 # Bill Erickson <billserickson@gmail.com>
 import hashlib
 import osrf.ses
 
-# -----------------------------------------------------------------------
-# Grab-bag of general utility functions
-# -----------------------------------------------------------------------
-
 def md5sum(string):
-    """Return an MD5 message digest for a given input string"""
+    """
+    Return an MD5 message digest for a given input string
+    """
+
     md5 = hashlib.md5()
     md5.update(string)
     return md5.hexdigest()
 
 def unique(arr):
-    ''' Unique-ify a list.  only works if list items are hashable '''
+    """
+    Unique-ify a list.  only works if list items are hashable
+    """
+
     o = {}
     for x in arr:
         o[x] = 1
     return o.keys()
 
 def is_db_true(data):
-    ''' Returns true if the data provided matches what the database considers a true value '''
+    """
+    Returns PostgreSQL's definition of "truth" for the supplied data, roughly.
+    """
+
     if not data or data == 'f' or str(data) == '0':
         return False
     return True