La til restart-funksjon

This commit is contained in:
Vegard Aksland Sjonfjell 2013-02-11 19:08:31 +00:00
parent 007773be1a
commit 8419f814ce
1 changed files with 7 additions and 2 deletions

View File

@ -181,6 +181,11 @@ class Menu():
os.system('echo -e "\033[0m"')
os.system('clear')
self.show_context()
# Reloader dibbler fullstending
elif result == 'crash':
print "Reloading ..."
os.execl(sys.argv[0])
else:
if result.isdigit():
@ -198,11 +203,11 @@ class Menu():
def input_int(self, prompt=None, allowed_range=(None,None), null_allowed=False, default=None):
if prompt == None:
prompt = self.prompt
if default:
if default is not None:
prompt += ("[%s] " % default)
while True:
result = self.input_str(prompt)
if default:
if default is not None:
return default
elif null_allowed and result == '':
return False