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
Roman Alifanov
eepm-play-gui
Commits
ecdfb77e
Commit
ecdfb77e
authored
5 months ago
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
master
0.5.0-alt1
0.4.0-alt1
0.3.0
0.3.0-alt1
0.2.1-alt1
0.2.0-alt1
0.1.0-alt1
No related merge requests found
Show 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
):
...
...
This diff is collapsed.
Click to expand it.
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
()
This diff is collapsed.
Click to expand it.
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