Spaces:
Sleeping
Sleeping
Keith Bourne commited on
Commit 路
f89f51f
1
Parent(s): 1d2f8ff
Add more GS code 12
Browse files
app.py
CHANGED
|
@@ -47,7 +47,29 @@ repo = Repository(
|
|
| 47 |
)
|
| 48 |
print("repo connection: ", repo)
|
| 49 |
|
|
|
|
|
|
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
# Create or clone a repo using Repository app.py 路 julien-c/persistent-data at main 5.
|
| 53 |
# These methods use a token HF_TOKEN which is passed as a secret from the Hub.
|
|
|
|
| 47 |
)
|
| 48 |
print("repo connection: ", repo)
|
| 49 |
|
| 50 |
+
name = "bot"
|
| 51 |
+
message = "beep boop"
|
| 52 |
|
| 53 |
+
with open(DATA_FILE, "a") as csvfile:
|
| 54 |
+
writer = csv.DictWriter(csvfile, fieldnames=["name", "message", "time"])
|
| 55 |
+
writer.writerow(
|
| 56 |
+
{"name": name, "message": message, "time": str(datetime.now())}
|
| 57 |
+
)
|
| 58 |
+
commit_url = repo.push_to_hub()
|
| 59 |
+
print(commit_url)
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
# def store_message(name: str, message: str):
|
| 63 |
+
# if name and message:
|
| 64 |
+
# with open(DATA_FILE, "a") as csvfile:
|
| 65 |
+
# writer = csv.DictWriter(csvfile, fieldnames=["name", "message", "time"])
|
| 66 |
+
# writer.writerow(
|
| 67 |
+
# {"name": name, "message": message, "time": str(datetime.now())}
|
| 68 |
+
# )
|
| 69 |
+
# commit_url = repo.push_to_hub()
|
| 70 |
+
# print(commit_url)
|
| 71 |
+
|
| 72 |
+
# return generate_html()
|
| 73 |
|
| 74 |
# Create or clone a repo using Repository app.py 路 julien-c/persistent-data at main 5.
|
| 75 |
# These methods use a token HF_TOKEN which is passed as a secret from the Hub.
|