Update parser and new feature

This commit is contained in:
2022-10-07 17:50:42 +03:00
parent ae25f2e2a5
commit 8f0c7e0d9a
10 changed files with 83 additions and 35 deletions

22
utils/misc.py Normal file
View File

@@ -0,0 +1,22 @@
import os
import sys
from typing import Union
import git
class Update:
def __init__(self, name: Union[str, None] = None) -> None:
self.name = name or 'origin'
print(f"Name: {self.name}")
def git_update(self):
repo = git.Repo('.')
r = git.Remote(repo, self.name)
r.pull()
@staticmethod
def restart_bot():
os.execvp(sys.executable, [sys.executable, sys.argv[0]])