mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-23 17:23:44 +08:00
LogReader: replace get_first_message with LogReader.first (#31146)
* first * str old-commit-hash: dd0c474e6cc09d17cd07b51098d826dc40bc5403
This commit is contained in:
@@ -264,9 +264,9 @@ are uploaded or auto fallback to qlogs with '/a' selector at the end of the rout
|
||||
def from_bytes(dat):
|
||||
return _LogFileReader("", dat=dat)
|
||||
|
||||
|
||||
def get_first_message(lr: LogIterable, msg_type):
|
||||
return next(filter(lambda m: m.which() == msg_type, lr), None)
|
||||
def first(self, msg_type: str):
|
||||
m = next(filter(lambda m: m.which() == msg_type, self), None)
|
||||
return None if m is None else getattr(m, msg_type)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user