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

Commit

Permalink
Update note.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyscripts authored Feb 13, 2022
1 parent 98324cd commit 0395501
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions utils/note.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from .resourcePath import resource_path
import getpass

user_name = getpass.getuser()

class Note:
def get_note():
return open("data/note.txt").read()
return open(f"/users/{user_name}/Library/Application Support/BarNotes/note.txt").read()

def set_note(note):
if note == "":
note = "default note"
note = "Bar Notes"
note = note[:100]
with open("data/note.txt", "w") as f:
f.write(note)
with open(f"/users/{user_name}/Library/Application Support/BarNotes/note.txt", "w") as f:
f.write(note)

0 comments on commit 0395501

Please sign in to comment.