mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-10 20:48:40 +01:00
Fix user interrupt
This commit is contained in:
parent
9c0ff33436
commit
f0b23474ea
4 changed files with 16 additions and 8 deletions
|
@ -87,7 +87,7 @@ class MetaData(object):
|
||||||
|
|
||||||
__all__ = "slpkg"
|
__all__ = "slpkg"
|
||||||
__author__ = "dslackw"
|
__author__ = "dslackw"
|
||||||
__version_info__ = (2, 6, 9)
|
__version_info__ = (2, 7, 0)
|
||||||
__version__ = "{0}.{1}.{2}".format(*__version_info__)
|
__version__ = "{0}.{1}.{2}".format(*__version_info__)
|
||||||
__license__ = "GNU General Public License v3 (GPLv3)"
|
__license__ = "GNU General Public License v3 (GPLv3)"
|
||||||
__email__ = "d.zlatanidis@gmail.com"
|
__email__ = "d.zlatanidis@gmail.com"
|
||||||
|
|
|
@ -96,7 +96,7 @@ class PackageManager(object):
|
||||||
remove_pkg = raw_input(
|
remove_pkg = raw_input(
|
||||||
"\nAre you sure to remove {0} {1} [y/N]? ".format(
|
"\nAre you sure to remove {0} {1} [y/N]? ".format(
|
||||||
str(len(self.removed)), msg))
|
str(len(self.removed)), msg))
|
||||||
except KeyboardInterrupt:
|
except (KeyboardInterrupt, EOFError):
|
||||||
print("") # new line at exit
|
print("") # new line at exit
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
if remove_pkg in ["y", "Y"]:
|
if remove_pkg in ["y", "Y"]:
|
||||||
|
@ -128,7 +128,7 @@ class PackageManager(object):
|
||||||
"\nRemove dependencies (maybe used by "
|
"\nRemove dependencies (maybe used by "
|
||||||
"other packages) [y/N]? ")
|
"other packages) [y/N]? ")
|
||||||
print("")
|
print("")
|
||||||
except KeyboardInterrupt:
|
except (KeyboardInterrupt, EOFError):
|
||||||
print("") # new line at exit
|
print("") # new line at exit
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
return remove_dep
|
return remove_dep
|
||||||
|
@ -207,7 +207,7 @@ class PackageManager(object):
|
||||||
Msg().template(78)
|
Msg().template(78)
|
||||||
try:
|
try:
|
||||||
self.skip = raw_input(" > ").split()
|
self.skip = raw_input(" > ").split()
|
||||||
except KeyboardInterrupt:
|
except (KeyboardInterrupt, EOFError):
|
||||||
print("")
|
print("")
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
for s in self.skip:
|
for s in self.skip:
|
||||||
|
@ -345,7 +345,7 @@ class PackageManager(object):
|
||||||
else:
|
else:
|
||||||
print(pkg)
|
print(pkg)
|
||||||
print("") # new line at end
|
print("") # new line at end
|
||||||
except KeyboardInterrupt:
|
except (KeyboardInterrupt, EOFError):
|
||||||
print("") # new line at exit
|
print("") # new line at exit
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
|
|
||||||
|
|
|
@ -212,8 +212,12 @@ class Patches(object):
|
||||||
"***{1}".format(self.meta.color["RED"],
|
"***{1}".format(self.meta.color["RED"],
|
||||||
self.meta.color["ENDC"]))
|
self.meta.color["ENDC"]))
|
||||||
Msg().template(78)
|
Msg().template(78)
|
||||||
answer = raw_input("\nThe kernel has been upgraded, "
|
try:
|
||||||
"reinstall `LILO` [y/N]? ")
|
answer = raw_input("\nThe kernel has been upgraded, "
|
||||||
|
"reinstall `LILO` [y/N]? ")
|
||||||
|
except (KeyboardInterrupt, EOFError):
|
||||||
|
print("")
|
||||||
|
raise SystemExit()
|
||||||
if answer in ["y", "Y"]:
|
if answer in ["y", "Y"]:
|
||||||
subprocess.call("lilo", shell=True)
|
subprocess.call("lilo", shell=True)
|
||||||
break
|
break
|
||||||
|
|
|
@ -57,7 +57,11 @@ def it_self_update():
|
||||||
else:
|
else:
|
||||||
print("\nNew version '{0}-{1}' is available !\n".format(
|
print("\nNew version '{0}-{1}' is available !\n".format(
|
||||||
_meta_.__all__, __new_version__))
|
_meta_.__all__, __new_version__))
|
||||||
answer = raw_input("Would you like to upgrade [y/N]? ")
|
try:
|
||||||
|
answer = raw_input("Would you like to upgrade [y/N]? ")
|
||||||
|
except (KeyboardInterrupt, EOFError):
|
||||||
|
print("")
|
||||||
|
raise SystemExit()
|
||||||
if answer in ["y", "Y"]:
|
if answer in ["y", "Y"]:
|
||||||
print("") # new line after answer
|
print("") # new line after answer
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue