Skip to content

Commit c92e6b4

Browse files
committed
Fixup generator
1 parent 179d861 commit c92e6b4

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/kafkaaggregator/cli.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"""Command-line interface for kafkaaggregator."""
22

3-
__all__ = ["main", "produce", "init_example"]
3+
__all__ = ["main", "produce", "init_example", "generate_agents"]
44

55
import logging
66
from pathlib import Path
77

88
from faust.cli import AppCommand, option
9+
from faust.cli.base import argument
910

1011
from kafkaaggregator.app import app, config
1112
from kafkaaggregator.config import ExampleConfiguration
@@ -60,6 +61,14 @@ async def init_example(self: AppCommand) -> None:
6061

6162

6263
@app.command(
64+
argument(
65+
"aggregated_topic",
66+
type=str,
67+
help=(
68+
"The aggregated topic to generate the agent for. If not specified "
69+
"generate agents for all aggregated topics in the configuration."
70+
),
71+
),
6372
option(
6473
"--template-file",
6574
type=str,
@@ -81,19 +90,11 @@ async def init_example(self: AppCommand) -> None:
8190
help="Aggregator configuration file.",
8291
show_default=True,
8392
),
84-
option(
85-
"--aggregated-topic",
86-
type=str,
87-
help=(
88-
"The aggregated topic to generate the agent for. If not specified "
89-
"generate agents for all aggregated topics in the configuration."
90-
),
91-
),
9293
)
9394
async def generate_agents(
9495
self: AppCommand,
95-
config_file: str,
9696
aggregated_topic: str,
97+
config_file: str,
9798
template_file: str,
9899
output_dir: str,
99100
) -> None:

src/kafkaaggregator/generator.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ class AgentGenerator:
2828
Name of the aggregated topic.
2929
template_file: str
3030
Name of the agent Jinja2 template file
31-
32-
3331
"""
3432

3533
logger = logger
@@ -49,7 +47,6 @@ def __init__(
4947

5048
# Supports the 1 source topic -> 1 aggregated topic case for the moment
5149
self._source_topic = aggregator_config.source_topics[0]
52-
self._template: Template = self._load_template()
5350
self._window_size_secods = (
5451
aggregator_config.window_aggregation.window_size_seconds
5552
)

0 commit comments

Comments
 (0)