Skip to content

Commit 2c0612e

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

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

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

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

398398

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

407407

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

416416

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

425425

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

434434

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

443443

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

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)