[open-ils-commits] r857 - constrictor/trunk/contrib/evergreen (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Apr 8 14:04:15 EDT 2010
Author: erickson
Date: 2010-04-08 14:04:11 -0400 (Thu, 08 Apr 2010)
New Revision: 857
Added:
constrictor/trunk/contrib/evergreen/eg_circ_misc.py
Log:
mixed batch of circ calls
Added: constrictor/trunk/contrib/evergreen/eg_circ_misc.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_circ_misc.py (rev 0)
+++ constrictor/trunk/contrib/evergreen/eg_circ_misc.py 2010-04-08 18:04:11 UTC (rev 857)
@@ -0,0 +1,48 @@
+from constrictor.script import Script, ScriptThread
+import eg_utils
+from eg_data import *
+from eg_workflow import *
+import constrictor.log as log
+
+eg_utils.init()
+
+class CreateTitleHoldScript(Script):
+
+ def run(self):
+
+ dm = DataManager()
+ 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)
+ copy_barcode = dm.get_thread_data(PROP_COPY_BARCODES, True)
+
+ # title hold
+ hold_id = doTitleHold(title_id, patron_id, pickup_lib)
+ if hold_id:
+ doTitleHoldCancel(hold_id)
+
+ # checkout/renew/checkin
+ evt = doCheckout(copy_barcode, patron_id)
+ if not evt: return False
+
+ evt = doRenew(copy_barcode)
+ if not evt: return False
+
+ evt = doCheckin(copy_barcode)
+ if not evt: return False
+
+ # patron search
+ search_args = {
+ 'family_name' : {'value' : eg_utils.random_phrase(1), 'group' : 0},
+ 'first_given_name' : {'value' : eg_utils.random_phrase(1), 'group' : 0}
+ }
+
+ log.log_info('Search for patron %s' % str(search_args))
+ res = eg_tasks.UserSearchTask().start(search_args = search_args)
+
+ return True
+
+
+
+ScriptManager.go(CreateTitleHoldScript())
+
More information about the open-ils-commits
mailing list