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
428a77f9
Commit
428a77f9
authored
Oct 18, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move apply_flags func to flagsdialog
parent
8c1db620
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
flagsdialog.py
src/widgets/flagsdialog.py
+7
-0
window.py
src/window.py
+1
-7
No files found.
src/widgets/flagsdialog.py
View file @
428a77f9
import
re
from
gi.repository
import
Gtk
,
Adw
@Gtk.Template
(
resource_path
=
'/ru/eepm/PlayGUI/widgets/flagsdialog.ui'
)
...
...
@@ -10,6 +12,11 @@ class FlagsDialog(Adw.Dialog):
def
__init__
(
self
,
**
kwargs
):
super
()
.
__init__
(
**
kwargs
)
def
apply_flags
(
self
,
tool
,
flags
,
full_command
):
for
flag
in
flags
:
full_command
=
re
.
sub
(
rf
"
\b
{tool}
\b
"
,
f
"{tool} {flag}"
,
full_command
)
return
full_command
def
ipfs
(
self
):
if
self
.
ipfs_row
.
get_active
():
return
"--ipfs"
...
...
src/window.py
View file @
428a77f9
...
...
@@ -225,7 +225,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
full_command
=
" && "
.
join
(
commands
)
# Apply flags to the command
full_command
=
self
.
apply_flags
(
full_command
=
self
.
flagsdialog
.
apply_flags
(
"epn play"
,
[
self
.
flagsdialog
.
force
(),
self
.
flagsdialog
.
ipfs
(),
...
...
@@ -233,9 +233,3 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
],
full_command
)
return
full_command
def
apply_flags
(
self
,
flags
,
full_command
):
for
flag
in
flags
:
full_command
=
re
.
sub
(
r"\bepm play\b"
,
f
"epm play {flag}"
,
full_command
)
return
full_command
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