diff options
author | Papoteur <papoteur@mageia.org> | 2019-07-29 20:09:30 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2019-07-29 20:09:30 +0200 |
commit | a5f13ac7dbb1cbc76dde32113a9c2d544f6594ec (patch) | |
tree | 1942c7aeb27a79e382025fa4c8e333b93aa16f3f /lib | |
parent | f23031d247dbc79d02c696e33556316ac5b2085b (diff) | |
download | isodumper-a5f13ac7dbb1cbc76dde32113a9c2d544f6594ec.tar isodumper-a5f13ac7dbb1cbc76dde32113a9c2d544f6594ec.tar.gz isodumper-a5f13ac7dbb1cbc76dde32113a9c2d544f6594ec.tar.bz2 isodumper-a5f13ac7dbb1cbc76dde32113a9c2d544f6594ec.tar.xz isodumper-a5f13ac7dbb1cbc76dde32113a9c2d544f6594ec.zip |
Add dialog for already running instance
Fix self process in processes
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/isodumper.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index 1110ac0..d93a9c0 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -108,7 +108,7 @@ class Info(object): class IsoDumper(object): - RELEASE="v1.11" + RELEASE="v1.12" def get_devices(self): self.list=self.u.find_devices() @@ -442,10 +442,15 @@ NTFS or ext. You can specify a volume name and the format in a new dialog box.<B # Call translation catalog gettext.install(APP, localedir=DIR, names=('ngettext',)) + #Check that there is no other instance running + current_pid = psutil.Process().pid for pid in psutil.pids(): p = psutil.Process(pid) - if p.name() == "isodumper" : - raise(Exception(_("There is another instance of Isodumper already running."))) + if p.name() == "isodumper" and p.pid != current_pid : + info = Info(_("Error"),True,_("There is another instance of Isodumper already running.")) + self.ask_OK(info) + yui.YUILoader.deleteUI() + exit() #TODO Read log level from command line |