def report_error(module, trace_back, e): """ Sends an E-mail reporting error. Args: module: The module's that cannot be imported name. trace_back: Traceback as string. """ try: from pyto_ui import Alert alert = Alert(title=module, message="An error occurred while importing "+module+".\n\nDo you want to report error to the developer?") alert.add_action("Report") alert.add_cancel_action("Cancel") if alert.show() == "Report": open_url("mailto:[email protected]?subject="+module+"%20Importing%20Error&body="+urllib.parse.quote(trace_back)) except ImportError: pass
def report_error(module, trace_back): """ Sends an E-mail reporting error. Args: module: The module's that cannot be imported name. trace_back: Traceback as string. """ alert = Alert.alertWithTitle( module, message="An error occurred while importing " + module + ".\n\nDo you want to report error to the developer?") alert.addAction("Report") alert.addCancelAction("Cancel") if alert.show() == "Report": open_url("mailto://[email protected]?subject=" + module + "%20Importing%20Error&body=" + urllib.parse.quote(trace_back))
def open(self, url, new=0, autoraise=True): sharing.open_url(url) return True
""" Opens Google with given query. """ import sharing from urllib.parse import quote query = quote(input("Search with Google: "), safe="") sharing.open_url(f"https://www.google.com/search?q={query}")