Ejemplo n.º 1
0
def process_parameters(params):
    for e in params:
        if e == "-1":
            print(cb.read_primary())
        elif e == "-2":
            print(cb.read_clipboard())
        else:
            print("Error: {0} is an unknown option.".format(e))
            exit(1)
Ejemplo n.º 2
0
def clear_password(sender):
    """
    Password removal.
    """
    if clipboard.read_primary() == username_password.password:
        clipboard.to_primary("")
    if clipboard.read_clipboard() == username_password.password:
        clipboard.to_clipboard("")
    if username_password.password:
        username_password.password = None
Ejemplo n.º 3
0
def process_parameters(params):
    for e in params:
        if e == "-1":
            print(cb.read_primary())
            exit(0)
        elif e == "-2":
            print(cb.read_clipboard())
            exit(0)
        else:
            print("Error: {0} is an unknown option.".format(e))
            exit(1)
Ejemplo n.º 4
0
def show():
    text = clipboard.read_primary()
    if not text:
        print("Warning! The primary clipboard is empty.")
        return
    #
    context = {"link": text}
    fname = "/tmp/{id}.html".format(id=simpleflake.simpleflake(hexa=True))

    with open(fname, "w") as f:
        html = render_template("link.html", context)
        f.write(html)

    common.open_url(fname)