Commit f2e78e1b authored by Daniel Stan's avatar Daniel Stan

oubli init de old_clipboard

Ce qui faisait planter l'appel à la fonction de restoration.
Celle-ci s'attend à recevoir old_clipboard=None si rien à restorer
parent 8c0a6dd5
...@@ -527,7 +527,6 @@ def show_servers(options): ...@@ -527,7 +527,6 @@ def show_servers(options):
for server in config.servers.keys(): for server in config.servers.keys():
print((u" * " + server).encode("utf-8")) print((u" * " + server).encode("utf-8"))
old_clipboard = None
def saveclipboard(restore=False, old_clipboard=None): def saveclipboard(restore=False, old_clipboard=None):
"""Enregistre le contenu du presse-papier. Le rétablit si ``restore=True``""" """Enregistre le contenu du presse-papier. Le rétablit si ``restore=True``"""
if restore and old_clipboard == None: if restore and old_clipboard == None:
...@@ -570,6 +569,7 @@ def show_file(options): ...@@ -570,6 +569,7 @@ def show_file(options):
ntexte = u"" ntexte = u""
hidden = False # Est-ce que le mot de passe a été caché ? hidden = False # Est-ce que le mot de passe a été caché ?
lines = texte.split('\n') lines = texte.split('\n')
old_clipboard = None
for line in lines: for line in lines:
catchPass = pass_regexp.match(line) catchPass = pass_regexp.match(line)
if catchPass != None and options.clipboard: if catchPass != None and options.clipboard:
...@@ -586,6 +586,7 @@ def show_file(options): ...@@ -586,6 +586,7 @@ def show_file(options):
out.write(raw.encode("utf-8")) out.write(raw.encode("utf-8"))
out.close() out.close()
os.waitpid(proc.pid, 0) os.waitpid(proc.pid, 0)
# Repope ancien pass
if options.clipboard: if options.clipboard:
saveclipboard(restore=True, old_clipboard=old_clipboard) saveclipboard(restore=True, old_clipboard=old_clipboard)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment