Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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))
Ejemplo n.º 3
0
 def open(self, url, new=0, autoraise=True):
     sharing.open_url(url)
     return True
Ejemplo n.º 4
0
"""
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}")