Skip to content

Instantly share code, notes, and snippets.

@chozabu
Created September 29, 2014 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chozabu/c8129fb6aaf06bce107d to your computer and use it in GitHub Desktop.
Save chozabu/c8129fb6aaf06bce107d to your computer and use it in GitHub Desktop.
Uploading unexpected crash in kivy
def uploadCrash(crashstr):
print "uploading crash to ", ui_elements.serverURL
#req = UrlRequest('/listLevels', on_success=self.got_levels, timeout=1000)
import urllib
from kivy.network.urlrequest import UrlRequest
params = urllib.urlencode({
'version':__version__,
"crashData":crashstr
})
headers = {'Content-type': 'application/x-www-form-urlencoded',
'Accept': 'text/plain'}
req = UrlRequest(ui_elements.serverURL+'/uploadCrash', on_success=None, req_body=params,
req_headers=headers)
req.wait()
print "crash uploaded"
if __name__ == '__main__':
try:
KivEntEd().run()
except:
print "unexpected error"
import traceback
#traceback.print_exc()
print "---"
uploadCrash(traceback.format_exc())
print "---"
raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment