File tree Expand file tree Collapse file tree 1 file changed +34
-6
lines changed Expand file tree Collapse file tree 1 file changed +34
-6
lines changed Original file line number Diff line number Diff line change 1
1
2
2
# Requirements
3
3
4
- ~~~
4
+ ~~~ bash
5
5
pip install asyncio
6
6
pip install websockets
7
7
~~~
8
8
9
9
Currently requires some "observable collections", with modifications (just local import "from .stuff import Thing".
10
10
11
- ~~~
11
+ ~~~ bash
12
12
git clone https://github.com/fousteris-dim/Python-observable-collections.git observablecollections
13
13
patch -d observablecollections/ < 0001-Local-imports.patch
14
14
~~~
@@ -19,14 +19,42 @@ And for some better styling of some examples you might want to download picnicss
19
19
wget https://raw.githubusercontent.com/franciscop/picnic/master/picnic.min.css -O lib/picnic.min.css
20
20
~~~
21
21
22
- # Helper
22
+ # Helpers
23
23
24
- (bash)
25
- ~~~
26
- pvue() { (sleep .5;firefox ${1%.*}.html)& python3 ${1%.*}.py;}
24
+ ### Simply launch python and open a browser (firefox) at the right address.
27
25
26
+ ~~~ bash
27
+ # bash function
28
+ pvue () { (sleep .5; firefox ${1% .* } .html)& python3 ${1% .* } .py; }
29
+
30
+ # examples
28
31
pvue example-1
29
32
pvue example-1.
30
33
pvue example-1.html
31
34
pvue example-1.py
32
35
~~~
36
+
37
+
38
+ ### OR, to develop with auto-reload.
39
+
40
+ ~~~ bash
41
+ # one-time install
42
+ pip install watchdog
43
+ npm install -g simple-hot-reload-server
44
+
45
+
46
+ # in terminal 1 (hot html reload, for all files)
47
+ hrs .
48
+
49
+ # in terminal 2 (start and restart python
50
+ pvue () { if test " $1 " = open ; then shift ; (sleep 1 ; firefox " http://localhost:8082/${1% .* } .html" ) & fi ; watchmedo auto-restart --patterns=" *.py" --ignore-patterns=" */.#*.py" bash -- -c ' (sleep .250 ; touch ' " ${1% .* } " ' .html) & python3 ' " ${1% .* } " ' .py' ; }
51
+ pvue open example-1
52
+ pvue example-1
53
+ # the first opens firefox initially
54
+ ~~~
55
+
56
+
57
+ # TODO
58
+
59
+ - make components working (more than a single top level one, or make it easy to pass linked-state to js components)
60
+ - have a clean solution for the observable collections (integrate and clean minimal code or find another lib)
You can’t perform that action at this time.
0 commit comments