File tree Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 11"""Command-line interface for kafkaaggregator."""
22
3- __all__ = ["main" , "produce" , "init_example" ]
3+ __all__ = ["main" , "produce" , "init_example" , "generate_agents" ]
44
55import logging
66from pathlib import Path
77
88from faust .cli import AppCommand , option
9+ from faust .cli .base import argument
910
1011from kafkaaggregator .app import app , config
1112from 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)
9394async 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 :
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments