Working with queues on bubbles

Testing the 64 build with that data structure

Signed-off-by: debianpepper <peppermintosteam@proton.me>
This commit is contained in:
debianpepper 2023-08-05 17:44:26 +09:00
parent c229818b79
commit 6c02495181
2 changed files with 118 additions and 67 deletions

View File

@ -32,6 +32,8 @@ def check_packages():
backup_tool['state'] = tk.DISABLED
if os.path.exists('/usr/bin/gnome-software'):
store['state'] = tk.DISABLED
if os.path.exists('/usr/bin/keepassxc'):
store['state'] = tk.DISABLED
def check_web_browsers():
@ -61,6 +63,14 @@ def install_atril():
check_packages()
def install_keepass():
""" Install KeePass """
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"keepassxc"]
)
check_packages()
def install_parole():
""" Install parole """
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
@ -166,6 +176,78 @@ def install_falkon():
check_web_browsers()
def check_base_snaps():
""" If Devuan is loaded do not show snaps """
if os.path.exists("/etc/devuan_version"):
flatpak = ttk.Button(software_frame,
text="Flatpak Package Platform",
cursor="hand2", style="dark",
command=install_flatpak
)
flatpak.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
store = ttk.Button(software_frame,
text="Gnome Software Store",
cursor="hand2", style="dark",
command=install_store
)
store.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
backup_tool = ttk.Button(software_frame,
text="TimeShift: Backup Tool",
cursor="hand2", style="dark",
command=install_keepass
)
backup_tool.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
pwd_tool = ttk.Button(software_frame,
text="KeePassXC: Password Tool",
cursor="hand2", style="dark",
command=install_timeshift
)
pwd_tool.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
elif os.path.exists("/etc/debian_version"):
snap = ttk.Button(software_frame,
text="Snap Package Platform",
cursor="hand2", style="dark",
command=install_snap
)
snap.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
flatpak = ttk.Button(software_frame,
text="Flatpak Package Platform",
cursor="hand2", style="dark",
command=install_flatpak
)
flatpak.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
store = ttk.Button(software_frame,
text="Gnome Software Store",
cursor="hand2", style="dark",
command=install_store
)
store.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
backup_tool = ttk.Button(software_frame,
text="TimeShift: Backup Tool",
cursor="hand2", style="dark",
command=install_timeshift
)
backup_tool.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
# *** Below here is the layout of the forms***
# Frame that managed the Welcome To Peppermint Section
fsw = ttk.Frame(pwin, width=200)
@ -195,32 +277,7 @@ fire_wall = ttk.Button(software_frame, text="gufw: GNU Firewall",
fire_wall.grid(row=3, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
snap = ttk.Button(software_frame, text="Snap Package Platform",
cursor="hand2", style="dark", command=install_snap
)
snap.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
flatpak = ttk.Button(software_frame, text="Flatpak Package Platform",
cursor="hand2", style="dark", command=install_flatpak
)
flatpak.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
store = ttk.Button(software_frame, text="Gnome Software Store",
cursor="hand2", style="dark", command=install_store
)
store.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
backup_tool = ttk.Button(software_frame, text="TimeShift: Backup Tool",
cursor="hand2", style="dark",
command=install_timeshift
)
backup_tool.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
# Frame that manages the Community buttons
# Frame that manages the Browser buttons
fs = ttk.Frame(pwin)
fs.grid(row=2, column=5, columnspan=2, ipadx=0, ipady=0, padx=10, pady=10)
@ -269,6 +326,7 @@ lblpmtitle = ttk.Label(pwin, style="F62817.TLabel",
text='These suggestions are listed in the official'
' repositories'
).place(x=5, y=440)
check_base_snaps()
check_packages()
check_web_browsers()
pwin.mainloop()

View File

@ -14,7 +14,7 @@ import inflate_bubble
import finish_cleanup
import copy_folders
import copy_files_specified
import queue
# Set the home path used regardless the user logged in
BSTRING = paths.bstring_iso_configs
@ -40,46 +40,39 @@ def lbinit():
def copy_deb64_specific():
"""" Debian 64 copy jobs"""
shutil.copytree(cur_dir + paths.src_deb64_osrelease,
WP_CHROOT + paths.des_osrelease,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb64_osrelease,
WP_CHROOT + paths.des_osrelease_opt,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb64_slpash,
cur_dir + paths.des_splash,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb64_isolinux,
cur_dir + paths.des_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb64_multi,
cur_dir + paths.des_archives,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_grub_theme,
WP_CHROOT + paths.des_grub_theme,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb64_modules,
WP_CHROOT + paths.des_modules,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_splash_image,
cur_dir + paths.des_splash_image_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_splash_image,
cur_dir + paths.des_splash_image_grub,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_live_theme,
cur_dir + paths.des_live_theme,
dirs_exist_ok=True
)
source_q = queue.Queue()
destination_q = queue.Queue()
source_q.put("src_deb64_osrelease")
source_q.put("src_deb64_osrelease")
source_q.put("src_deb64_slpash")
source_q.put("src_deb64_isolinux")
source_q.put("src_deb64_multi")
source_q.put("src_deb_grub_theme")
source_q.put("src_deb64_modules")
source_q.put("src_deb_splash_image")
source_q.put("src_deb_splash_image")
source_q.put("src_deb_live_theme")
destination_q.put("des_osrelease")
destination_q.put("des_osrelease_opt")
destination_q.put("des_splash")
destination_q.put("des_isolinux")
destination_q.put("des_archives")
destination_q.put("des_grub_theme")
destination_q.put("des_modules")
destination_q.put("des_splash_image_isolinux")
destination_q.put("des_splash_image_grub")
destination_q.put("des_live_theme")
src_size = source_q.qsize()
for p in range(src_size):
x = source_q.get()
y = destination_q.get()
shutil.copytree(cur_dir + 'paths.' + x,
WP_CHROOT + 'paths.' + y,
dirs_exist_ok=True
)
shutil.copy(cur_dir + paths.src_deb64_grub_etc,
WP_CHROOT + paths.des_grub_etc
)