Module z3950_utils
[hide private]
[frames] | no frames]

Source Code for Module z3950_utils

 1   
 2  from PyZ3950 import asn1 
 3  from PyZ3950.oids import * 
 4  from PyZ3950.z3950_2001 import * 
 5  from PyZ3950.zdefs import * 
 6   
7 -def negotiateCharSet(req, resp):
8 name = None 9 if hasattr (req, 'otherInfo'): 10 for oi in req.otherInfo: 11 (typ, val) = oi.information 12 if (typ == 'externallyDefinedInfo' and val.direct_reference == Z3950_NEG_CHARSET3_ov): 13 (typ, val) = val.encoding 14 if typ == 'single-ASN1-type': 15 (name, tresp) = make_target_resp(val) 16 set_charset (resp, tresp, 1) 17 return (name, resp)
18 19
21 # This stuff is page 61 and 227 for the ASN1 22 # function: 1 create, 2 delete, 3 modify 23 # waitAction: 1 wait, 2 waitIfPossible, 3 dontWait, 4 dontReturnPackage 24 25 esoids = oids['Z3950']['ES'] 26 tsp = req.taskSpecificParameters 27 package = req.packageType 28 29 if (req.packageType == esoids['PERSISTRS']['oid']): 30 pass
31