fail is argument is not oshash and not found, fixes #2793
This commit is contained in:
parent
0e31ada156
commit
2a76954018
1 changed files with 10 additions and 0 deletions
|
@ -115,6 +115,13 @@ def ignore_file(client, path):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def is_oshash(oshash):
|
||||||
|
try:
|
||||||
|
int(oshash, 16)
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
return len(oshash) == 16
|
||||||
|
|
||||||
def hide_cursor():
|
def hide_cursor():
|
||||||
sys.stdout.write("\033[?25l")
|
sys.stdout.write("\033[?25l")
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
@ -654,6 +661,9 @@ class Client(object):
|
||||||
'filename': filename
|
'filename': filename
|
||||||
})
|
})
|
||||||
data.append(oshash)
|
data.append(oshash)
|
||||||
|
elif not is_oshash(arg):
|
||||||
|
print 'file not found "%s"' % arg
|
||||||
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
data.append(arg)
|
data.append(arg)
|
||||||
files = []
|
files = []
|
||||||
|
|
Loading…
Reference in a new issue