Skip to content

Commit

Permalink
A-HIGH-NNN.improve_func_loading
Browse files Browse the repository at this point in the history
  • Loading branch information
uvsmtid-gs committed Jun 17, 2024
1 parent 1d21de5 commit 55baa3e
Show file tree
Hide file tree
Showing 27 changed files with 301 additions and 191 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ feature_status: TODO
Meta functions are those built-in ones which are not domain-specific.

List:
* `func_id_unplugged`: func which is not plugged anywhere.
* `intercept_invocation_func`: [FS_88_66_66_73][FS_88_66_66_73]
* `list_envelope`: TODO: func with cardinality hooks on client side: found 0, found 1, found N.
* `get_envelope`: TODO: FS_74_69_61_79: should work as (A) query single envelope (with zero error code), otherwise (B) see `list_envelope` (with non-zero error code).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

TODO: TODO_19_67_22_89: remove `ignored_func_ids_list`

Instead, load unmapped `func_id`-s as `FuncState.fs_unplugged`.

There should be a place in the tree where these `func_id`-s should be plugged into.
Another `CompositeNodeType`?

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
TODO_78_94_31_68: split argrelay into multiple packages

The main benefit is to be able to:
* enforce relationship between packages
* track semver compatibility easily (see `semver_notes.md`)
* reuse them without always downloading everything

Expand Down
30 changes: 15 additions & 15 deletions docs/task_refs/TODO_99_87_25_42.next_incompatible_changes.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@

This is a plan for next incompatible changes - they are primarily renames.

TODO:
* Introduce `@/data/` dir. And make importable yaml (e.g. from `@/data/`) for server config.

* TODO: Rename rest API:
* `describe_line_args` -> `query_enum_items` (to match func_id)
* `propose_arg_values` -> `complete_line`
* `relay_line_args` -> `invoke_line`
* TODO: Introduce `@/data/` dir. And make importable yaml (e.g. from `@/data/`) for server config.

* TODO: Rename: `arg_type` to `prop_name`

Expand All @@ -19,20 +13,26 @@ TODO:

TODO:
* Rename all enum items to underscore (e.g. `ServerAction.ProposeArgValues` -> `ServerAction.propse_args_values`).
* Consider renaming URL, for example (`_` to `-`, shorten, rethink):
* TODO: Consider renaming URL, for example (`_` to `-`, shorten, rethink):
* propose_arg_values -> propose-options
* describe_line_args -> enum-options
* relay_line_args -> invoke-with-options
* TODO: Rename rest API:
* `describe_line_args` -> `query_enum_items` (to match func_id)
* `propose_arg_values` -> `complete_line`
* `relay_line_args` -> `invoke_line`

TODO:
* Move all GUI config into DefaultConfigurator (including banner).
* TODO: Rename `DefaultConfigurator` to `GuiConfigurator`.
* TODO: Move all GUI config into DefaultConfigurator (including banner).
* TODO: Move `gui_banner_config` under `DefaultConfigurator`

TODO:
* TODO: Rename all `func_id` to be prefixed with `func_id`, for example, `query_enum_items_func` -> `func_id_query_enum_items`.
* Rename: prefix all `func_id` with `func_id`, for example: `goto_service_func` -> `func_id_goto_service`
* TODO: Rename: prefix all `func_id` with `func_id`, for example: `goto_service_func` -> `func_id_goto_service`.

TODO:
* Shorten name `EnvelopeContainer.filled_types_to_values_hidden_by_defaults` to `default_override`-s.
* TODO: TODO_19_67_22_89: remove `ignored_func_ids_list` - load as `FuncState.fs_unplugged`.

* TODO: Shorten name `EnvelopeContainer.filled_types_to_values_hidden_by_defaults` to `default_override`-s.

TODO:
* TODO: `install_files_procedure` should use 4 config params (instead of 3) - one more is destination dir (not hardcoded `conf`, not hardcoded `exe`, but also `data`, or something else).

* TODO: Move GUI header and footer to the configurator.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def list_dir(
setuptools.setup(
name = "argrelay",
# See `docs/dev_notes/version_format.md`:
version = "0.7.4",
version = "0.7.4.dev0",
author = "uvsmtid",
author_email = "uvsmtid@gmail.com",
description = "Tab-completion & data search server = total recall for Bash shell",
Expand Down
39 changes: 39 additions & 0 deletions src/argrelay/composite_tree/AbstractNodeVisitor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from __future__ import annotations

from argrelay.composite_tree.CompositeNode import BaseNode, ZeroArgNode, InterpTreeNode, FuncTreeNode, TreePathNode


class AbstractNodeVisitor:

def visit_node(
self,
node: BaseNode,
):
if False:
pass
elif isinstance(node, ZeroArgNode):
self._visit_ZeroArgNode(node)
elif isinstance(node, TreePathNode):
self._visit_TreePathNode(node)
elif isinstance(node, InterpTreeNode):
self._visit_InterpTreeNode(node)
elif isinstance(node, FuncTreeNode):
self._visit_FuncTreeNode(node)
else:
raise NotImplementedError(node.node_type.name)

# noinspection PyPep8Naming
def _visit_ZeroArgNode(self, node: ZeroArgNode) -> None:
raise NotImplementedError()

# noinspection PyPep8Naming
def _visit_TreePathNode(self, node: TreePathNode) -> None:
raise NotImplementedError()

# noinspection PyPep8Naming
def _visit_InterpTreeNode(self, node: InterpTreeNode) -> None:
raise NotImplementedError()

# noinspection PyPep8Naming
def _visit_FuncTreeNode(self, node: FuncTreeNode) -> None:
raise NotImplementedError()
14 changes: 7 additions & 7 deletions src/argrelay/composite_tree/CompositeNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ class ZeroArgNode(BaseNode):
plugin_instance_id: str = field()


@dataclass
class TreePathNode(BaseNode):
"""
See `CompositeNodeType.tree_path_node`.
"""


@dataclass
class InterpTreeNode(BaseNode):
"""
Expand All @@ -53,10 +60,3 @@ class FuncTreeNode(BaseNode):
"""

func_id: str = field()


@dataclass
class TreePathNode(BaseNode):
"""
See `CompositeNodeType.tree_path_node`.
"""
Loading

0 comments on commit 55baa3e

Please sign in to comment.