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
d2a35dc5
Commit
d2a35dc5
authored
Oct 18, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve the readability of get_install_remove_lists func
parent
d0cb7e45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
window.py
src/window.py
+17
-9
No files found.
src/window.py
View file @
d2a35dc5
...
@@ -52,7 +52,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
...
@@ -52,7 +52,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
def
__init__
(
self
,
**
kwargs
):
def
__init__
(
self
,
**
kwargs
):
super
()
.
__init__
(
**
kwargs
)
super
()
.
__init__
(
**
kwargs
)
self
.
set_title
(
"EPM PLAY"
)
self
.
set_title
(
"EPM PLAY"
)
self
.
checkboxe
s
=
None
self
.
row
s
=
None
self
.
reset_button
.
connect
(
"clicked"
,
lambda
_
:
self
.
update_ui
())
self
.
reset_button
.
connect
(
"clicked"
,
lambda
_
:
self
.
update_ui
())
...
@@ -101,7 +101,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
...
@@ -101,7 +101,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
installed_apps
=
installed_apps
self
.
installed_apps
=
installed_apps
self
.
clear_choice_listbox
()
self
.
clear_choice_listbox
()
self
.
checkboxe
s
=
{}
self
.
row
s
=
{}
for
app
in
self
.
applications
:
for
app
in
self
.
applications
:
self
.
add_application_row
(
app
)
self
.
add_application_row
(
app
)
...
@@ -119,7 +119,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
...
@@ -119,7 +119,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
on_toggle
=
self
.
on_checkbox_toggled
on_toggle
=
self
.
on_checkbox_toggled
)
)
self
.
choice_listbox
.
append
(
row
)
self
.
choice_listbox
.
append
(
row
)
self
.
checkboxe
s
[
app
[
'name'
]]
=
row
self
.
row
s
[
app
[
'name'
]]
=
row
def
on_checkbox_toggled
(
self
,
app_name
,
active
):
def
on_checkbox_toggled
(
self
,
app_name
,
active
):
print
(
f
"{app_name} {'установлен' if active else 'снят'}"
)
print
(
f
"{app_name} {'установлен' if active else 'снят'}"
)
...
@@ -196,12 +196,20 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
...
@@ -196,12 +196,20 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
),
on_done
=
self
.
update_ui
)
),
on_done
=
self
.
update_ui
)
def
get_install_remove_lists
(
self
):
def
get_install_remove_lists
(
self
):
if
self
.
installed_apps
and
self
.
checkboxes
:
if
not
(
self
.
installed_apps
and
self
.
rows
):
to_install
=
[
app_name
for
app_name
,
row
in
self
.
checkboxes
.
items
()
if
row
.
checkbox
.
get_active
()
and
app_name
not
in
self
.
installed_apps
]
return
[],
[]
to_remove
=
[
app_name
for
app_name
,
row
in
self
.
checkboxes
.
items
()
if
not
row
.
checkbox
.
get_active
()
and
app_name
in
self
.
installed_apps
]
return
to_install
,
to_remove
to_install
=
[
else
:
app_name
for
app_name
,
row
in
self
.
rows
.
items
()
return
False
,
False
if
row
.
checkbox
.
get_active
()
and
app_name
not
in
self
.
installed_apps
]
to_remove
=
[
app_name
for
app_name
,
row
in
self
.
rows
.
items
()
if
not
row
.
checkbox
.
get_active
()
and
app_name
in
self
.
installed_apps
]
return
to_install
,
to_remove
def
build_commands
(
self
,
to_install
,
to_remove
):
def
build_commands
(
self
,
to_install
,
to_remove
):
commands
=
[]
commands
=
[]
...
...
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