Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

Commit 0395501

Browse files
authored
Update note.py
1 parent 98324cd commit 0395501

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

utils/note.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
from .resourcePath import resource_path
1+
import getpass
2+
3+
user_name = getpass.getuser()
24

35
class Note:
46
def get_note():
5-
return open("data/note.txt").read()
7+
return open(f"/users/{user_name}/Library/Application Support/BarNotes/note.txt").read()
68

79
def set_note(note):
810
if note == "":
9-
note = "default note"
11+
note = "Bar Notes"
1012
note = note[:100]
11-
with open("data/note.txt", "w") as f:
12-
f.write(note)
13+
with open(f"/users/{user_name}/Library/Application Support/BarNotes/note.txt", "w") as f:
14+
f.write(note)

0 commit comments

Comments
 (0)