mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 22:52:42 +01:00
feat: uninstall wizard WIP
This commit is contained in:
1 parent
9f9a88d2ef
commit
c7bd6f635c
5 files changed
+293
-19
No files matched your search
+10
-14
@@ -8,30 +8,26 @@ from dzgui.init.prefix import get_version
|
||||
from dzgui.util.map_count import set_map_count
|
||||
from dzgui.util.strings import flags
|
||||
|
||||
from dzgui.views.dialogs.uninstall import UninstallWizard
|
||||
from dzgui.config.xdg import get_xdg_paths
|
||||
|
||||
parser = argparse.ArgumentParser(description=flags.description)
|
||||
parser.add_argument("-d", "--debug", action="store_true", help=flags.debug)
|
||||
parser.add_argument("-m", "--map", action="store_true", help=flags.map_count)
|
||||
parser.add_argument("-u", "--uninstall", action="store_true", help=flags.uninstall)
|
||||
parser.add_argument("-v", "--version", action="store_true", help=flags.version)
|
||||
group = parser.add_mutually_exclusive_group()
|
||||
group.add_argument("-d", "--debug", action="store_true", help=flags.debug)
|
||||
group.add_argument("-m", "--map", action="store_true", help=flags.map_count)
|
||||
group.add_argument("-u", "--uninstall", action="store_true", help=flags.uninstall)
|
||||
group.add_argument("-v", "--version", action="store_true", help=flags.version)
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
def uninstall() -> None:
|
||||
# TODO: uninstall data files (-u)
|
||||
# -u removes state, log, freedesktop
|
||||
# XDG_SHARE_HOME/dzgui
|
||||
# XDG_STATE_HOME/dzgui
|
||||
# XDG_DATA_HOME/dzgui
|
||||
pass
|
||||
|
||||
|
||||
def main() -> None:
|
||||
# TODO: isolate single flags
|
||||
if args.version is True:
|
||||
print(get_version())
|
||||
sys.exit(0)
|
||||
if args.uninstall is True:
|
||||
uninstall()
|
||||
paths = get_xdg_paths()
|
||||
UninstallWizard(False, paths)
|
||||
sys.exit(0)
|
||||
if args.debug is True:
|
||||
warnings.filterwarnings("default", category=DeprecationWarning)
|
||||
|
||||
Reference in new issue
Block a user