Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ node-blue launch --flow=examples/flows/mqtt-to-cratedb.yaml
import asyncio
from node_blue.core import NodeBlue


async def launch_blue():
"""
Launch a Node-BLUE instance.
"""

# Configure Node-BLUE instance with Node-RED flow.
blue = NodeBlue(flow="https://github.com/daq-tools/node-blue/raw/main/examples/flows/http-html-templating.json")

Expand All @@ -73,6 +74,7 @@ async def launch_blue():
# Wait until termination.
await blue.forever()


if __name__ == "__main__":
asyncio.run(launch_blue())
```
Expand Down
3 changes: 1 addition & 2 deletions droste/nodejs/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from munch import munchify, unmunchify


logger = logging.getLogger(__name__)


Expand All @@ -18,7 +17,7 @@ def receiver(kwargs):
# logger.info("EVALUATE!")
# locals().update(munchify(kwargs))
ns = munchify(kwargs)
exec(code, {}, ns)
exec(code, {}, ns) # noqa: S102
# return locals()
return unmunchify(ns)

Expand Down
2 changes: 1 addition & 1 deletion droste/nodejs/python_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""

import logging
import typing as t
import textwrap
import typing as t

from node_blue.util import setup_logging

Expand Down
6 changes: 3 additions & 3 deletions node_blue/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import click

from node_blue.core import launch_blue, NodeBlue
from node_blue.core import NodeBlue, launch_blue
from node_blue.util import boot_click, docstring_format_verbatim, make_sync

logger = logging.getLogger(__name__)
Expand All @@ -22,15 +22,15 @@ def help_launch():
node-blue launch \\
--flow=https://github.com/daq-tools/node-blue/raw/main/examples/flows/http-html-templating.json

""" # noqa: E501
"""


def help_setup():
"""
Set up Node-BLUE.

node-blue setup
""" # noqa: E501
"""


@click.group()
Expand Down
5 changes: 2 additions & 3 deletions node_blue/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
import asyncio
import importlib.resources
import logging
import typing as t
from pathlib import Path
from types import ModuleType

import funcy
import javascript
import javascript.connection
import typing as t

import tabulate

from node_blue.hal import NodeBlueContext, jsrun
from node_blue.util import run_later, wait, acquire_text_resource
from node_blue.util import acquire_text_resource, run_later, wait

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion node_blue/hal.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2023, The Panodata developers and contributors.
# Distributed under the terms of the Apache-2.0 license, see LICENSE.
import asyncio
import dataclasses
import threading
import typing as t
import asyncio
from pathlib import Path

import javascript
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ optional-dependencies.develop = [
"mypy<2.4",
"poethepoet<1",
"pyproject-fmt<3",
"ruff<0.16",
"ruff<0.17",
"types-tabulate",
]
optional-dependencies.release = [
Expand Down Expand Up @@ -135,6 +135,7 @@ extend-exclude = [
# Temporary
"workbench.py",
]
lint.select = [ "E4", "E7", "E9", "F" ]
lint.ignore = [
"E722", # Do not use bare `except`
]
Expand Down Expand Up @@ -162,8 +163,8 @@ ini_options.log_cli = true # Enable to receive way more log details on stdout.
ini_options.log_cli_level = "DEBUG"

[tool.coverage]
run.branch = false
run.source = [ "droste", "node_blue" ]
run.branch = false
report.fail_under = 0
report.show_missing = true

Expand Down
2 changes: 1 addition & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import requests
from pytest_mqtt import MqttMessage

from node_blue.core import NodeBlue, FlowManager
from node_blue.core import FlowManager, NodeBlue
from node_blue.util import wait


Expand Down