mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
aux/bindings: Fix a few pep8 errors
This commit is contained in:
parent
a8c254a8cf
commit
2715b0e144
|
@ -8,7 +8,6 @@ import argparse
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PathsByLengthCollector:
|
class PathsByLengthCollector:
|
||||||
"""Helper class to sort paths by length, useful for creating fast path
|
"""Helper class to sort paths by length, useful for creating fast path
|
||||||
validation functions.
|
validation functions.
|
||||||
|
@ -34,6 +33,7 @@ class PathsByLengthCollector:
|
||||||
ret[length] = list(set_per_length)
|
ret[length] = list(set_per_length)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
class Component:
|
class Component:
|
||||||
"""Components correspond with the standard OpenXR components click, touch,
|
"""Components correspond with the standard OpenXR components click, touch,
|
||||||
force, value, x, y, twist, pose
|
force, value, x, y, twist, pose
|
||||||
|
@ -44,13 +44,16 @@ class Component:
|
||||||
subaction_path,
|
subaction_path,
|
||||||
identifier_path,
|
identifier_path,
|
||||||
json_subpath):
|
json_subpath):
|
||||||
"""Turn a Identifier's component paths into a list of Component objects."""
|
"""
|
||||||
|
Turn a Identifier's component paths into a list of Component objects.
|
||||||
|
"""
|
||||||
|
|
||||||
|
monado_bindings = json_subpath["monado_bindings"]
|
||||||
component_list = []
|
component_list = []
|
||||||
for component_name in json_subpath["components"]: # click, touch, ...
|
for component_name in json_subpath["components"]: # click, touch, ...
|
||||||
monado_binding = None
|
monado_binding = None
|
||||||
if component_name in json_subpath["monado_bindings"]:
|
if component_name in monado_bindings:
|
||||||
monado_binding = json_subpath["monado_bindings"][component_name]
|
monado_binding = monado_bindings[component_name]
|
||||||
|
|
||||||
c = Component(subaction_path,
|
c = Component(subaction_path,
|
||||||
identifier_path,
|
identifier_path,
|
||||||
|
@ -182,7 +185,8 @@ class Bindings:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def parse(cls, json_root):
|
def parse(cls, json_root):
|
||||||
"""Parse an entire bindings.json into a collection of Profile objects."""
|
"""Parse an entire bindings.json into a collection of Profile objects.
|
||||||
|
"""
|
||||||
return cls(json_root)
|
return cls(json_root)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in a new issue