Alon Bar-Lev has posted comments on this change. Change subject: Implementation of machine dialog parser for python ......................................................................
Patch Set 1: (2 comments) I would really like to remove the abstractions of classes in favour of simple dictionary, this is an advantage of python over java and we can lavarage it. not sure why we cannot simply iterate and match regular expression and place the groups as dictionary keys... once you transform to event you can apply any logic that is required. for testing, indeed there is no place for testing, you can put unit test within this module or create another module machine_dialog_parser_test.py http://gerrit.ovirt.org/#/c/28180/1/src/otopi/machine_dialog_parser.py File src/otopi/machine_dialog_parser.py: Line 378: self.output.write(data) Line 379: self.output.write('\n') Line 380: self.output.flush() Line 381: Line 382: def set_filter(self, filter_): > I was thinking about ignoring events by parser. for example in case I don't please move this to application layer, no need to do this in otopi Line 383: """ Line 384: Set list of events which should be skipped by parser. Line 385: Line 386: Keyword arguments: Line 411: def next_event(self): Line 412: """ Line 413: Returns instance of Event Line 414: """ Line 415: line = self.input_.readline() > what should I assume ? file descriptor ? binary streams... so you need to look for '\n' Line 416: if not line: Line 417: raise UnexpectedEOF() Line 418: for event_type in self.event_types: Line 419: try: -- To view, visit http://gerrit.ovirt.org/28180 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7b715a39840e548ef768ac9e77004cc0d98a9c0 Gerrit-PatchSet: 1 Gerrit-Project: otopi Gerrit-Branch: master Gerrit-Owner: Lukas Bednar <lbed...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Lukas Bednar <lbed...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches