Skip to content

Commit

Permalink
Cleanup (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cariad Eccleston authored Jan 19, 2021
1 parent 2e50eb0 commit db97251
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/create-a-plugin/plugin.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Plugin(PluginBase):

## Reading configuration

For your plugin to be invoked, the user must have a `.wev.yml` configuration that refers to it.
For your plugin to be invoked, the user must have a configuration (i.e. `wev.yml`) that refers to it.

Our example plugin will resolve to whatever the user enters, but let's say we want the option to translate the input to upper or lower case.

Expand Down
2 changes: 1 addition & 1 deletion docs/create-a-plugin/testing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Create a `.wev.yml` configuration file suitable for your plugin:
Create a `wev.yml` configuration file suitable for your plugin:

```yaml
# Invoke the wev-ask plugin to set the DEFAULT_FOO environment variable:
Expand Down
8 changes: 0 additions & 8 deletions example.wev.yml

This file was deleted.

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
name="wev",
packages=[
"wev",
"wev.wev_echo",
"wev.logging",
"wev.sdk",
"wev.state",
Expand Down
4 changes: 1 addition & 3 deletions wev/executor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from subprocess import run
from typing import List

from colorama import Style

from wev.logging import get_logger
from wev.resolver import resolve

Expand All @@ -19,5 +17,5 @@ def execute(command: List[str]) -> int:
"""
logger = get_logger()
variables = resolve()
logger.info("Starting %s%s%s...", Style.BRIGHT, command[0], Style.RESET_ALL)
logger.debug("Starting %s...", command[0])
return run(command, env=variables).returncode
10 changes: 9 additions & 1 deletion wev/state/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
class State(BaseState):
def __init__(self) -> None:
super().__init__()
self.config = dwalk(filenames=[".wev.yml", ".wev.user.yml"], include_meta=True)
self.config = dwalk(
filenames=[
".wev.yml",
"wev.yml",
".wev.user.yml",
"wev.user.yml",
],
include_meta=True,
)
self.logger.debug("Merged configuration: %s", self.config)
self.logger.debug("Getting context...")
self.context = self.config["__dwalk__"]["__dwalk__"]["most_specific_src"]
Expand Down
1 change: 1 addition & 0 deletions wev/text/test_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@mark.parametrize(
"value, expect",
[
((), ""),
(("one",), "one"),
(("one", "two"), "one and two"),
(("one", "two", "three"), "one, two and three"),
Expand Down

0 comments on commit db97251

Please sign in to comment.