def _run_desktop_install(desktop): """ Installs the .desktop file in its install dir. """ path = DotDesktopModel.INSTALL_DIR + desktop.name + ".desktop" desktop_contents = str(desktop) utils.proc_file("write", path, desktop_contents, desktop.name + ".desktop installed!", "!!Issue installing .desktop!!")
def _run_remove_icon(program): """ Removes the icon from its install dir. Iterates through all possible icon sizes and formats until it finds a match. It then removes this file and returns. """ for icon_size in const.ICON_SIZES: tmp_dir = IconModel.INSTALL_DIR.format(icon_size=icon_size) for icon_type in const.ICON_TYPES: tmp_path = tmp_dir + program + icon_type if utils.file_exists(tmp_path): utils.proc_file("remove", tmp_path, msg=program + icon_type + " removed!", error="!!Issue removing "+program+icon_type+"!!") return
def _run_icon_install(icon): """ Installs the icon in its install dir. """ install_path = str(icon) utils.proc_file("copy", icon.icon_to_install, install_path, icon.icon_name + icon.icon_type + " installed!", "!!Issue installing icon!!")
def _run_remove_desktop(program): """ Removes the .desktop file from its install dir. """ utils.proc_file("remove", DotDesktopModel.INSTALL_DIR + program + ".desktop", msg=program + ".desktop removed!", error="!!Issue removing " + program + ".desktop!!")