From 8d521c1b1f6eced15b3191d3bccf9b59db047748 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Fri, 23 Jul 2021 10:48:07 +0200 Subject: [PATCH] doc/common/conf: Drop EV3 hack. This is no longer required, perhaps not even for EV3. For example, PrimeHub.speaker looks as intended. We want to reduce the number of hacks because they tend to break updates (https://github.com/pybricks/pybricks-api/issues/69#issuecomment-879822417). --- doc/common/conf.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/doc/common/conf.py b/doc/common/conf.py index 78c68d6..6dd78df 100644 --- a/doc/common/conf.py +++ b/doc/common/conf.py @@ -326,32 +326,3 @@ def get_signature_prefix(self, sig): PyClassmember.get_signature_prefix = get_signature_prefix - - -# HACK: For certain hub attributes, we list the class members of the attributes -# class as if the attribute was a nested class so that readers don't have to -# skip around the docs as much. To make this work, we replace the attribute -# values with the type and override PythonDomain.find_obj so that references -# still work. - -base_find_obj = PythonDomain.find_obj - - -def find_obj(self, env, modname, classname, name, type, searchmode=0): - if modname == 'pybricks.hubs': - if classname == 'screen': - if name.startswith('Font.') or name == 'Font': - modname = 'pybricks.media.ev3dev' - elif name.startswith('Image.') or name == 'Image': - modname = 'pybricks.media.ev3dev' - else: - classname = 'EV3Brick.screen' - elif classname == 'speaker': - classname = 'EV3Brick.speaker' - return base_find_obj(self, env, modname, classname, name, type, searchmode) - - -PythonDomain.find_obj = find_obj - -EV3Brick.screen = Image -EV3Brick.speaker = Speaker