nucli 0.2.1__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nucli-0.2.1 → nucli-0.4.0}/PKG-INFO +2 -2
- {nucli-0.2.1 → nucli-0.4.0}/pyproject.toml +2 -2
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/demos/counter.py +2 -2
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/demos/movies.py +48 -46
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/demos/sampled.py +2 -2
- {nucli-0.2.1 → nucli-0.4.0}/.gitignore +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/LICENSE.md +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/README.md +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/__init__.py +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/__main__.py +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/_meta.py +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/commands/__init__.py +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/commands/demo.py +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/commands/doctor.py +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/commands/telemetry.py +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/demos/__init__.py +0 -0
- {nucli-0.2.1 → nucli-0.4.0}/src/nu/_cli/main.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: nucli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: The `nu` command line: doctor, demos, telemetry. Ships alongside the nucore kernel and the nustd fabrics.
|
|
5
5
|
Project-URL: Repository, https://github.com/nustackdev/nu
|
|
6
6
|
Author-email: Gor Arakelyan <gorarkln@gmail.com>
|
|
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Requires-Python: >=3.10
|
|
18
18
|
Requires-Dist: click>=8.0
|
|
19
|
-
Requires-Dist: nustd>=0.
|
|
19
|
+
Requires-Dist: nustd>=0.4.0
|
|
20
20
|
Requires-Dist: rich-click>=1.6
|
|
21
21
|
Requires-Dist: rich>=10.7
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nucli"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.0"
|
|
8
8
|
description = "The `nu` command line: doctor, demos, telemetry. Ships alongside the nucore kernel and the nustd fabrics."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -15,7 +15,7 @@ requires-python = ">=3.10"
|
|
|
15
15
|
# than the bare kernel because the packaged demos (`nu demo movies`) run on
|
|
16
16
|
# `nu.ui` and `nu.kv` at runtime.
|
|
17
17
|
dependencies = [
|
|
18
|
-
"nustd>=0.
|
|
18
|
+
"nustd>=0.4.0",
|
|
19
19
|
"click>=8.0",
|
|
20
20
|
"rich>=10.7",
|
|
21
21
|
"rich-click>=1.6",
|
|
@@ -62,7 +62,7 @@ class Dashboard(nu.ui.Page):
|
|
|
62
62
|
class App(nu.ui.Index):
|
|
63
63
|
"""UI index with one page."""
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
home = Dashboard.slot("/")
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
app = nu.With(
|
|
@@ -71,7 +71,7 @@ app = nu.With(
|
|
|
71
71
|
nu.kv.auto_flow_atomic(
|
|
72
72
|
nu.ReactForever(
|
|
73
73
|
Counter.value.on_change(),
|
|
74
|
-
|
|
74
|
+
App.home.count.set_value(nu.str(Counter.value)),
|
|
75
75
|
),
|
|
76
76
|
),
|
|
77
77
|
),
|
|
@@ -225,7 +225,9 @@ class MovieDetail(nu.ui.Page):
|
|
|
225
225
|
class App(nu.ui.Index):
|
|
226
226
|
title: nu.ui.TitleRef
|
|
227
227
|
nav: nu.ui.NavRef
|
|
228
|
-
|
|
228
|
+
movies = Movies.slot("/")
|
|
229
|
+
detail = MovieDetail.slot("/detail")
|
|
230
|
+
about = About.slot("/about")
|
|
229
231
|
|
|
230
232
|
|
|
231
233
|
# ---- State ------------------------------------------------------------------
|
|
@@ -310,9 +312,9 @@ def _rows_form() -> nu.Nu:
|
|
|
310
312
|
|
|
311
313
|
def _rows_filtered() -> nu.Nu:
|
|
312
314
|
"""Same shape as _rows_form, but honors the current FilterRow inputs."""
|
|
313
|
-
min_r = nu.Float(
|
|
314
|
-
genre = nu.Str(
|
|
315
|
-
watched_only = nu.Bool(
|
|
315
|
+
min_r = nu.Float(App.movies.filters.body.min_rating.input)
|
|
316
|
+
genre = nu.Str(App.movies.filters.body.genre.input)
|
|
317
|
+
watched_only = nu.Bool(App.movies.filters.body.watched_only.input)
|
|
316
318
|
predicate = nu.And(
|
|
317
319
|
nu.Ge(nu.DictAttrRef("r")["rating"], min_r),
|
|
318
320
|
nu.Or(nu.Eq(genre, ""), nu.Eq(nu.DictAttrRef("r")["genre"], genre)),
|
|
@@ -345,61 +347,61 @@ init = nu.kv.Transaction(
|
|
|
345
347
|
|
|
346
348
|
|
|
347
349
|
hydrate = nu.kv.Snapshot(
|
|
348
|
-
|
|
349
|
-
|
|
|
350
|
-
|
|
|
351
|
-
|
|
|
352
|
-
|
|
|
350
|
+
App.movies.stats.body.total.set_value(nu.str(State.total))
|
|
351
|
+
| App.movies.stats.body.watched.set_value(nu.str(State.watched))
|
|
352
|
+
| App.movies.stats.body.unseen.set_value(nu.str(State.total - State.watched))
|
|
353
|
+
| App.movies.stats.body.latest.set(State.latest_title)
|
|
354
|
+
| App.movies.shelf.body.table.set(_rows_form())
|
|
353
355
|
)
|
|
354
356
|
|
|
355
357
|
|
|
356
358
|
on_add = nu.ReactForever(
|
|
357
|
-
|
|
359
|
+
App.movies.form.submit.on_click(),
|
|
358
360
|
nu.kv.Transaction(
|
|
359
361
|
State.movies.append(
|
|
360
362
|
nu.Dict.of(
|
|
361
|
-
title=nu.Str(
|
|
362
|
-
year=nu.Int(
|
|
363
|
-
genre=nu.Str(
|
|
364
|
-
rating=nu.Float(
|
|
365
|
-
watched=nu.Bool(
|
|
366
|
-
notes=nu.Str(
|
|
363
|
+
title=nu.Str(App.movies.form.details.title.input),
|
|
364
|
+
year=nu.Int(App.movies.form.details.year.input),
|
|
365
|
+
genre=nu.Str(App.movies.form.details.genre.input),
|
|
366
|
+
rating=nu.Float(App.movies.form.score.rating.input),
|
|
367
|
+
watched=nu.Bool(App.movies.form.score.watched.input),
|
|
368
|
+
notes=nu.Str(App.movies.form.score.notes.input),
|
|
367
369
|
),
|
|
368
370
|
)
|
|
369
371
|
| State.total.set(State.total + 1)
|
|
370
372
|
| State.watched.set(
|
|
371
|
-
State.watched + nu.If(nu.Bool(
|
|
373
|
+
State.watched + nu.If(nu.Bool(App.movies.form.score.watched.input), 1, 0),
|
|
372
374
|
)
|
|
373
|
-
| State.latest_title.set(nu.Str(
|
|
375
|
+
| State.latest_title.set(nu.Str(App.movies.form.details.title.input)),
|
|
374
376
|
)
|
|
375
377
|
>> nu.kv.Snapshot(
|
|
376
|
-
|
|
377
|
-
|
|
|
378
|
-
|
|
|
379
|
-
|
|
|
380
|
-
|
|
|
381
|
-
|
|
|
378
|
+
App.movies.shelf.body.table.set(_rows_form())
|
|
379
|
+
| App.movies.stats.body.total.set_value(nu.str(State.total))
|
|
380
|
+
| App.movies.stats.body.watched.set_value(nu.str(State.watched))
|
|
381
|
+
| App.movies.stats.body.unseen.set_value(nu.str(State.total - State.watched))
|
|
382
|
+
| App.movies.stats.body.latest.set(State.latest_title)
|
|
383
|
+
| App.movies.form.feedback.set(
|
|
382
384
|
title="Logged",
|
|
383
|
-
body="Added " + nu.Str(
|
|
385
|
+
body="Added " + nu.Str(App.movies.form.details.title.input),
|
|
384
386
|
)
|
|
385
387
|
),
|
|
386
388
|
)
|
|
387
389
|
|
|
388
390
|
|
|
389
391
|
on_row_click = nu.ReactForever(
|
|
390
|
-
|
|
392
|
+
App.movies.shelf.body.table.on_row_click(),
|
|
391
393
|
nu.IfDo(
|
|
392
394
|
nu.Contains(nu.DictAttrRef("row_click"), "row_index"),
|
|
393
395
|
nu.kv.Transaction(State.selected.set(nu.DictAttrRef("row_click")["row_index"]))
|
|
394
396
|
>> nu.kv.Snapshot(
|
|
395
|
-
|
|
396
|
-
|
|
|
397
|
-
|
|
|
398
|
-
|
|
|
399
|
-
|
|
|
397
|
+
App.detail.heading.set(State.movies[State.selected].title)
|
|
398
|
+
| App.detail.meta.meta.year.set_value(nu.str(State.movies[State.selected].year))
|
|
399
|
+
| App.detail.meta.meta.genre.set_value(State.movies[State.selected].genre)
|
|
400
|
+
| App.detail.meta.meta.rating.set_value(nu.str(State.movies[State.selected].rating))
|
|
401
|
+
| App.detail.meta.meta.watched.set(
|
|
400
402
|
label=nu.If(State.movies[State.selected].watched, "Watched", "Unseen"),
|
|
401
403
|
)
|
|
402
|
-
|
|
|
404
|
+
| App.detail.notes.body.set(State.movies[State.selected].notes)
|
|
403
405
|
)
|
|
404
406
|
>> App.nav.set("/detail"),
|
|
405
407
|
),
|
|
@@ -408,41 +410,41 @@ on_row_click = nu.ReactForever(
|
|
|
408
410
|
|
|
409
411
|
|
|
410
412
|
on_delete = nu.ReactForever(
|
|
411
|
-
|
|
413
|
+
App.detail.actions.remove.on_click(),
|
|
412
414
|
nu.kv.Transaction(
|
|
413
415
|
State.movies.del_at(State.selected) >> State.total.set(nu.Len(State.movies)),
|
|
414
416
|
)
|
|
415
417
|
>> nu.kv.Snapshot(
|
|
416
|
-
|
|
417
|
-
|
|
|
418
|
-
|
|
|
418
|
+
App.movies.shelf.body.table.set(_rows_form())
|
|
419
|
+
| App.movies.stats.body.total.set_value(nu.str(State.total))
|
|
420
|
+
| App.movies.stats.body.unseen.set_value(nu.str(State.total - State.watched))
|
|
419
421
|
)
|
|
420
422
|
>> App.nav.set("/"),
|
|
421
423
|
)
|
|
422
424
|
|
|
423
425
|
|
|
424
|
-
on_back = nu.ReactForever(
|
|
426
|
+
on_back = nu.ReactForever(App.detail.actions.back.on_click(), App.nav.set("/"))
|
|
425
427
|
|
|
426
428
|
|
|
427
|
-
on_about_open = nu.ReactForever(
|
|
429
|
+
on_about_open = nu.ReactForever(App.movies.topbar.about.on_click(), App.nav.set("/about"))
|
|
428
430
|
|
|
429
431
|
|
|
430
|
-
on_about_back = nu.ReactForever(
|
|
432
|
+
on_about_back = nu.ReactForever(App.about.actions.back.on_click(), App.nav.set("/"))
|
|
431
433
|
|
|
432
434
|
|
|
433
435
|
on_filter_apply = nu.ReactForever(
|
|
434
|
-
|
|
435
|
-
nu.kv.Snapshot(
|
|
436
|
+
App.movies.filters.body.apply.on_click(),
|
|
437
|
+
nu.kv.Snapshot(App.movies.shelf.body.table.set(_rows_filtered())),
|
|
436
438
|
)
|
|
437
439
|
|
|
438
440
|
|
|
439
441
|
on_filter_clear = nu.ReactForever(
|
|
440
|
-
|
|
442
|
+
App.movies.filters.body.clear.on_click(),
|
|
441
443
|
nu.kv.Snapshot(
|
|
442
|
-
|
|
443
|
-
|
|
|
444
|
-
|
|
|
445
|
-
|
|
|
444
|
+
App.movies.filters.body.min_rating.input.set(1.0)
|
|
445
|
+
| App.movies.filters.body.genre.input.set("")
|
|
446
|
+
| App.movies.filters.body.watched_only.input.set(False)
|
|
447
|
+
| App.movies.shelf.body.table.set(_rows_form())
|
|
446
448
|
),
|
|
447
449
|
)
|
|
448
450
|
|
|
@@ -63,13 +63,13 @@ class Dashboard(nu.ui.Page):
|
|
|
63
63
|
class App(nu.ui.Index):
|
|
64
64
|
"""UI index with one page."""
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
home = Dashboard.slot("/")
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
# reactive wire: repaint the chart on every write to `nums`
|
|
70
70
|
ui = nu.ReactForever(
|
|
71
71
|
State.nums.on_change(),
|
|
72
|
-
|
|
72
|
+
App.home.chart.set_points(
|
|
73
73
|
nu.Collect(nu.Sorted(nu.Iter(State.nums.sample(200, 0, State.cursor)))),
|
|
74
74
|
),
|
|
75
75
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|