Skip to content

fixes #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 68 commits into from
Nov 1, 2022
Merged

fixes #169

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
ba975a5
tf 2.7
previ Jan 21, 2022
e437748
revert tf 2.1
previ Jan 22, 2022
9d5fdf4
bump numpy ver
previ Jan 23, 2022
7c7ee87
bump requirements_stub
previ Jan 24, 2022
ba9729e
bump requirements_stub
previ Jan 24, 2022
80c3b6f
led ws2812b
previ Jan 25, 2022
e14de56
led ws2812b
previ Jan 25, 2022
bcbba45
led ws2812b
previ Jan 25, 2022
f2c224a
led ws2812b
previ Jan 26, 2022
140285d
add listMusicPackages api
previ Jan 29, 2022
d88b342
fix musicPackage export
previ Jan 30, 2022
cfab93b
remove coderbot-copy.py
previ Jan 30, 2022
c90ccf8
fix music package removal
previ Feb 1, 2022
db7bfde
Merge branch 'develop' of https://github.com/CoderBotOrg/backend into…
previ Feb 1, 2022
1c69018
v1 feature parity
previ Feb 1, 2022
0cefff7
fix #155
previ Feb 6, 2022
a6eec09
fix program status and log with v2
previ Feb 7, 2022
d1d3882
update ci
previ Feb 8, 2022
55023d5
add default activity init
previ Mar 6, 2022
5763bc8
add default activity init
previ Mar 7, 2022
a3f291b
add default activity
previ Mar 9, 2022
ca1b990
activity default parameters
previ Mar 12, 2022
c096602
bullseye wip
previ May 28, 2022
fa63bb4
bullseye wip
previ May 29, 2022
5d50a5e
Update audioControls.py
previ May 29, 2022
0f3e5f6
bullseye wip
previ May 29, 2022
1266d83
Update audio.py
previ Jun 8, 2022
e032049
update stock activities
previ Jun 8, 2022
d58a6d8
Update program.py
previ Jun 11, 2022
94e2c76
Update activity_default.json
previ Jun 12, 2022
a1ec6ac
Update coderbot.py
previ Jun 18, 2022
ea027ed
no longer init_activities
previ Jun 28, 2022
c71cfc7
move init_activities on frontend for i18n
previ Jun 28, 2022
795fd4c
fix v4.1 bugs
previ Jul 3, 2022
06ad987
fix 4.1 bugs
previ Jul 3, 2022
a5699ba
fix 4.1 bugs
previ Jul 3, 2022
e6b0ffb
fix 4.1 bugs
previ Jul 3, 2022
0cadf12
fix 4.1 bugs
previ Jul 3, 2022
6dc5198
fix v4.1 bugs
previ Jul 3, 2022
94985a5
fix 4.1 bugs
previ Jul 4, 2022
76b850a
fix 4.1 bugs
previ Jul 4, 2022
216b1f8
fix 4.1 bugs
previ Jul 4, 2022
3dc0eb3
fix 4.1 bugs
previ Jul 5, 2022
02d3601
fix 4.1 bugs
previ Jul 6, 2022
5de8c00
Update wifi.py
previ Jul 7, 2022
86bcc8d
Update wifi.py
previ Jul 8, 2022
9ab32b3
add CONTRIBUTING.md (#162)
avivace Jul 8, 2022
66441fa
merge master
previ Jul 8, 2022
5454eaa
fix event
previ Aug 13, 2022
cc4792a
Refactor API (#166)
previ Oct 23, 2022
f378bd4
Refactor api v3 (#167)
previ Oct 25, 2022
0920d25
wip #164
previ Oct 26, 2022
e78c71f
wip #164
previ Oct 26, 2022
6a32faa
wip #164
previ Oct 26, 2022
a82fe38
wip #164
previ Oct 27, 2022
5f84450
wip #164
previ Oct 27, 2022
53537b3
wip #164
previ Oct 27, 2022
4b106cb
merge master into develop
previ Oct 27, 2022
5d37d71
status
previ Oct 30, 2022
154d61e
status
previ Oct 30, 2022
83af554
status
previ Oct 30, 2022
ba22222
status
previ Oct 30, 2022
45c7241
status
previ Oct 30, 2022
d685974
add stub
previ Oct 31, 2022
d7dfa33
stub
previ Oct 31, 2022
78fc103
remove unnecessary updatePckages dir
previ Nov 1, 2022
7eba733
merge master into develop
previ Nov 1, 2022
0aee02d
disable cicleci
previ Nov 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip #164
  • Loading branch information
previ committed Oct 26, 2022
commit 0920d25e976b51bc6f38f9f64b44527c26928cc9
14 changes: 2 additions & 12 deletions coderbot/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,21 +345,11 @@ def deleteMusicPackage(name):

## Programs

def saveAsNewProgram(body):
overwrite = body.get("overwrite")
existing_program = prog_engine.load(body.get("name"))
if existing_program and not overwrite:
return "askOverwrite"
elif existing_program and existing_program.is_default() == True:
return "defaultOverwrite"
program = Program(name=body.get("name"), code=body.get("code"), dom_code=body.get("dom_code"))
prog_engine.save(program)
return 200

def saveProgram(name, body):
overwrite = body.get("overwrite")
existing_program = prog_engine.load(name)
if existing_program and not overwrite:
logging.info("saving - name: %s, body: %s", name, str(existing_program))
if existing_program is not None and not overwrite:
return "askOverwrite"
elif existing_program and existing_program.is_default() == True:
return "defaultOverwrite"
Expand Down
24 changes: 4 additions & 20 deletions coderbot/v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,7 @@ paths:
responses:
200:
description: "ok"
post:
operationId: "api.saveAsNewProgram"
summary: "Save a new program"
tags:
- Program management
requestBody:
description: Optional description in *Markdown*
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Program'
responses:
200:
description: "ok"
400:
description: "Failed to save the program"

/programs/{name}:
get:
operationId: "api.loadProgram"
Expand Down Expand Up @@ -217,7 +201,7 @@ paths:
schema:
type: string
requestBody:
description: Optional description in *Markdown*
description: Program object
required: true
content:
application/json:
Expand All @@ -242,7 +226,7 @@ paths:
schema:
type: string
requestBody:
description: Optional description in *Markdown*
description: Program object
required: true
content:
application/json:
Expand Down Expand Up @@ -683,7 +667,7 @@ components:
minLength: 1
dom_code:
type: string
isDefualt:
default:
type: boolean
overwrite:
type: boolean
Expand Down