Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PizzaPalace
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TheJoeCoder
PizzaPalace
Commits
14e1da3a
Verified
Commit
14e1da3a
authored
Jun 30, 2023
by
TheJoeCoder
Browse files
Options
Downloads
Patches
Plain Diff
[Frontend] Add sessions and pizza
parent
7293ecb1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/pizza_palace.py
+17
-4
17 additions, 4 deletions
client/pizza_palace.py
with
17 additions
and
4 deletions
client/pizza_palace.py
+
17
−
4
View file @
14e1da3a
...
...
@@ -12,6 +12,8 @@ logger.setLevel(logging.DEBUG)
## Global Variables
connect_url
=
StringVar
()
pizzas
=
[]
cart_id
=
""
cart_key
=
""
...
...
@@ -84,17 +86,28 @@ def connect(*args):
# Create new session
def
new_session
(
*
arg
):
global
cart_id
,
cart_key
res
=
requests
.
post
(
get_endpoint
(
"
/cart/new
"
))
if
(
res
.
status_code
==
200
):
# TODO parse response
pass
res_json
=
res
.
json
()
if
(
res_json
!=
None
and
res_json
[
"
status
"
]
==
200
):
cart_id
,
cart_key
=
res_json
[
"
id
"
],
res_json
[
"
key
"
]
return
True
else
:
connect_fail
()
return
False
else
:
connect_fail
()
return
False
# Refresh order screen items
def
refresh_items
(
*
args
):
# TODO get /pizzas from server
pass
global
pizzas
res
=
requests
.
get
(
get_endpoint
(
"
/pizzas
"
))
if
(
res
.
status_code
==
200
and
res
.
json
()
!=
None
):
pizzas
=
res
.
json
()
else
:
connect_fail
()
## Main program code
# Window setup
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment