[open-ils-commits] r8605 -
branches/acq-experiment/Open-ILS/src/python/oils
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Feb 4 12:03:33 EST 2008
Author: erickson
Date: 2008-02-04 11:35:21 -0500 (Mon, 04 Feb 2008)
New Revision: 8605
Modified:
branches/acq-experiment/Open-ILS/src/python/oils/org.py
Log:
forcing int-ness on flat org keys for consistency
Modified: branches/acq-experiment/Open-ILS/src/python/oils/org.py
===================================================================
--- branches/acq-experiment/Open-ILS/src/python/oils/org.py 2008-02-04 16:35:03 UTC (rev 8604)
+++ branches/acq-experiment/Open-ILS/src/python/oils/org.py 2008-02-04 16:35:21 UTC (rev 8605)
@@ -1,5 +1,6 @@
import osrf.ses
import oils.event, oils.const
+import sys
class OrgUtil(object):
''' Collection of general purpose org_unit utility functions '''
@@ -34,7 +35,7 @@
''' Creates links from an ID-based hash to the org units in the org tree '''
if not node:
node = OrgUtil._org_tree
- OrgUtil._flat_org_tree[node.id()] = node
+ OrgUtil._flat_org_tree[int(node.id())] = node
for child in node.children():
OrgUtil.flatten_org_tree(child)
@@ -43,7 +44,7 @@
OrgUtil._verify_tree()
if isinstance(org_id, osrf.net_obj.NetworkObject):
return org_id
- return OrgUtil._flat_org_tree[org_id]
+ return OrgUtil._flat_org_tree[int(org_id)]
@staticmethod
@@ -140,7 +141,6 @@
@staticmethod
def debug_tree(org_unit, indent=0):
''' Simple function to print the tree of orgs provided '''
- import sys
for i in range(indent):
sys.stdout.write('_')
print '%s id=%s depth=%s' % (org_unit.shortname(), str(org_unit.id()), str(OrgUtil.get_org_type(org_unit).depth()))
More information about the open-ils-commits
mailing list