Skip to content

Commit 1eb5525

Browse files
author
tibut
committed
refectoring
1 parent 53800fa commit 1eb5525

File tree

3 files changed

+16
-25
lines changed

3 files changed

+16
-25
lines changed

bitflow/processingstep.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def stop(self):
161161

162162
class DebugGenerationStep(AsyncProcessingStep):
163163
"""example generativ processing step"""
164-
__name__ = "DebugGenerationStep"
164+
__name__ = "debug-generation-step"
165165
__description__ = "DEBUG. Generates random samples with different tages."
166166

167167
def __init__(self):
@@ -196,7 +196,7 @@ def stop(self):
196196
class Noop(ProcessingStep):
197197

198198
__description__ = "DEBUG. Noop."
199-
199+
__name__ = "noop"
200200

201201
def __init__(self):
202202
super().__init__()
@@ -211,6 +211,7 @@ class ModifyTimestamp(ProcessingStep):
211211
interval: in seconds
212212
"""
213213
__description__ = "Modifies Timestamp so that the first sample will get timestamp of start_time parameter"
214+
__name__ = "modify-timestamp"
214215

215216
def __init__(self,interval : int ,start_time : str = "now"):
216217
try:
@@ -238,8 +239,8 @@ class ListenForTags(ProcessingStep):
238239
239240
port: port to listen on
240241
"""
241-
242242
__description__ = "Opens a rest-interface to add tags to traversing samples"
243+
__name__ = "listen-for-tags"
243244

244245
def __init__(self,port : int = 7777):
245246
from bitflow.rest import RestServer
@@ -268,8 +269,8 @@ class AddTag(ProcessingStep):
268269
tag: tag name
269270
value: value string
270271
"""
271-
272272
__description__ = "Adds a give tag and value to the samples"
273+
__name__ = "add-tag"
273274

274275
def __init__(self, tag : str, value : str):
275276
super().__init__()

bitflow/steps/SimpleTagger.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

python-bitflow

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def main():
6060
script_group.add_argument('-script',type=str,help="bitflow script. (https://github.com/bitflow-stream/antlr-grammars/tree/master/bitflow-script)")
6161
script_group.add_argument("-f",help="Read given file as Bitflow Script and execute the pipeline.", metavar='')
6262
script_group.add_argument("-capabilities",action='store_true',help="list all available processing steps")
63-
63+
#parser.add_argument("-p",help="dynamic import processing steps from a .py file")
6464
ld_group = parser.add_argument_group("logging and debug")
6565
ld_group.add_argument("-log",help="Redirect logs to a given file in addition to the console.",metavar='')
6666
ld_group.add_argument("-v",action='store_true',help="Enable verbose logging Sink")
@@ -81,6 +81,15 @@ def main():
8181
configure_logging(debug)
8282
logging.debug("debug mode enabled")
8383

84+
85+
#if args.p:
86+
# import importlib.util
87+
# file_path = args.p
88+
# module_name = '*'
89+
# spec = importlib.util.spec_from_file_location(module_name, file_path)
90+
# module = importlib.util.module_from_spec(spec)
91+
# spec.loader.exec_module(module)
92+
8493
if args.capabilities:
8594
capabilities()
8695
sys.exit(0)
@@ -90,6 +99,7 @@ def main():
9099
if args.script:
91100
script = args.script
92101

102+
93103
try:
94104
PIPES_INPUTS = parse_script(script)
95105
except NotSupportedError as nse:

0 commit comments

Comments
 (0)