Skip to content

Commit ea0c9c8

Browse files
committed
Removing text key and changing to be the event number. Fixing the counter to be 1 based
1 parent 0e0f989 commit ea0c9c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/searchcommands_app/bin/generatehello.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
dispatch, GeneratingCommand, Configuration, Option, validators
2020

2121
@Configuration()
22-
class HelloWorldCommand(GeneratingCommand):
22+
class GenerateHelloCommand(GeneratingCommand):
2323
count = Option(require=True, validate=validators.Integer())
2424

2525
def generate(self):
26-
for i in range(0, self.count):
26+
for i in range(1, self.count + 1):
2727
text = 'Hello World %d' % i
28-
yield {'_time': time.time(), 'text': text, '_raw': text }
28+
yield {'_time': time.time(), 'event_no': i, '_raw': text }
2929

30-
dispatch(HelloWorldCommand, sys.argv, sys.stdin, sys.stdout, __name__)
30+
dispatch(GenerateHelloCommand, sys.argv, sys.stdin, sys.stdout, __name__)

0 commit comments

Comments
 (0)