File: lomiri-clock-app-migrate.py

package info (click to toggle)
lomiri-clock-app 4.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,788 kB
  • sloc: cpp: 1,600; python: 732; javascript: 74; sh: 55; makefile: 16
file content (19 lines) | stat: -rwxr-xr-x 608 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python3

import os
import sys
from pathlib import Path

organization = "clock.ubports"
application = "clock.ubports"
old_application = "com.ubuntu.clock"

xdg_config_home = Path(os.environ.get("XDG_CONFIG_HOME",
                                      Path.home() / ".config"))
old_config_file = xdg_config_home / organization / f"{old_application}.conf"
new_config_file = xdg_config_home / organization / f"{application}.conf"
if old_config_file.is_file() and not new_config_file.exists():
    old_config_file.rename(new_config_file)

if len(sys.argv) > 1:
    os.execvp(sys.argv[1], sys.argv[1:])