diff options
author | Papoteur <papoteur@mageia.org> | 2019-07-28 18:50:33 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2019-07-28 18:50:33 +0200 |
commit | f376379e46d039a85de6d2e262a83c97d1cfce74 (patch) | |
tree | 6112610ae741224ea82044e8d3a19de223ab8c61 /lib | |
parent | c9986c173cf76e57d7a23a7d51e942035b5c7f87 (diff) | |
download | isodumper-f376379e46d039a85de6d2e262a83c97d1cfce74.tar isodumper-f376379e46d039a85de6d2e262a83c97d1cfce74.tar.gz isodumper-f376379e46d039a85de6d2e262a83c97d1cfce74.tar.bz2 isodumper-f376379e46d039a85de6d2e262a83c97d1cfce74.tar.xz isodumper-f376379e46d039a85de6d2e262a83c97d1cfce74.zip |
Prevent launching when an instance is already running
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/isodumper.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index 38a41a4..797c551 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -48,6 +48,8 @@ from subprocess import call, Popen, PIPE from pydbus import SystemBus from gi.repository import GLib +import psutil + class NoUDisks2(Exception): pass @@ -440,6 +442,12 @@ 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',)) + for pid in psutil.pids(): + p = psutil.Process(pid) + if p.name() == "isodumper" : + raise(Exception(_("There is another instance of Isodumper already running."))) + + #TODO Read log level from command line # define size of the selected device |