mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
fix: Rename uuid_file
to data_file
for consistency
This commit is contained in:
parent
1567d3e3d1
commit
e07194bbeb
1 changed files with 8 additions and 8 deletions
|
@ -26,19 +26,19 @@ class Analytics:
|
||||||
self.user_id = self.get_or_create_uuid()
|
self.user_id = self.get_or_create_uuid()
|
||||||
|
|
||||||
def mark_as_disabled(self):
|
def mark_as_disabled(self):
|
||||||
uuid_file = Path.home() / ".aider" / "caches" / "mixpanel.json"
|
data_file = Path.home() / ".aider" / "caches" / "mixpanel.json"
|
||||||
uuid_file.parent.mkdir(parents=True, exist_ok=True)
|
data_file.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
data = {"uuid": str(uuid.uuid4()), "disabled": True}
|
data = {"uuid": str(uuid.uuid4()), "disabled": True}
|
||||||
with open(uuid_file, "w") as f:
|
with open(data_file, "w") as f:
|
||||||
json.dump(data, f)
|
json.dump(data, f)
|
||||||
|
|
||||||
def get_or_create_uuid(self):
|
def get_or_create_uuid(self):
|
||||||
uuid_file = Path.home() / ".aider" / "caches" / "mixpanel.json"
|
data_file = Path.home() / ".aider" / "caches" / "mixpanel.json"
|
||||||
uuid_file.parent.mkdir(parents=True, exist_ok=True)
|
data_file.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
if uuid_file.exists():
|
if data_file.exists():
|
||||||
with open(uuid_file, "r") as f:
|
with open(data_file, "r") as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
if "disabled" in data and data["disabled"]:
|
if "disabled" in data and data["disabled"]:
|
||||||
self.disable = True
|
self.disable = True
|
||||||
|
@ -46,7 +46,7 @@ class Analytics:
|
||||||
return data["uuid"]
|
return data["uuid"]
|
||||||
|
|
||||||
new_uuid = str(uuid.uuid4())
|
new_uuid = str(uuid.uuid4())
|
||||||
with open(uuid_file, "w") as f:
|
with open(data_file, "w") as f:
|
||||||
json.dump({"uuid": new_uuid}, f)
|
json.dump({"uuid": new_uuid}, f)
|
||||||
|
|
||||||
return new_uuid
|
return new_uuid
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue