rename: cloud sync -> instance sync; cloud -> Timemachine Network; drop Tk
CI / test (3.10) (push) Successful in 7s
CI / test (3.11) (push) Successful in 7s
CI / test (3.12) (push) Successful in 7s
CI / build-pyz (push) Successful in 4s
CI / release (push) Has been skipped

Product / UI / CLI / docs rebrand. Internal package, repo, and
on-disk dir names stay 'cloud_sync' / 'cloud-sync' / '.cloud-sync/'
to avoid breaking existing installs; a future commit can do the
file-system rename when the cost is worth paying.

User-facing changes:
  CLI prog name:        cloud-sync     -> instance-sync
  CLI description:      cloud-svc URL  -> Timemachine Network endpoint
  Dialog title:         CLOUD SYNC     -> INSTANCE SYNC
  Dialog title:         CLOUD CONFLICT -> INSTANCE CONFLICT
  Dialog title:         CONNECT CLOUD SAVE -> CONNECT TO THE NETWORK
  Card label:           Cloud Save     -> Remote Save
  Skip button:          Skip cloud sync -> Skip instance sync
  Body copy:            'the cloud'    -> 'the Timemachine Network'
  Window titles:        Cloud sync — ... -> Instance sync — ...
  Log prefix:           cloud-sync:    -> instance-sync:
  Error prose:          'cloud-sync token' -> 'instance-sync token'

Backend changes:
  restic --host tag:    cloud-sync     -> instance-sync
  State.host_tag dflt:  cloud-sync     -> instance-sync
  (Existing snapshots with the old tag still pull fine; we use 'latest'.)

Drop tkinter fallback: ui.py now offers Qt OR Headless. tkinter is
unnecessary given we already maintain Qt + headless; one less code
path to keep styled, smaller pyz. make_progress() picks Qt first,
falls through to HeadlessProgress on ImportError with a stderr hint
to 'pip install PySide6'.

README: rebrand title + prose; note repo/dir rename deferred; call
out the PySide6 install step. Conflict/login dialogs are now Qt-only;
without Qt, conflict aborts (defensive) and login tells the user to
paste the token manually.

52 tests green; no test-file label changes needed since they only
exercise internal APIs.
This commit is contained in:
2026-06-05 01:14:02 +02:00
parent f1cb9f4b86
commit b31fdd023a
10 changed files with 99 additions and 232 deletions
+14 -14
View File
@@ -44,7 +44,7 @@ def pull(args: Args, progress: Progress | None = None) -> int:
if not args.token_file.exists():
if not _prompt_login_and_save(args, ui):
ui.set_status("Cloud sync skipped")
print("cloud-sync: no token; skipping pull")
print("instance-sync: no token; skipping pull")
return 0
ui.set_status("Reading credentials…")
@@ -66,7 +66,7 @@ def pull(args: Args, progress: Progress | None = None) -> int:
return 1
if code != 0:
print(
f"cloud-sync: failed to list snapshots (restic exit {code})",
f"instance-sync: failed to list snapshots (restic exit {code})",
file=sys.stderr,
)
return 2
@@ -75,7 +75,7 @@ def pull(args: Args, progress: Progress | None = None) -> int:
if not snapshots:
statemod.clear(args.pack_folder)
ui.set_status("No snapshots yet — nothing to pull")
print("cloud-sync: no snapshots yet for this user; nothing to pull")
print("instance-sync: no snapshots yet for this user; nothing to pull")
return 0
remote = snapshots[0]
@@ -90,7 +90,7 @@ def pull(args: Args, progress: Progress | None = None) -> int:
decision = "use_remote"
elif local_state.last_pulled_snapshot_id == remote_id:
ui.set_status("Cloud is up to date")
print("cloud-sync: already at latest snapshot")
print("instance-sync: already at latest snapshot")
return 0
else:
modified = _find_modified_in_scope(
@@ -104,7 +104,7 @@ def pull(args: Args, progress: Progress | None = None) -> int:
# UI unavailable in headless mode → conservative: cancel
ui.set_status("Conflict detected; no UI available")
print(
"cloud-sync: conflict detected (remote moved + local edits) "
"instance-sync: conflict detected (remote moved + local edits) "
"but headless mode can't prompt; aborting",
file=sys.stderr,
)
@@ -115,7 +115,7 @@ def pull(args: Args, progress: Progress | None = None) -> int:
return 1
if decision == "keep_local":
ui.set_status("Keeping local; push will overwrite cloud on exit")
print("cloud-sync: keeping local copy")
print("instance-sync: keeping local copy")
return 0
# decision == "use_remote"
@@ -135,7 +135,7 @@ def pull(args: Args, progress: Progress | None = None) -> int:
if code == -1:
return 1
if code != 0:
print(f"cloud-sync: restic restore failed (exit {code})", file=sys.stderr)
print(f"instance-sync: restic restore failed (exit {code})", file=sys.stderr)
return 2
statemod.write(
@@ -146,7 +146,7 @@ def pull(args: Args, progress: Progress | None = None) -> int:
),
)
ui.set_status("Pull complete")
print("cloud-sync: pull ok")
print("instance-sync: pull ok")
return 0
@@ -154,8 +154,8 @@ def push(args: Args, progress: Progress | None = None) -> int:
ui = progress or HeadlessProgress()
if not args.token_file.exists():
ui.set_status("No cloud token; skipping push")
print("cloud-sync: no token; skipping push")
ui.set_status("No network token; skipping push")
print("instance-sync: no token; skipping push")
return 0
ui.set_status("Reading credentials…")
@@ -177,7 +177,7 @@ def push(args: Args, progress: Progress | None = None) -> int:
"backup",
"--files-from", str(files_from),
"--exclude-file", str(exclude_from),
"--host", "cloud-sync",
"--host", "instance-sync",
"--tag", "auto",
"--json",
],
@@ -188,7 +188,7 @@ def push(args: Args, progress: Progress | None = None) -> int:
if code == -1:
return 1
if code != 0:
print(f"cloud-sync: restic backup failed (exit {code})", file=sys.stderr)
print(f"instance-sync: restic backup failed (exit {code})", file=sys.stderr)
return 2
new_id = _parse_backup_summary(out)
@@ -201,7 +201,7 @@ def push(args: Args, progress: Progress | None = None) -> int:
),
)
ui.set_status("Push complete")
print("cloud-sync: push ok")
print("instance-sync: push ok")
return 0
@@ -311,7 +311,7 @@ def _prompt_login_and_save(args: Args, ui: Progress) -> bool:
except ImportError:
ui.set_status("No token and no UI; can't prompt")
print(
"cloud-sync: no token at "
"instance-sync: no token at "
f"{args.token_file} and no Qt UI available",
file=sys.stderr,
)