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 ""
msgstr ""
"Project-Id-Version: ru.eepm.PlayGUI\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-28 18:59+0300\n"
"PO-Revision-Date: 2024-10-28 19:14+0300\n"
"POT-Creation-Date: 2024-12-28 20:09+0300\n"
"PO-Revision-Date: 2024-12-28 20:10+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ru\n"
......@@ -53,34 +53,42 @@ msgstr "выберите нужные флаги"
msgid "Flags"
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 ""
"Sometimes it helps to get the latest version of the program. (Not "
"recommended)"
msgstr ""
"Иногда помогает получить последнюю версию приложения. (Не рекомендуется)"
#: window.py:77
#: window.py:92
msgid "It helps to get resources that are unavailable from your network"
msgstr "Помогает получить доступ к ресурсам, которые недоступны в вашей сети"
#: window.py:82
#: window.py:97
msgid "The user will not be asked any questions"
msgstr "Пользователю не будет задано никаких вопросов"
#: window.py:156
#: window.py:182
msgid "Remove and install applications"
msgstr "Удалить и установить приложения"
#: window.py:157
#: window.py:183
msgid "Install applications"
msgstr "Установить приложения"
#: window.py:158
#: window.py:184
msgid "Remove applications"
msgstr "Удалить приложения"
#: window.py:159 window.ui:117
#: window.py:185 window.ui:117
msgid "Update applications"
msgstr "Обновить приложения"
......
......@@ -36,6 +36,7 @@ eepm_play_gui_tools = [
'__init__.py',
'tools/command_runner.py',
'tools/appsmanager.py',
'tools/epm_version.py',
]
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
import gettext
from .tools.epm_version import check_epm_version
from .widgets.applicationrow import ApplicationRow
from .widgets.logdialog import LogDialog
......@@ -57,6 +58,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self.applications = None
self.installed_apps = None
self.reset_button.connect("clicked", lambda _: self.update_ui())
self.apply_button.connect("activated", self.on_apply_clicked)
......@@ -66,6 +68,17 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self.flagsdialog = FlagsDialog()
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(
[
{
......@@ -283,7 +296,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
f"epm play --remove {' '.join(to_remove)}",
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