Do the necessary changes such that this comment passes cleanly:
$ PYTHONPATH=/home/smarchi/src/babeltrace/tests/utils/python pyright tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py
Pyright pointed out that field _trace_session_state didn't exist, in:
@property
def trace_session_state(self):
return self._trace_session_state
The actual field name is _ts_state. However, it shows that this
property is never used, so remove it.
Change-Id: I115fe473310ecdb1e2fd2e5d369aae33afe963f1
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10893
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
self._path = path
filename = os.path.basename(path)
match = re.match(r"(.*)_\d+", filename)
self._path = path
filename = os.path.basename(path)
match = re.match(r"(.*)_\d+", filename)
+ if not match:
+ raise RuntimeError(
+ "Unexpected data stream file name pattern: {}".format(filename)
+ )
+
self._channel_name = match.group(1)
trace_dir = os.path.dirname(path)
index_path = os.path.join(trace_dir, "index", filename + ".idx")
self._channel_name = match.group(1)
trace_dir = os.path.dirname(path)
index_path = os.path.join(trace_dir, "index", filename + ".idx")
line = config_section.get("line")
ts = config_section.get("timestamp")
line = config_section.get("line")
ts = config_section.get("timestamp")
+ if type(line) is not int:
+ raise RuntimeError("`line` is not an integer")
+
+ if type(ts) is not int:
+ raise RuntimeError("`timestamp` is not an integer")
+
# Sections' timestamps and lines must both be increasing.
assert ts > last_timestamp
last_timestamp = ts
# Sections' timestamps and lines must both be increasing.
assert ts > last_timestamp
last_timestamp = ts
- @property
- def trace_session_state(self):
- return self._trace_session_state
-
@property
def info(self):
return self._info
@property
def info(self):
return self._info
metadata_stream_state.is_sent = True
status = _LttngLiveViewerGetMetadataStreamDataContentReply.Status.OK
metadata_section = metadata_stream_state.cur_section
metadata_stream_state.is_sent = True
status = _LttngLiveViewerGetMetadataStreamDataContentReply.Status.OK
metadata_section = metadata_stream_state.cur_section
+ assert metadata_section is not None
# If we are sending an empty section, ready the next one right away.
if len(metadata_section.data) == 0:
# If we are sending an empty section, ready the next one right away.
if len(metadata_section.data) == 0: