Commit b6eec0dc authored by Roman Alifanov's avatar Roman Alifanov

added flag: `--latest' (appears if epm version >= 3.64.0)

parent 0fe97096
...@@ -2,8 +2,8 @@ msgid "" ...@@ -2,8 +2,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: ru.eepm.PlayGUI\n" "Project-Id-Version: ru.eepm.PlayGUI\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-28 18:59+0300\n" "POT-Creation-Date: 2024-12-28 20:09+0300\n"
"PO-Revision-Date: 2024-10-28 19:14+0300\n" "PO-Revision-Date: 2024-12-28 20:10+0300\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: ru\n" "Language: ru\n"
...@@ -53,34 +53,42 @@ msgstr "выберите нужные флаги" ...@@ -53,34 +53,42 @@ msgstr "выберите нужные флаги"
msgid "Flags" msgid "Flags"
msgstr "Флаги" msgstr "Флаги"
#: window.py:72 #: window.py:77
msgid ""
"It helps you get the latest version of the program that hasn't been tested "
"on your epm version."
msgstr ""
"Помогает получить последнюю версию программы, которая не тестировалась на "
"вашей версии epm."
#: window.py:87
msgid "" msgid ""
"Sometimes it helps to get the latest version of the program. (Not " "Sometimes it helps to get the latest version of the program. (Not "
"recommended)" "recommended)"
msgstr "" msgstr ""
"Иногда помогает получить последнюю версию приложения. (Не рекомендуется)" "Иногда помогает получить последнюю версию приложения. (Не рекомендуется)"
#: window.py:77 #: window.py:92
msgid "It helps to get resources that are unavailable from your network" msgid "It helps to get resources that are unavailable from your network"
msgstr "Помогает получить доступ к ресурсам, которые недоступны в вашей сети" msgstr "Помогает получить доступ к ресурсам, которые недоступны в вашей сети"
#: window.py:82 #: window.py:97
msgid "The user will not be asked any questions" msgid "The user will not be asked any questions"
msgstr "Пользователю не будет задано никаких вопросов" msgstr "Пользователю не будет задано никаких вопросов"
#: window.py:156 #: window.py:182
msgid "Remove and install applications" msgid "Remove and install applications"
msgstr "Удалить и установить приложения" msgstr "Удалить и установить приложения"
#: window.py:157 #: window.py:183
msgid "Install applications" msgid "Install applications"
msgstr "Установить приложения" msgstr "Установить приложения"
#: window.py:158 #: window.py:184
msgid "Remove applications" msgid "Remove applications"
msgstr "Удалить приложения" msgstr "Удалить приложения"
#: window.py:159 window.ui:117 #: window.py:185 window.ui:117
msgid "Update applications" msgid "Update applications"
msgstr "Обновить приложения" msgstr "Обновить приложения"
......
...@@ -36,6 +36,7 @@ eepm_play_gui_tools = [ ...@@ -36,6 +36,7 @@ eepm_play_gui_tools = [
'__init__.py', '__init__.py',
'tools/command_runner.py', 'tools/command_runner.py',
'tools/appsmanager.py', 'tools/appsmanager.py',
'tools/epm_version.py',
] ]
install_data(eepm_play_gui_main, install_dir: moduledir) install_data(eepm_play_gui_main, install_dir: moduledir)
......
import subprocess
from packaging import version
def check_epm_version(required_version="3.64.0"):
# Выполнение команды epm --short --version
result = subprocess.run(['epm', '--short', '--version'],
capture_output=True, text=True, check=True)
# Извлечение версии из вывода
epm_version = result.stdout.strip()
print(f"epm version: {epm_version}")
# Сравнение версий
if version.parse(epm_version) >= version.parse(required_version):
return True
else:
return False
...@@ -20,6 +20,7 @@ from gi.repository import Gtk, Adw, GObject, GLib ...@@ -20,6 +20,7 @@ from gi.repository import Gtk, Adw, GObject, GLib
import gettext import gettext
from .tools.epm_version import check_epm_version
from .widgets.applicationrow import ApplicationRow from .widgets.applicationrow import ApplicationRow
from .widgets.logdialog import LogDialog from .widgets.logdialog import LogDialog
...@@ -57,6 +58,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow): ...@@ -57,6 +58,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self.applications = None self.applications = None
self.installed_apps = None self.installed_apps = None
self.reset_button.connect("clicked", lambda _: self.update_ui()) self.reset_button.connect("clicked", lambda _: self.update_ui())
self.apply_button.connect("activated", self.on_apply_clicked) self.apply_button.connect("activated", self.on_apply_clicked)
...@@ -66,6 +68,17 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow): ...@@ -66,6 +68,17 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self.flagsdialog = FlagsDialog() self.flagsdialog = FlagsDialog()
self.flags_button.connect("clicked", lambda _: self.flagsdialog.present(self)) self.flags_button.connect("clicked", lambda _: self.flagsdialog.present(self))
if check_epm_version("3.64.0"):
self.flagsdialog.add_flags(
[
{
"flag": "--latest",
"name": "Latest",
"description": _("It helps you get the latest version of the program that hasn't been tested on your epm version."),
}
]
)
self.flagsdialog.add_flags( self.flagsdialog.add_flags(
[ [
{ {
...@@ -283,7 +296,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow): ...@@ -283,7 +296,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
f"epm play --remove {' '.join(to_remove)}", f"epm play --remove {' '.join(to_remove)}",
ignored_flags=[ ignored_flags=[
"--force", "--ipfs" "--force", "--ipfs", "--latest"
] ]
) )
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment