Skip to content

Instantly share code, notes, and snippets.

@mrorii
Last active December 20, 2015 05:49
Show Gist options
  • Save mrorii/6081712 to your computer and use it in GitHub Desktop.
Save mrorii/6081712 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import gzip
try:
import cStringIO as StringIO
except:
import StringIO
# ...
@app.route('/cas/<cas_id>')
@login_required
def cas(cas_id):
# ...
try:
string_io = StringIO.StringIO()
string_io.write(cas_gzipped)
f = gzip.open(fileobj=string_io, 'rb')
xmi = f.read()
except:
error_msg = 'There was an error in decompressing the CAS'
return render_template('error.html', error_msg=error_msg)
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment