Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
P
pardus-flatpak-gui
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Pardus
ondokuz
pardus-flatpak-gui
Commits
04ddb942
Verified
Kaydet (Commit)
04ddb942
authored
Nis 22, 2020
tarafından
Erdem Ersoy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rewrite Flatpak GUI mess (13/X):
* Refactor flatpakguiapp.py
üst
16c1b9df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
36 deletions
+17
-36
flatpakguiapp.py
pardusflatpakgui/flatpakguiapp.py
+15
-33
installfromfilewindow.py
pardusflatpakgui/installfromfilewindow.py
+2
-3
No files found.
pardusflatpakgui/flatpakguiapp.py
Dosyayı görüntüle @
04ddb942
...
...
@@ -38,61 +38,43 @@ gettext.install("pardus-flatpak-gui", "po/")
class
FlatpakGUIApp
(
Gtk
.
Application
):
def
__init__
(
self
,
application_id
,
flags
):
Gtk
.
Application
.
__init__
(
self
,
application_id
=
application_id
,
flags
=
flags
)
Gtk
.
Application
.
__init__
(
self
,
application_id
=
application_id
,
flags
=
flags
)
try
:
MessagesGUIF
ile
=
"ui/messagedialogs.glade"
MessagesBuilder
=
Gtk
.
Builder
.
new_from_file
(
MessagesGUIF
ile
)
MessagesB
uilder
.
connect_signals
(
self
)
messages_gui_f
ile
=
"ui/messagedialogs.glade"
messages_builder
=
Gtk
.
Builder
.
new_from_file
(
messages_gui_f
ile
)
messages_b
uilder
.
connect_signals
(
self
)
except
GLib
.
GError
:
print
(
_
(
"Error reading message dialogs GUI file: "
)
+
MessagesGUIF
ile
)
+
messages_gui_f
ile
)
raise
self
.
MessageDialogError
=
MessagesB
uilder
.
get_object
(
self
.
MessageDialogError
=
messages_b
uilder
.
get_object
(
"MessageDialogError"
)
self
.
connect
(
"activate"
,
self
.
new_window
)
def
new_window
(
self
,
*
args
):
def
new_window
(
self
,
application
):
if
len
(
sys
.
argv
)
==
1
:
MainWindow
(
self
)
elif
len
(
sys
.
argv
)
==
2
:
# FIXME: Fix running when argument count is 2.
self
.
FlatpakInstallation
=
Flatpak
.
Installation
.
new_system
()
self
.
FileFlatpakRefName
=
sys
.
argv
[
1
]
elif
len
(
sys
.
argv
)
==
2
:
file_name
=
sys
.
argv
[
1
]
try
:
self
.
FileFlatpakRef
=
open
(
self
.
FileFlatpakRefN
ame
,
"r"
)
file
=
open
(
file_n
ame
,
"r"
)
except
FileNotFoundError
:
self
.
MessageDialogError
.
set_markup
(
_
(
"<big><b>File Not Found Error</b></big>"
))
self
.
MessageDialogError
.
format_secondary_text
(
_
(
"File not found: "
)
+
self
.
FileFlatpakRefN
ame
)
_
(
"File not found: "
)
+
file_n
ame
)
self
.
MessageDialogError
.
run
()
self
.
MessageDialogError
.
hide
()
return
None
else
:
self
.
FileFlatpakRefContents
=
self
.
FileFlatpakRef
.
read
(
-
1
)
self
.
FileFlatpakRefContentsAsBytes
=
bytes
(
self
.
FileFlatpakRefContents
,
"utf-8"
)
self
.
FileFlatpakRefContentsAsGLibBytes
=
GLib
.
Bytes
.
new
(
self
.
FileFlatpakRefContentsAsBytes
)
self
.
AppToInstall
=
self
.
FlatpakInstallation
.
install_ref_file
(
self
.
FileFlatpakRefContentsAsGLibBytes
,
Gio
.
Cancellable
.
new
())
if
not
self
.
AppToInstall
.
get_kind
()
==
Flatpak
.
RefKind
.
APP
:
self
.
MessageDialogError
.
set_markup
(
_
(
"<big><b>Installing Error</b></big>"
))
self
.
MessageDialogError
.
format_secondary_text
(
_
(
"The selected file doesn't indicate a Flatpak application: "
)
+
self
.
FileFlatpakRefName
)
self
.
MessageDialogError
.
run
()
self
.
MessageDialogError
.
hide
()
return
None
file_contents
=
file
.
read
(
-
1
)
file_contents_bytes
=
bytes
(
file_contents
,
"utf-8"
)
file_contents_glib_bytes
=
GLib
.
Bytes
.
new
(
file_contents_bytes
)
InstallWindow
(
self
,
self
.
AppToInstall
,
self
.
FlatpakInstallation
,
None
)
InstallWindow
(
self
,
application
,
file_contents_glib_bytes
)
else
:
self
.
MessageDialogError
.
set_markup
(
_
(
"<big><b>Argument Error</b></big>"
))
...
...
pardusflatpakgui/installfromfilewindow.py
Dosyayı görüntüle @
04ddb942
...
...
@@ -35,9 +35,8 @@ _ = gettext.gettext
gettext
.
install
(
"pardus-flatpak-gui"
,
"po/"
)
class
InstallFromFileWindow2
(
object
):
def
__init__
(
self
,
application
,
flatpakinstallation
,
fileflatpakrefname
,
liststore
):
class
InstallFromFileWindow
(
object
):
def
__init__
(
self
,
application
,
file_contents
):
self
.
Application
=
application
self
.
FlatpakInstallation
=
flatpakinstallation
...
...
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