Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Traceback (most recent call last):
- File "/home/denny/Project/Python/.dotfiles/backup.py", line 75, in <module>
- origin.push()
- File "/home/denny/Project/Python/.dotfiles/venv/lib/python3.12/site-packages/git/remote.py", line 1203, in push
- return self._get_push_info(proc, progress, kill_after_timeout=kill_after_timeout)
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- File "/home/denny/Project/Python/.dotfiles/venv/lib/python3.12/site-packages/git/remote.py", line 968, in _get_push_info
- proc.wait(stderr=stderr_text)
- File "/home/denny/Project/Python/.dotfiles/venv/lib/python3.12/site-packages/git/cmd.py", line 834, in wait
- raise GitCommandError(remove_password_if_present(self.args), status, errstr)
- git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
- cmdline: git push --porcelain -- origin
- stderr: 'error: RPC failed; HTTP 500 curl 92 HTTP/2 stream 7 was not closed cleanly: CANCEL (err 8)
- fatal: the remote end hung up unexpectedly'
- ====================
- repo = Repo('./')
- origin = repo.remote('origin')
- ##########################
- # FUNCTIONS #
- ##########################
- def enhanced_copy(src, dst, key):
- try:
- if isdir(src):
- copytree(src, dst, symlinks=True, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False, dirs_exist_ok=False)
- else:
- makedirs(dirname(dst), exist_ok=True)
- copy2(src, dst)
- except (FileNotFoundError, FileExistsError) as err:
- with open(f"{key}/log.txt", 'a+') as log:
- log.write(f'src: {src} - dst: {dst}\n{err}\n\n')
- def apply_config(key):
- config = configFile.configs.get(key)
- if config:
- config['msg']
- paths = config['path']
- rmtree(key, ignore_errors=True)
- makedirs(key, exist_ok=True)
- for path in paths:
- print(f"start saving {path} folder")
- with tqdm(total=len(paths[path])) as progressBar:
- for file in paths[path]:
- enhanced_copy(f"{path}/{file}", f"{key}/{path[1:]}/{file}", key)
- sleep(0.01)
- progressBar.update(1)
- commit(key, f"update {path} folder in {key} dotfile")
- def commit(src, msg):
- for i in glob(join(src, '.*')) + glob(join(src, '*')):
- repo.index.add(i)
- print(f'{i} folder added to local repository')
- repo.index.commit(msg)
- print("commits mades")
- ##########################
- # STARTUP #
- ##########################
- #TODO: DA AUTOMATIZZARE
- choise = int(input('do you want to update KDE config or hyprland config?\n[1] KDE plasma\n[2] HyprlandWM\n'))
- system('clear')
- if choise == 1:
- apply_config("kde")
- elif choise == 2:
- apply_config("hyprland")
- else:
- print('unhandled input')
- exit(1)
- origin.push()
- print("local repository pushed on github")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement