diff options
author | Papoteur <papoteur@mageia.org> | 2019-07-29 20:09:30 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2019-07-29 20:10:30 +0200 |
commit | 70657db74e386e040f277a9f760670ea56b78108 (patch) | |
tree | 7784cd7d59692c6a260db48ed8770b22df04f5e7 | |
parent | 4e6ea276b4416061b844724be39f20eebc56bcf8 (diff) | |
download | isodumper-70657db74e386e040f277a9f760670ea56b78108.tar isodumper-70657db74e386e040f277a9f760670ea56b78108.tar.gz isodumper-70657db74e386e040f277a9f760670ea56b78108.tar.bz2 isodumper-70657db74e386e040f277a9f760670ea56b78108.tar.xz isodumper-70657db74e386e040f277a9f760670ea56b78108.zip |
Add dialog for already running instance
Fix self process in processes
-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 |