handle keyboardinterrupt, eof and blank file path in interactive ui
parent
8bbf9b10ab
commit
934602ee09
|
@ -39,8 +39,6 @@ class OnionrCLIUI:
|
||||||
|
|
||||||
def subCommand(self, command, args=None):
|
def subCommand(self, command, args=None):
|
||||||
try:
|
try:
|
||||||
#subprocess.run(["./onionr.py", command])
|
|
||||||
#subprocess.Popen(['./onionr.py', command], stdin=subprocess.STD, stdout=subprocess.STDOUT, stderr=subprocess.STDOUT)
|
|
||||||
if args != None:
|
if args != None:
|
||||||
subprocess.call(['./onionr.py', command, args])
|
subprocess.call(['./onionr.py', command, args])
|
||||||
else:
|
else:
|
||||||
|
@ -89,7 +87,12 @@ class OnionrCLIUI:
|
||||||
else:
|
else:
|
||||||
print('Plugin not enabled')
|
print('Plugin not enabled')
|
||||||
elif choice in ("3", "file sharing", "file"):
|
elif choice in ("3", "file sharing", "file"):
|
||||||
|
try:
|
||||||
filename = input("Enter full path to file: ").strip()
|
filename = input("Enter full path to file: ").strip()
|
||||||
|
except (EOFError, KeyboardInterrupt) as e:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if len(filename.strip()) > 0:
|
||||||
self.subCommand("addfile", filename)
|
self.subCommand("addfile", filename)
|
||||||
elif choice in ("4", "quit"):
|
elif choice in ("4", "quit"):
|
||||||
showMenu = False
|
showMenu = False
|
||||||
|
|
Loading…
Reference in New Issue