change exit funtion

This commit is contained in:
Andreas Zweili 2016-12-15 09:58:13 +01:00
parent 816c98b6e8
commit d205394403
1 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import os import os
import sys
import configparser import configparser
import subprocess import subprocess
import interface_variables import interface_variables
@ -58,7 +59,7 @@ def configuration():
config.read(config_file) config.read(config_file)
else: else:
print("Configuration file not found.") print("Configuration file not found.")
quit() sys.exit(1)
# assign the repository variable depending wheter it's a remote or a local # assign the repository variable depending wheter it's a remote or a local
# repository # repository
if 'server' in config['DEFAULT']: if 'server' in config['DEFAULT']:
@ -78,12 +79,14 @@ def configuration():
def exit(): def exit():
if (not int_vars.mount_point): if (not int_vars.mount_point):
print() print()
sys.exit(0)
else: else:
print() print()
print("Unmount Archive and remove folder.") print("Unmount Archive and remove folder.")
print() print()
os.system('fusermount -u' + " " + int_vars.mount_point) os.system('fusermount -u' + " " + int_vars.mount_point)
os.rmdir(int_vars.mount_point) os.rmdir(int_vars.mount_point)
sys.exit(0)
def pause(): def pause():
input("Press any key to continue.") input("Press any key to continue.")