Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm-play-gui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladimir Vaskov
eepm-play-gui
Commits
ecdfb77e
Commit
ecdfb77e
authored
Oct 02, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all processes are terminated instantly when the window is closed
parent
914216a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
appsmanager.py
src/appsmanager.py
+4
-5
command_runner.py
src/command_runner.py
+5
-6
No files found.
src/appsmanager.py
View file @
ecdfb77e
...
...
@@ -3,11 +3,10 @@ import threading
from
gi.repository
import
GLib
class
ApplicationManager
:
@staticmethod
def
get_available_applications
(
callback
):
threading
.
Thread
(
target
=
ApplicationManager
.
_get_available_applications
,
args
=
(
callback
,))
.
start
()
threading
.
Thread
(
target
=
ApplicationManager
.
_get_available_applications
,
daemon
=
True
,
args
=
(
callback
,))
.
start
()
@staticmethod
def
_get_available_applications
(
callback
):
...
...
@@ -21,11 +20,11 @@ class ApplicationManager:
else
:
GLib
.
idle_add
(
callback
,
[],
stderr
)
# Pass error message
threading
.
Thread
(
target
=
read_output
)
.
start
()
threading
.
Thread
(
target
=
read_output
,
daemon
=
True
)
.
start
()
@staticmethod
def
get_installed_applications
(
callback
):
threading
.
Thread
(
target
=
ApplicationManager
.
_get_installed_applications
,
args
=
(
callback
,))
.
start
()
threading
.
Thread
(
target
=
ApplicationManager
.
_get_installed_applications
,
daemon
=
True
,
args
=
(
callback
,))
.
start
()
@staticmethod
def
_get_installed_applications
(
callback
):
...
...
@@ -39,7 +38,7 @@ class ApplicationManager:
else
:
GLib
.
idle_add
(
callback
,
[],
stderr
)
# Pass error message
threading
.
Thread
(
target
=
read_output
)
.
start
()
threading
.
Thread
(
target
=
read_output
,
daemon
=
True
)
.
start
()
@staticmethod
def
parse_applications_output
(
output
):
...
...
src/command_runner.py
View file @
ecdfb77e
...
...
@@ -3,7 +3,6 @@ import threading
from
gi.repository
import
GLib
class
CommandRunner
:
def
__init__
(
self
,
on_done
=
None
):
self
.
dialog
=
None
...
...
@@ -32,20 +31,20 @@ class CommandRunner:
try
:
process
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
text
=
True
)
threading
.
Thread
(
target
=
read_output
,
args
=
(
process
.
stdout
,))
.
start
()
threading
.
Thread
(
target
=
read_output
,
args
=
(
process
.
stderr
,))
.
start
()
threading
.
Thread
(
target
=
read_output
,
daemon
=
True
,
args
=
(
process
.
stdout
,))
.
start
()
threading
.
Thread
(
target
=
read_output
,
daemon
=
True
,
args
=
(
process
.
stderr
,))
.
start
()
process
.
wait
()
GLib
.
idle_add
(
dialog
.
close
)
GLib
.
idle_add
(
dialog
.
force_
close
)
if
self
.
on_done
:
GLib
.
idle_add
(
self
.
on_done
)
# Call the callback function after completion
except
subprocess
.
CalledProcessError
as
e
:
GLib
.
idle_add
(
append_log
,
f
"Ошибка: {str(e)}
\n
"
)
GLib
.
idle_add
(
dialog
.
close
)
GLib
.
idle_add
(
dialog
.
force_
close
)
if
self
.
on_done
:
GLib
.
idle_add
(
self
.
on_done
)
# Call the callback function after completion
threading
.
Thread
(
target
=
process_runner
)
.
start
()
threading
.
Thread
(
target
=
process_runner
,
daemon
=
True
)
.
start
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment