mirror of
https://github.com/aclist/dztui.git
synced 2026-10-31 23:22:44 +01:00
feat: disallow updates if binary path is not writeable
This commit is contained in:
1 parent
d3a06cf970
commit
881847cee9
1 file changed
+4
@@ -1,6 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
from typing import Literal, TYPE_CHECKING
|
from typing import Literal, TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.const.constants import (
|
from dzgui.const.constants import (
|
||||||
@@ -13,6 +14,7 @@ from dzgui.const.constants import (
|
|||||||
from dzgui.const.enum import ServerTab
|
from dzgui.const.enum import ServerTab
|
||||||
from dzgui.managers.update import UpdateManager
|
from dzgui.managers.update import UpdateManager
|
||||||
from dzgui.util.clip import copy_clipboard
|
from dzgui.util.clip import copy_clipboard
|
||||||
|
from dzgui.util.file import is_writeable
|
||||||
from dzgui.views.components.buttonbox import ButtonBox
|
from dzgui.views.components.buttonbox import ButtonBox
|
||||||
from dzgui.views.components.filter_panel import FilterPanel
|
from dzgui.views.components.filter_panel import FilterPanel
|
||||||
from dzgui.views.components.mod_panel import ModSelectionPanel
|
from dzgui.views.components.mod_panel import ModSelectionPanel
|
||||||
@@ -87,6 +89,8 @@ class RightPanel(Gtk.Box):
|
|||||||
)
|
)
|
||||||
exe_path = os.getenv("PYAPP")
|
exe_path = os.getenv("PYAPP")
|
||||||
if exe_path and update is not None:
|
if exe_path and update is not None:
|
||||||
|
if is_writeable(Path(exe_path)) is True:
|
||||||
|
print("path is writeable")
|
||||||
self.update_button.set_halign(Gtk.Align.END)
|
self.update_button.set_halign(Gtk.Align.END)
|
||||||
self.gutter_box.add(self.update_button)
|
self.gutter_box.add(self.update_button)
|
||||||
self.update_button.connect(
|
self.update_button.connect(
|
||||||
|
|||||||
Reference in new issue
Block a user