Skip to content

Commit e02b58b

Browse files
committed
Some example clean up
1 parent a7da97d commit e02b58b

File tree

3 files changed

+7
-20
lines changed

3 files changed

+7
-20
lines changed

example-1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ def __init__(self):
1919
asyncio.ensure_future(self.demo_incr(2, 3))
2020

2121
def watch_i(self, i):
22-
print("UPDATING i2_withwatch")
22+
print("TEST: UPDATING i2_withwatch")
2323
self.i2_withwatch = i*i
2424

2525
def computed_i2(self):
26-
print("COMPUTING i2")
26+
print("TEST: COMPUTING i2")
2727
return self.i**2
2828

2929
async def demo_incr(self, t, v):
@@ -32,13 +32,13 @@ async def demo_incr(self, t, v):
3232
self.i += v
3333

3434
def meth1(self, v):
35-
print("COMMAND", v)
35+
print("TEST: COMMAND", v)
3636
self.subtitle = "Changed: "+v # will not trigger change as _novue
3737
if v == '+1':
3838
self.i += 1
3939

4040
def clone(self, v):
41-
print("CLONE", type(self.suggestions))
41+
print("TEST: CLONE", type(self.suggestions))
4242
self.suggestions += [v]
4343

4444
vuejspython.start(Comp())

example-7.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
td { text-align: center; }
1313
td:nth-child(n+2) { padding: .1em .1em; min-width: 2em; }
1414
.indices {font-family: monospace; font-size: 75%;}
15+
.negative.indices {color: darkgrey;}
1516

1617
.values td:nth-child(n+2) { background: rgba(calc(255 * var(--value)), 255, 0, var(--value))}
1718
.values td:nth-child(n+2) { border-bottom: 3px solid white; }
@@ -45,7 +46,7 @@ <h3>Input <code>{{ i_name }}</code></h3>
4546
<td>Values</td>
4647
<td v-for="v,i in input" :class="{picked: isPicked(v)}" :style="{'--value': tdValue(v)}">{{v}}</td>
4748
</tr>
48-
<tr class="indices">
49+
<tr class="negative indices">
4950
<td>Negative indices</td>
5051
<td v-for="v,i in input">{{-input.length + i}}</td>
5152
</tr>
@@ -74,7 +75,7 @@ <h3>Output <code>{{o_name}}</code>, after running <code>{{o_name}} = {{i_name}}[
7475
<td>Values</td>
7576
<td v-for="v,i in output" class="picked" :style="{'--value': tdValue(v)}">{{v}}</td>
7677
</tr>
77-
<tr class="indices">
78+
<tr class="negative indices">
7879
<td>Negative indices</td>
7980
<td v-for="v,i in output">{{-output.length + i}}</td>
8081
</tr>

example-7.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11

2-
import asyncio
3-
42
from vuejspython import model, start
53

64

75
@model
86
class Comp:
97
# define properties to forward to vue (or not)
10-
i = 42
118
i_name = 'l'
129
o_name = 's'
1310
slice_expr = ':'
@@ -36,16 +33,5 @@ def computed_output(self):
3633
self.error_message = str(e)
3734
return []
3835

39-
async def demo_incr(self, t, v):
40-
while True:
41-
await asyncio.sleep(t)
42-
self.i += v
43-
44-
async def meth1(self, v):
45-
print("Com", v)
46-
self.subtitle = "Changed: "+v # will not trigger change as _novue
47-
if v == '+1':
48-
self.i += 1
49-
#await self._up('i')
5036

5137
start(Comp())

0 commit comments

Comments
 (0)