Mercurial
annotate mrjunejune/main.py @ 262:0f45474c1b1a
Add cyberpunk JRPG blog browser
Show the latest posts in the JRPG preview and render the full blog archive and sanitized post details in the Inspect modal.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <mrjunejune@users.noreply.github.com> |
|---|---|
| date | Thu, 06 Aug 2026 04:08:45 -0700 |
| parents | d2bb317e01db |
| children |
| rev | line source |
|---|---|
|
41
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
1 from cffi import FFI |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
2 import os |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
3 |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
4 ffi = FFI() |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
5 ffi.cdef("void start_server(void);") |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
6 |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
7 # Bazel runs binaries from a sandbox, so use runfiles to locate the .so |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
8 import pathlib |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
9 runfiles_dir = pathlib.Path(__file__).parent |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
10 libpath = runfiles_dir / "mrjunejune_server_so.so" |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
11 |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
12 C = ffi.dlopen(str(libpath)) |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
13 C.start_server() |
|
d2bb317e01db
[Experiment] Calling seobeo in a python server and see.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
14 |