Esempio n. 1
0
def bu_uncatalogued_photos(tranche, source_dir_path: WindowsPath,
                           destination_dir: WindowsPath,
                           backup_options: BackupOptions):
    for t in tranche:
        src = WindowsPath(source_dir_path, t)
        options_list = ["-archW"
                        ] + backup_options_to_rsync_options(backup_options)
        home = WindowsPath.home()
        cmd_list = cygwin.rsync_cmd(options_list, home, src, destination_dir)
        # buph_logger.info("bu_catalogued_photos       %s" %(" ".join(cmd_list)))
        if try_popen(cmd_list, str(WindowsPath.home())) != 0:
            raise Exception("try_popen returns rc != 0")
Esempio n. 2
0
    def warehouse():
        if platform.system() == 'Windows':
            out_dir = Path(WindowsPath.home() / "Documents" / "Data")
            out_dir.mkdir(parents=True, exist_ok=True)
        else:
            # out_dir = Path(Path.home() / "Documents" / "Data")
            out_dir = Path("/mnt/c/Users/morris/Documents/Data")
            out_dir.mkdir(parents=True, exist_ok=True)

        return out_dir
Esempio n. 3
0
 def __init__(self):
     """get the default inifile:
     In the users home diretory/.natlink  the ini file natlinkstatus.ini
     with section defaultSection
     """
     natlink_ini_path = WindowsPath.home() / ".natlink"
     if not natlink_ini_path.is_dir():
         raise ValueError(f"Natlink folder  {natlink_ini_path} missing.")
     filename = str(natlink_ini_path / defaultFilename)
     InifileSection.__init__(self,
                             section=defaultSection,
                             filename=filename)