dar-backup 0.6.21__py3-none-any.whl → 0.7.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dar_backup/manager.py CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env python3
2
+ # SPDX-License-Identifier: GPL-3.0-or-later
2
3
 
3
4
  """
4
5
  Copyright (C) 2024 Per Jensen
@@ -559,12 +560,12 @@ def main():
559
560
  args.verbose and start_msgs.append(("Backup dir:", config_settings.backup_dir))
560
561
  start_msgs.append(("Logfile:", config_settings.logfile_location))
561
562
  args.verbose and start_msgs.append(("--alternate-archive-dir:", args.alternate_archive_dir))
562
- args.verbose and start_msgs.append(("--cleanup-specific-archives:", args.cleanup_specific_archives))
563
+ args.verbose and start_msgs.append(("--remove-specific-archive:", args.remove_specific_archive))
563
564
  dar_manager_properties = get_binary_info(command='dar_manager')
564
565
  start_msgs.append(("dar_manager:", dar_manager_properties['path']))
565
566
  start_msgs.append(("dar_manager v.:", dar_manager_properties['version']))
566
567
 
567
- print_aligned_settings(start_msgs)
568
+ print_aligned_settings(start_msgs, quiet=not args.verbose)
568
569
 
569
570
  # --- Sanity checks ---
570
571
  if args.add_dir and not args.add_dir.strip():
@@ -1,3 +1,6 @@
1
+ #!/usr/bin/env python3
2
+ # SPDX-License-Identifier: GPL-3.0-or-later
3
+
1
4
  import os
2
5
  import time
3
6
  from threading import Event
dar_backup/util.py CHANGED
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: GPL-3.0-or-later
2
+
1
3
  """
2
4
  util.py source code is here: https://github.com/per2jensen/dar-backup
3
5
 
@@ -19,11 +21,14 @@ import shutil
19
21
  import sys
20
22
  import threading
21
23
  import traceback
24
+
25
+ import dar_backup.__about__ as about
26
+
27
+
22
28
  from argcomplete.completers import ChoicesCompleter
23
29
  from datetime import datetime
24
30
  from dar_backup.config_settings import ConfigSettings
25
- import dar_backup.__about__ as about
26
-
31
+ from pathlib import Path
27
32
  from rich.console import Console
28
33
  from rich.text import Text
29
34
 
@@ -606,6 +611,7 @@ def print_aligned_settings(
606
611
  settings: List[Tuple[str, str]],
607
612
  log: bool = True,
608
613
  header: str = "Startup Settings",
614
+ quiet: bool = True,
609
615
  highlight_keywords: List[str] = None
610
616
  ) -> None:
611
617
  """
@@ -624,7 +630,7 @@ def print_aligned_settings(
624
630
  header_line = f"========== {header} =========="
625
631
  footer_line = "=" * len(header_line)
626
632
 
627
- console.print(f"[bold cyan]{header_line}[/bold cyan]")
633
+ not quiet and console.print(f"[bold cyan]{header_line}[/bold cyan]")
628
634
  if log and logger:
629
635
  logger.info(header_line)
630
636
 
@@ -654,13 +660,26 @@ def print_aligned_settings(
654
660
 
655
661
  line_text.append(text, style="white")
656
662
 
657
- console.print(line_text)
663
+ not quiet and console.print(line_text)
658
664
 
659
665
  # Always log clean text (no [!] in log)
660
666
  final_line_for_log = f"{padded_label} {text}"
661
667
  if log and logger:
662
668
  logger.info(final_line_for_log)
663
669
 
664
- console.print(f"[bold cyan]{footer_line}[/bold cyan]")
670
+ not quiet and console.print(f"[bold cyan]{footer_line}[/bold cyan]")
665
671
  if log and logger:
666
672
  logger.info(footer_line)
673
+
674
+
675
+
676
+
677
+ def normalize_dir(path: str) -> str:
678
+ """
679
+ Strip any trailing slash/backslash but leave root (“/” or “C:\\”) intact.
680
+ """
681
+ p = Path(path)
682
+ # Path(__str__) drops any trailing separators
683
+ normalized = str(p)
684
+ return normalized
685
+