From 2a76954018620022cfbe564bea586c28b79406ef Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 26 May 2015 22:56:57 +0200 Subject: [PATCH] fail is argument is not oshash and not found, fixes #2793 --- pandora_client/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index cf816d1..2eefd7b 100755 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -115,6 +115,13 @@ def ignore_file(client, path): return True return False +def is_oshash(oshash): + try: + int(oshash, 16) + except: + return False + return len(oshash) == 16 + def hide_cursor(): sys.stdout.write("\033[?25l") sys.stdout.flush() @@ -654,6 +661,9 @@ class Client(object): 'filename': filename }) data.append(oshash) + elif not is_oshash(arg): + print 'file not found "%s"' % arg + sys.exit(1) else: data.append(arg) files = []