def term(): if request.headers.get('X-Forwarded-Proto') == "http": return redirect(request.url.replace('http://', 'https://', 1), code=301) if not _has_needed_post(("user","pw",)): return login() if not banner.login(u=request.form["user"], p=request.form["pw"]): return login("Login failed!") ## terms = banner.termdict() ## ret = [] _header(ret, 'Select Term') ret.append('<form action="people" method="POST">') ret.append('<input type="hidden" name="sid" value="{}" />'.format(base64.b64encode(banner.savestate()).decode('ASCII'))) ret.append('<div class="form-group">') ret.append('<label id="term">Term</label>') now = 'foorbar' ret.append('<select name="term" id="term" class="form-control">') for code,name in sorted(terms.items(), key=operator.itemgetter(0), reverse=True): if code: ret.append('<option {}value="{}">{}</option>'.format('selected="selected" ' if code==now else '', html.escape(code), html.escape(name))) ret.append('</select>') ret.append('</div>') ret.append('<input type="submit" class="btn btn-primary" value="Submit" />') ret.append('</form>') _footer(ret) return _out(ret)
from neubanner import banner import pprint ############################################################################## ############################################################################## TERM = '201930' STUDID = ['001834647'] banner.login() banner.termset(TERM) for ids in STUDID: banner.idset(banner.getxyz_studid(ids)) data = banner.studenttranscript() if data is not None: print(data)
from neubanner import banner import pprint ############################################################################## ############################################################################## TERM = '201910' STUDID = '001602220' if banner.login(): banner.termset(TERM) banner.idset(banner.getxyz_studid(STUDID)) data = banner.studenttranscript() pp = pprint.PrettyPrinter(indent=4) pp.pprint(data) else: print("Login Error!")