bubbles/python_modules/copy_files_specified.py

50 lines
1.8 KiB
Python
Raw Normal View History

2023-07-11 06:48:53 +00:00
"""
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* Move and copy files as needed
"""
import os
import shutil
from pathlib import Path
import paths
# If you need to add additional files you can do that as needed.
# you are not limited to what is currently listed.
BSTRING = paths.bstring_iso_configs
home_folder = Path( BSTRING ).expanduser()
def copy_specific_files():
"""Copy specific files"""
# Back to bubble
os.chdir(home_folder)
wp_chroot = paths.WPCHROOT
# Set the current working folder
cur_dir = os.getcwd().replace('/', '/')
shutil.copy(cur_dir + paths.src_alias, wp_chroot + paths.des_alias)
shutil.copy(cur_dir + paths.src_xdaily, wp_chroot + paths.des_xdaily)
shutil.copy(cur_dir + paths.src_hub, wp_chroot + paths.des_hub)
shutil.copy(cur_dir + paths.src_welcome, wp_chroot + paths.des_welcome)
shutil.copy(cur_dir + paths.src_kumo, wp_chroot + paths.des_kumo)
shutil.copy(cur_dir + paths.src_icon, wp_chroot + paths.des_icon)
# Took out as its an option, leaving here in case wanted later
#shutil.copy(cur_dir + paths.src_plank, wp_chroot + paths.des_plank)
shutil.copy(cur_dir + paths.src_lightdm, wp_chroot + paths.des_lightdm)
shutil.copy(cur_dir + paths.src_ply, cur_dir + paths.des_ply)
shutil.copy(cur_dir + paths.src_lightdm_greeter,
cur_dir + paths.des_lightdm_greeter
)
def set_symlinks():
""" Set any symlinks that are needed """
wp_chroot = paths.WPCHROOT
cur_dir = os.getcwd().replace('/', '/')
os.symlink('Debian.info', cur_dir + '/' + wp_chroot + paths.pep_info)
os.symlink('Debian.mirrors', cur_dir + '/' + wp_chroot + paths.pep_mirror)
os.symlink("debian.csv", cur_dir + '/' + wp_chroot + paths.pep_csv )