Created
September 29, 2014 11:17
-
-
Save chozabu/c8129fb6aaf06bce107d to your computer and use it in GitHub Desktop.
Uploading unexpected crash in kivy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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