Skip to content

Commit da73a33

Browse files
authored
Scene interpreter (#156)
* execution toggle * deploy scenes.json * bootstrap rendering interpreted scenes * some clarity * gradient * e2e tests for both scene types * data gradient * values * app exports * tag'em * works with a gradient * app loader basics * app loaders * some basic json interpretation * more snap changes * log faster * less lazy * python 3.12 * seq fields * field nodes * all apps * fix color defaults * more working * state and scene nodes * state works * basic caching * actually evaluate some js * add submodule * subs * deploy quickjs * add noise * inline burrito instead * search for scenes * nix deploys work * this works * js types * remove global vars * float plus code node args * better script * render as a function * cleanup * slight touchup * undef * dataNewImage * split loop * all scens * no full redeploy if interpreted * ts fix * upgrade pillow * build with quickjs * split in two * chjanges * refresh repos * enough for the xkcd scene * dispatch * image url * use the latest quickjs * textarea focus scroll * split js runtime * fix * tz * tz fix * code node log output frontend * log code node outputs * a bit of frontend cleanup * disable a bunch of logging * less noise * Revert "use the latest quickjs" This reverts commit 4d6e3ec. * misc cleanup * take out the trash * scene nodes work in all directions * type fix * fix color input * use bg color for scene nodes * show saved and unsaved states * better differ * fix panel bug * parseJson * js * js scene state * remove modules * misc cleanup * fix
1 parent 97aadf0 commit da73a33

File tree

131 files changed

+6049
-454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+6049
-454
lines changed

.github/workflows/docker-publish-multi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Python
1616
uses: actions/setup-python@v2
1717
with:
18-
python-version: '3.11'
18+
python-version: '3.12'
1919

2020
- name: Set up Node
2121
uses: actions/setup-node@v2

.github/workflows/e2e-docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
steps:
1313
- name: Check out repository
1414
uses: actions/checkout@v3
15+
with:
16+
submodules: true # Fetch submodules
1517

1618
- name: Build Docker image
1719
run: |

.github/workflows/pull-request-tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python
1818
uses: actions/setup-python@v2
1919
with:
20-
python-version: '3.11'
20+
python-version: '3.12'
2121

2222
- name: Cache pip packages
2323
uses: actions/cache@v4
@@ -38,11 +38,17 @@ jobs:
3838
with:
3939
repo-token: ${{ secrets.GITHUB_TOKEN }}
4040

41-
- name: FrameOS nim tests
41+
- name: FrameOS nim build
4242
run: |
4343
cd frameos
4444
nimble install -d
4545
nimble setup
46+
FRAMEOS_ROOT_DIR="." python3 ../e2e/makeapploaders.py
47+
nimble build
48+
49+
- name: FrameOS nim tests
50+
run: |
51+
cd frameos
4652
nimble test
4753
4854
- name: Visual regression tests
@@ -71,7 +77,7 @@ jobs:
7177
- name: Set up Python
7278
uses: actions/setup-python@v2
7379
with:
74-
python-version: '3.11'
80+
python-version: '3.12'
7581

7682
- name: Install redis
7783
run: sudo apt-get install -y redis-server

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dist-ssr
3535
# Nim
3636
frameos/tmp/
3737
e2e/tmp/
38+
e2e/frameos/
3839

3940
gpt.txt
4041
.env

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Prerequisites
55

66
You'll need to install:
7-
Python >= 3.11
7+
Python >= 3.12
88
`Node.js` and `npm`
99
`redis-server`
1010
`nim >=2.0.0` (https://nim-lang.org/install.html)

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Use the official Python 3.11 image as the base
2-
FROM python:3.11-slim-bullseye
1+
# Use the official Python 3.12 image as the base
2+
FROM python:3.12-slim-bullseye
33

44
# Set the working directory
55
WORKDIR /app

backend/app/api/repositories.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import logging
2+
import asyncio
3+
from datetime import datetime, timedelta
24
from http import HTTPStatus
35
from fastapi import Depends, HTTPException
46
from sqlalchemy.exc import SQLAlchemyError
@@ -71,6 +73,13 @@ async def get_repositories(db: Session = Depends(get_db)):
7173
db.commit()
7274

7375
repositories = db.query(Repository).all()
76+
77+
for r in repositories:
78+
# if haven't refreshed in a day
79+
if not r.last_updated_at or r.last_updated_at < datetime.utcnow() - timedelta(seconds=86400):
80+
# schedule updates in the background
81+
asyncio.create_task(r.update_templates())
82+
7483
return [r.to_dict() for r in repositories]
7584
except SQLAlchemyError as e:
7685
logging.error(f'Database error: {e}')

0 commit comments

Comments
 (0)