Skip to content

Commit

Permalink
Fixup generator
Browse files Browse the repository at this point in the history
  • Loading branch information
afausti committed Oct 5, 2021
1 parent 179d861 commit c92e6b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
21 changes: 11 additions & 10 deletions src/kafkaaggregator/cli.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""Command-line interface for kafkaaggregator."""

__all__ = ["main", "produce", "init_example"]
__all__ = ["main", "produce", "init_example", "generate_agents"]

import logging
from pathlib import Path

from faust.cli import AppCommand, option
from faust.cli.base import argument

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


@app.command(
argument(
"aggregated_topic",
type=str,
help=(
"The aggregated topic to generate the agent for. If not specified "
"generate agents for all aggregated topics in the configuration."
),
),
option(
"--template-file",
type=str,
Expand All @@ -81,19 +90,11 @@ async def init_example(self: AppCommand) -> None:
help="Aggregator configuration file.",
show_default=True,
),
option(
"--aggregated-topic",
type=str,
help=(
"The aggregated topic to generate the agent for. If not specified "
"generate agents for all aggregated topics in the configuration."
),
),
)
async def generate_agents(
self: AppCommand,
config_file: str,
aggregated_topic: str,
config_file: str,
template_file: str,
output_dir: str,
) -> None:
Expand Down
3 changes: 0 additions & 3 deletions src/kafkaaggregator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class AgentGenerator:
Name of the aggregated topic.
template_file: str
Name of the agent Jinja2 template file
"""

logger = logger
Expand All @@ -49,7 +47,6 @@ def __init__(

# Supports the 1 source topic -> 1 aggregated topic case for the moment
self._source_topic = aggregator_config.source_topics[0]
self._template: Template = self._load_template()
self._window_size_secods = (
aggregator_config.window_aggregation.window_size_seconds
)
Expand Down

0 comments on commit c92e6b4

Please sign in to comment.