[open-ils-commits] r796 - constrictor/trunk/contrib/evergreen (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Feb 25 00:00:25 EST 2010
Author: erickson
Date: 2010-02-25 00:00:22 -0500 (Thu, 25 Feb 2010)
New Revision: 796
Modified:
constrictor/trunk/contrib/evergreen/eg_bib_search.py
constrictor/trunk/contrib/evergreen/eg_checkin.py
constrictor/trunk/contrib/evergreen/eg_checkout.py
constrictor/trunk/contrib/evergreen/eg_checkout_roundtrip.py
constrictor/trunk/contrib/evergreen/eg_data.py
constrictor/trunk/contrib/evergreen/eg_renew.py
constrictor/trunk/contrib/evergreen/eg_title_hold.py
constrictor/trunk/contrib/evergreen/eg_user_transactions.py
constrictor/trunk/contrib/evergreen/eg_workflow.py
Log:
more python style tweaks. removed some unnecessary cruft from hold placement script
Modified: constrictor/trunk/contrib/evergreen/eg_bib_search.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_bib_search.py 2010-02-25 05:00:21 UTC (rev 795)
+++ constrictor/trunk/contrib/evergreen/eg_bib_search.py 2010-02-25 05:00:22 UTC (rev 796)
@@ -9,7 +9,7 @@
def run(self):
dm = eg_data.DataManager()
- org_id = dm.getThreadData(eg_data.PROP_ORG_IDS) or 1
+ org_id = dm.get_thread_data(eg_data.PROP_ORG_IDS) or 1
search_args = {
'org_unit' : org_id,
Modified: constrictor/trunk/contrib/evergreen/eg_checkin.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_checkin.py 2010-02-25 05:00:21 UTC (rev 795)
+++ constrictor/trunk/contrib/evergreen/eg_checkin.py 2010-02-25 05:00:22 UTC (rev 796)
@@ -13,7 +13,7 @@
def run(self):
dm = DataManager()
- copyBarcode = dm.getThreadData(PROP_COPY_BARCODES)
+ copyBarcode = dm.get_thread_data(PROP_COPY_BARCODES)
evt = doCheckin(copyBarcode)
if not evt: return False
Modified: constrictor/trunk/contrib/evergreen/eg_checkout.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_checkout.py 2010-02-25 05:00:21 UTC (rev 795)
+++ constrictor/trunk/contrib/evergreen/eg_checkout.py 2010-02-25 05:00:22 UTC (rev 796)
@@ -16,8 +16,8 @@
def run(self):
dm = DataManager()
- patronID = dm.getThreadData(PROP_PATRON_IDS)
- copyBarcode = dm.getThreadData(PROP_COPY_BARCODES, True)
+ patronID = dm.get_thread_data(PROP_PATRON_IDS)
+ copyBarcode = dm.get_thread_data(PROP_COPY_BARCODES, True)
evt = doCheckout(copyBarcode, patronID)
if not evt: return False
Modified: constrictor/trunk/contrib/evergreen/eg_checkout_roundtrip.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_checkout_roundtrip.py 2010-02-25 05:00:21 UTC (rev 795)
+++ constrictor/trunk/contrib/evergreen/eg_checkout_roundtrip.py 2010-02-25 05:00:22 UTC (rev 796)
@@ -16,8 +16,8 @@
def run(self):
dm = DataManager()
- patronID = dm.getThreadData(PROP_PATRON_IDS)
- copyBarcode = dm.getThreadData(PROP_COPY_BARCODES, True)
+ patronID = dm.get_thread_data(PROP_PATRON_IDS)
+ copyBarcode = dm.get_thread_data(PROP_COPY_BARCODES, True)
evt = doCheckout(copyBarcode, patronID)
if not evt: return False
Modified: constrictor/trunk/contrib/evergreen/eg_data.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_data.py 2010-02-25 05:00:21 UTC (rev 795)
+++ constrictor/trunk/contrib/evergreen/eg_data.py 2010-02-25 05:00:22 UTC (rev 796)
@@ -58,7 +58,7 @@
self.data[prop] = v
log_debug("DataManager set property %s => %s" % (prop, str(v)))
- def getThreadData(self, prop, noSharing=False):
+ def get_thread_data(self, prop, noSharing=False):
''' If the caller is requesting array-based data, we want to de-multiplex(?)
the requested data based on the currently running thread. In other
words, each thread should have its own view into the array of data
Modified: constrictor/trunk/contrib/evergreen/eg_renew.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_renew.py 2010-02-25 05:00:21 UTC (rev 795)
+++ constrictor/trunk/contrib/evergreen/eg_renew.py 2010-02-25 05:00:22 UTC (rev 796)
@@ -16,7 +16,7 @@
def run(self):
dm = DataManager()
- copyBarcode = dm.getThreadData(PROP_COPY_BARCODES, True)
+ copyBarcode = dm.get_thread_data(PROP_COPY_BARCODES, True)
evt = doRenew(copyBarcode)
if not evt: return False
Modified: constrictor/trunk/contrib/evergreen/eg_title_hold.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_title_hold.py 2010-02-25 05:00:21 UTC (rev 795)
+++ constrictor/trunk/contrib/evergreen/eg_title_hold.py 2010-02-25 05:00:22 UTC (rev 796)
@@ -5,29 +5,18 @@
eg_utils.init()
-
class CreateTitleHoldScript(Script):
- def on_thread_init(self, scriptThread):
- # collect all of the holds the current thread user already has
- # so any new holds can be cancelled after the thread is complete
- eg_utils.init_thread()
- dm = DataManager()
- patronID = dm.getThreadData(PROP_PATRON_IDS)
-
-
def run(self):
dm = DataManager()
- titleID = dm.getThreadData(PROP_TITLE_IDS)
- pickupLib = dm.getThreadData(PROP_ORG_IDS)
- patronID = dm.getThreadData(PROP_PATRON_IDS)
+ title_id = dm.get_thread_data(PROP_TITLE_IDS)
+ pickup_lib = dm.get_thread_data(PROP_ORG_IDS)
+ patron_id = dm.get_thread_data(PROP_PATRON_IDS)
- hold_id = doTitleHold(titleID, patronID, pickupLib)
+ hold_id = doTitleHold(title_id, patron_id, pickup_lib)
if hold_id:
doTitleHoldCancel(hold_id)
-
-
ScriptManager.go(CreateTitleHoldScript())
Modified: constrictor/trunk/contrib/evergreen/eg_user_transactions.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_user_transactions.py 2010-02-25 05:00:21 UTC (rev 795)
+++ constrictor/trunk/contrib/evergreen/eg_user_transactions.py 2010-02-25 05:00:22 UTC (rev 796)
@@ -25,7 +25,7 @@
def run(self):
dm = eg_data.DataManager()
- user_id = dm.getThreadData(eg_data.PROP_PATRON_IDS)
+ user_id = dm.get_thread_data(eg_data.PROP_PATRON_IDS)
for type in types:
log_info('Loading patron(%s) transactions with %s' % (int(user_id), type))
Modified: constrictor/trunk/contrib/evergreen/eg_workflow.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_workflow.py 2010-02-25 05:00:21 UTC (rev 795)
+++ constrictor/trunk/contrib/evergreen/eg_workflow.py 2010-02-25 05:00:22 UTC (rev 796)
@@ -91,7 +91,7 @@
if not doTitleHoldPermit(titleID, patronID, pickupLib):
return
- evt = et_tasks.TitleHoldTask().start(title_id=titleID, patron_id=patronID, pickup_lib=pickupLib)
+ evt = eg_tasks.TitleHoldTask().start(title_id=titleID, patron_id=patronID, pickup_lib=pickupLib)
log_info("title task returned %s" % str(evt))
More information about the open-ils-commits
mailing list