Skip to content

Commit d19d487

Browse files
Fix linter warnings
Signed-off-by: Jean-Christophe Morin <[email protected]>
1 parent cf764ee commit d19d487

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

src/py-opentimelineio/opentimelineio/core/_core_utils.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -396,53 +396,53 @@ def __copy__(self, *args, **kwargs):
396396
raise ValueError("SerializableObjects may not be shallow copied.")
397397

398398

399-
@add_method(AnyDictionary)
400-
def to_dict(self):
399+
@add_method(AnyDictionary) # noqa: F811
400+
def to_dict(self): # noqa: F811
401401
"""
402402
Convert to a built-in dict. It will recursively convert all values
403403
to their corresponding python built-in types.
404404
"""
405405
return json.loads(_otio._serialize_json_to_string(_value_to_any(self), {}, 0))
406406

407407

408-
@add_method(AnyVector)
409-
def to_list(self):
408+
@add_method(AnyVector) # noqa: F811
409+
def to_list(self): # noqa: F811
410410
"""
411411
Convert to a built-in list. It will recursively convert all values
412412
to their corresponding python built-in types.
413413
"""
414414
return json.loads(_otio._serialize_json_to_string(_value_to_any(self), {}, 0))
415415

416416

417-
@add_method(SerializableObject)
418-
def to_dict(self):
417+
@add_method(SerializableObject) # noqa: F811
418+
def to_dict(self): # noqa: F811
419419
"""
420420
Convert to a built-in dict. It will recursively convert all values
421421
to their corresponding python built-in types.
422422
"""
423423
return json.loads(_otio._serialize_json_to_string(_value_to_any(self), {}, 0))
424424

425425

426-
@add_method(RationalTime)
427-
def to_dict(self):
426+
@add_method(RationalTime) # noqa: F811
427+
def to_dict(self): # noqa: F811
428428
"""
429429
Convert to a built-in dict. It will recursively convert all values
430430
to their corresponding python built-in types.
431431
"""
432432
return json.loads(_otio._serialize_json_to_string(_value_to_any(self), {}, 0))
433433

434434

435-
@add_method(TimeRange)
436-
def to_dict(self):
435+
@add_method(TimeRange) # noqa: F811
436+
def to_dict(self): # noqa: F811
437437
"""
438438
Convert to a built-in dict. It will recursively convert all values
439439
to their corresponding python built-in types.
440440
"""
441441
return json.loads(_otio._serialize_json_to_string(_value_to_any(self), {}, 0))
442442

443443

444-
@add_method(TimeTransform)
445-
def to_dict(self):
444+
@add_method(TimeTransform) # noqa: F811
445+
def to_dict(self): # noqa: F811
446446
"""
447447
Convert to a built-in dict. It will recursively convert all values
448448
to their corresponding python built-in types.

tests/test_core_utils.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -252,45 +252,45 @@ def test_SerializableObject(self):
252252
so = opentimelineio.core.SerializableObjectWithMetadata(name="asd")
253253
so.metadata["key1"] = opentimelineio.core.Composition()
254254

255-
d = so.to_dict()
256-
self.assertTrue(isinstance(d, dict))
257-
json.dumps(d)
255+
converted = so.to_dict()
256+
self.assertTrue(isinstance(converted, dict))
257+
json.dumps(converted)
258258

259259
def test_AnyDictionary(self):
260260
ad = opentimelineio._otio.AnyDictionary()
261261
ad["my key"] = opentimelineio.core.Composable()
262262

263-
d = ad.to_dict()
264-
self.assertTrue(isinstance(d, dict))
265-
json.dumps(d)
263+
converted = ad.to_dict()
264+
self.assertTrue(isinstance(converted, dict))
265+
json.dumps(converted)
266266

267267
def test_AnyVector(self):
268268
av = opentimelineio._otio.AnyVector()
269269
av.append(1)
270270
av.append(opentimelineio._otio.AnyDictionary())
271271

272-
l = av.to_list()
273-
self.assertTrue(isinstance(l, list))
274-
self.assertEqual(l, [1, {}])
275-
json.dumps(l)
272+
converted = av.to_list()
273+
self.assertTrue(isinstance(converted, list))
274+
self.assertEqual(converted, [1, {}])
275+
json.dumps(converted)
276276

277277
def test_RationalTime(self):
278278
rt = opentimelineio.opentime.RationalTime()
279279

280-
d = rt.to_dict()
281-
self.assertTrue(isinstance(d, dict))
282-
json.dumps(d)
280+
converted = rt.to_dict()
281+
self.assertTrue(isinstance(converted, dict))
282+
json.dumps(converted)
283283

284284
def test_TimeRange(self):
285285
tr = opentimelineio.opentime.TimeRange()
286286

287-
d = tr.to_dict()
288-
self.assertTrue(isinstance(d, dict))
289-
json.dumps(d)
287+
converted = tr.to_dict()
288+
self.assertTrue(isinstance(converted, dict))
289+
json.dumps(converted)
290290

291291
def test_TimeTransform(self):
292292
tt = opentimelineio.opentime.TimeTransform()
293293

294-
d = tt.to_dict()
295-
self.assertTrue(isinstance(d, dict))
296-
json.dumps(d)
294+
converted = tt.to_dict()
295+
self.assertTrue(isinstance(converted, dict))
296+
json.dumps(converted)

0 commit comments

Comments
 (0)