1 # -----------------------------------------------------------------------
2 # Copyright (C) 2010 Equinox Software, Inc
3 # Bill Erickson <erickson@esilibrary.com>
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 3
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 # -----------------------------------------------------------------------
16 import constrictor.script
17 import constrictor.properties
18 import constrictor.log as log
22 class SIP2ItemInfoEnduranceScript(constrictor.script.Script):
25 constrictor.script.Script.__init__(self)
28 props = constrictor.properties.Properties.get_properties()
30 username = props.get_property('sip2.username')
31 password = props.get_property('sip2.password')
32 institution = props.get_property('sip2.institution')
33 server = props.get_property('sip2.server')
34 port = int(props.get_property('sip2.port'))
36 barcodes = props.get_property('sip2.copyBarcodes').split(',')
37 copy_barcode = barcodes[constrictor.script.ScriptThread.get_thread_id()]
39 client = sip2_client.SIP2Client(server, port)
42 if client.login(username, password, institution):
44 if not client.item_info_request(institution, copy_barcode):
47 constrictor.script.ScriptManager.go(SIP2ItemInfoEnduranceScript())