refactor: move files to git_monitor/ directory and add run.py

This commit is contained in:
2026-03-06 19:30:27 +01:00
parent d2556bf656
commit 1b6c7dcc01
9 changed files with 13 additions and 0 deletions

37
git_monitor/config.py Normal file
View File

@@ -0,0 +1,37 @@
import json
import os
CONFIG_FILE = "config.json"
class Config:
def __init__(self):
self.data = {
"repository_path": ""
}
self.load()
def load(self):
if os.path.exists(CONFIG_FILE):
try:
with open(CONFIG_FILE, "r") as f:
self.data = json.load(f)
except Exception as e:
print(f"Error loading config: {e}")
def save(self):
try:
with open(CONFIG_FILE, "w") as f:
json.dump(self.data, f, indent=4)
except Exception as e:
print(f"Error saving config: {e}")
@property
def repository_path(self):
return self.data.get("repository_path", "")
@repository_path.setter
def repository_path(self, value):
self.data["repository_path"] = value
self.save()
config = Config()