CaesarCloudSync commited on
Commit
d271195
1 Parent(s): 409c4ed

CaesarFinance setup code implemented

Browse files
Files changed (2) hide show
  1. CaesarFinance/caesarfinance.py +3 -3
  2. main.py +19 -18
CaesarFinance/caesarfinance.py CHANGED
@@ -34,9 +34,9 @@ if __name__ == "__main__":
34
  while access_code_bool == False:
35
  access_code_bool = caesarfinance.create_access_code()
36
 
37
- code = caesarfinance.fetch_access_code()
38
- access_token = caesarfinance.get_access_token(code)
39
- print(access_token)
40
 
41
 
42
  #caesarfinance.get_access_code()
 
34
  while access_code_bool == False:
35
  access_code_bool = caesarfinance.create_access_code()
36
 
37
+ #code = caesarfinance.fetch_access_code()
38
+ #access_token = caesarfinance.get_access_token(code)
39
+ #print(access_token)
40
 
41
 
42
  #caesarfinance.get_access_code()
main.py CHANGED
@@ -54,24 +54,25 @@ def caesaraihome():
54
  @app.get("/caesarailogo")
55
  def caesarailogo():
56
  return FileResponse(f"{CURRENT_DIR}/CaesarAILogo.png")
57
- @app.get("/caesaraisavecode")
58
- def caesaraisavecode(code: Union[str,None]):
59
- if code != None:
60
- with open(f"{CURRENT_DIR}/CaesarFinance/current_code.txt","w+") as f:
61
- f.write(code)
62
- return {"message":"Temporary fetching code stored."}
63
- elif code== None:
64
- return {"message":"code doesn't exist."}
65
- @app.get("/caesaraigetcode")
66
- def caesaraigetcode():
67
- if "current_code.txt" in os.listdir(f"{CURRENT_DIR}/CaesarFinance"):
68
- f = open(f"{CURRENT_DIR}/CaesarFinance/current_code.txt","r")
69
- code = f.read()
70
- f.close()
71
- os.remove(f"{CURRENT_DIR}/CaesarFinance/current_code.txt")
72
- return {"messagecode":code}
73
- elif "current_code.txt" not in os.listdir(f"{CURRENT_DIR}/CaesarFinance"):
74
- return {"message":"temporary code doesn't exist. Please authenticate"}
 
75
 
76
  @app.websocket("/caesarobjectdetectws")
77
  async def caesarobjectdetectws(websocket: WebSocket):
 
54
  @app.get("/caesarailogo")
55
  def caesarailogo():
56
  return FileResponse(f"{CURRENT_DIR}/CaesarAILogo.png")
57
+
58
+ #@app.get("/caesaraisavecode")
59
+ #def caesaraisavecode(code: Union[str,None]):
60
+ # if code != None:
61
+ # with open(f"{CURRENT_DIR}/CaesarFinance/current_code.txt","w+") as f:
62
+ # f.write(code)
63
+ # return {"message":"Temporary fetching code stored."}
64
+ # elif code== None:
65
+ # return {"message":"code doesn't exist."}
66
+ #@app.get("/caesaraigetcode")
67
+ #def caesaraigetcode():
68
+ # if "current_code.txt" in os.listdir(f"{CURRENT_DIR}/CaesarFinance"):
69
+ # f = open(f"{CURRENT_DIR}/CaesarFinance/current_code.txt","r")
70
+ # code = f.read()
71
+ # f.close()
72
+ # os.remove(f"{CURRENT_DIR}/CaesarFinance/current_code.txt")
73
+ # return {"messagecode":code}
74
+ # elif "current_code.txt" not in os.listdir(f"{CURRENT_DIR}/CaesarFinance"):
75
+ # return {"message":"temporary code doesn't exist. Please authenticate"}
76
 
77
  @app.websocket("/caesarobjectdetectws")
78
  async def caesarobjectdetectws(websocket: WebSocket):