FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnative/src/pythonnative/devserver/__init__.py at v0.43.1 · pythonnative/pythonnative · GitHub
pythonnative
pythonnative
Repository navigation
Code
Issues
11
(11)
Pull requests
4
(4)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnative
/
src
/
pythonnative
/
devserver
/
__init__.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (29 loc) · 1.31 KB
Breadcrumbs
pythonnative
/
src
/
pythonnative
/
devserver
/
__init__.py
Copy path
File metadata and controls
34 lines (29 loc) · 1.31 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""The PythonNative dev server: one process that serves every dev client.
``pn start`` (and ``pn preview``, which is ``pn start`` plus a browser
tab) runs a [`DevServer`][pythonnative.devserver.DevServer]. It watches
the project's ``app/`` directory, keeps a content-addressed manifest of
the sources, and speaks a small JSON protocol over WebSocket to two
kinds of peers:
- **Dev clients**: debug builds of the app running on a simulator,
emulator, or physical device. They sync sources into an on-device
overlay, Fast Refresh when files change, and stream their logs and
errors back to the terminal. See ``pythonnative.devclient``.
- **The browser preview**: a page served by this server that renders
the app through the bridge protocol, exactly as the Swift and Kotlin
runtimes do. See ``pythonnative.bridge.web``.
Everything here is standard library only (``asyncio`` streams plus a
hand-rolled RFC 6455 implementation in ``pythonnative.devserver.ws``)
so the same
code also runs inside the embedded interpreter on device.
"""
from
.
server
import
DEFAULT_PORT
,
DevServer
,
ServerInfo
,
lan_addresses
from
.
watcher
import
FileWatcher
,
SourceSnapshot
,
snapshot_sources
__all__
=
[
"DEFAULT_PORT"
,
"DevServer"
,
"FileWatcher"
,
"ServerInfo"
,
"SourceSnapshot"
,
"lan_addresses"
,
"snapshot_sources"
,
]
Back
|
FazBrowse Home
|
New Git URL