Mercurial > hg > python
view withdraw.py @ 74:0245bc07f16c simple
try to simplify Rows/Cols (do without?) by hiving off the run-counts copletely
| author | Henry Thompson <ht@markup.co.uk> |
|---|---|
| date | Sat, 09 Aug 2025 15:59:19 -0400 |
| parents | fee51ab07d09 |
| children |
line wrap: on
line source
#!/bin/python from sys import stdin,argv from urllib2 import Request,urlopen, HTTPError from base64 import b64encode type='xyzzy' l='' year='2014' def cc(names): return ' '.join(map(lambda n:n[0]+n[1:].lower(),names.split())) eargs=['uun'] eargs.extend(argv[1:]) while l=='': l=stdin.readline().rstrip() for l in stdin: l=l.rstrip().decode('latin-1'); if l=='': continue try: #uun,... vals=l.split("\t") except ValueError: print "Bad input: %s"%l continue attrs=" ".join(map(lambda n,v:'%s="%s"'%(n,v),zip(eargs,vals))) req='<update year="%s" %s/>'%(year,attrs) print req continue r=Request("http://localhost:8080/exist/apps/phd/updateApp.xq", req.encode('utf-8'),headers={'Content-Type':'application/xml;charset=UTF-8'}) try: res=urlopen(r) except HTTPError as err: print "Error:",err.read() print req exit(1) print res.read()
