From 529f8fe31cd4de7e313ebd12145865088d9990e5 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Fri, 18 Oct 2019 15:15:38 +0200 Subject: [PATCH] api: rename _common to builtins Because this module describes devices that can be built into a hub or other device. Since this design is now explicitly shown in the docs as well, we don't need to hide this module in the package. --- Pipfile | 2 +- pybricks/_instances.py | 2 +- pybricks/{_common.py => builtins.py} | 0 pybricks/cityhub.py | 2 +- pybricks/ev3brick.py | 2 +- pybricks/ev3devices.py | 2 +- pybricks/hubs.py | 2 +- pybricks/lpf2devices.py | 4 ++-- pybricks/movehub.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) rename pybricks/{_common.py => builtins.py} (100%) diff --git a/Pipfile b/Pipfile index a9b7688..560b634 100644 --- a/Pipfile +++ b/Pipfile @@ -6,7 +6,7 @@ verify_ssl = true [dev-packages] sphinx = "*" flake8 = "*" -sphinx-rtd-theme = "~=0.4.0" +sphinx-rtd-theme = "==0.4.2" doc8 = "*" [packages] diff --git a/pybricks/_instances.py b/pybricks/_instances.py index 2cb2201..6d78463 100644 --- a/pybricks/_instances.py +++ b/pybricks/_instances.py @@ -1,6 +1,6 @@ """Sphinx workaround to document instance attributes such as self.light""" -from ._common import Speaker, Display, Battery, ColorLight, KeyPad, LightArray +from .builtins import Speaker, Display, Battery, ColorLight, KeyPad, LightArray from types import ModuleType diff --git a/pybricks/_common.py b/pybricks/builtins.py similarity index 100% rename from pybricks/_common.py rename to pybricks/builtins.py diff --git a/pybricks/cityhub.py b/pybricks/cityhub.py index eabaf13..fb0d2f6 100644 --- a/pybricks/cityhub.py +++ b/pybricks/cityhub.py @@ -1,6 +1,6 @@ """LEGO® Power Functions 2.0 City Hub.""" -from ._common import Battery, ColorLight +from .builtins import Battery, ColorLight battery = Battery() light = ColorLight() diff --git a/pybricks/ev3brick.py b/pybricks/ev3brick.py index d63dd81..f655cd1 100644 --- a/pybricks/ev3brick.py +++ b/pybricks/ev3brick.py @@ -1,6 +1,6 @@ """LEGO® MINDSTORMS® EV3 Brick.""" -from ._common import Speaker, Display, Battery, ColorLight, KeyPad +from .builtins import Speaker, Display, Battery, ColorLight, KeyPad sound = Speaker() display = Display() diff --git a/pybricks/ev3devices.py b/pybricks/ev3devices.py index d03679b..e605ae4 100644 --- a/pybricks/ev3devices.py +++ b/pybricks/ev3devices.py @@ -1,7 +1,7 @@ """LEGO® MINDSTORMS® EV3 motors and sensors.""" from .parameters import Direction -from ._common import Motor as CommonMotor +from .builtins import Motor as CommonMotor class Motor(CommonMotor): diff --git a/pybricks/hubs.py b/pybricks/hubs.py index d1488cb..d9eda86 100644 --- a/pybricks/hubs.py +++ b/pybricks/hubs.py @@ -1,6 +1,6 @@ """LEGO® Programmable Hubs.""" from enum import Enum -from ._common import Speaker, Display, Battery, ColorLight, KeyPad +from .builtins import Speaker, Display, Battery, ColorLight, KeyPad class EV3Brick(): """LEGO® MINDSTORMS® EV3 Brick. diff --git a/pybricks/lpf2devices.py b/pybricks/lpf2devices.py index e2629c9..ccc09cd 100644 --- a/pybricks/lpf2devices.py +++ b/pybricks/lpf2devices.py @@ -1,8 +1,8 @@ """LEGO® Power Functions 2.0 motor, sensors, and lights.""" -from ._common import Motor as CommonMotor, ColorLight +from .builtins import Motor as CommonMotor, ColorLight -from ._common import KeyPad, Accelerometer +from .builtins import KeyPad, Accelerometer # The above abviously needs fixing (but not until after fixing merge conflict) diff --git a/pybricks/movehub.py b/pybricks/movehub.py index 2b0a956..bab7e12 100644 --- a/pybricks/movehub.py +++ b/pybricks/movehub.py @@ -1,6 +1,6 @@ """LEGO® Power Functions 2.0 Move Hub.""" -from ._common import Battery, ColorLight +from .builtins import Battery, ColorLight battery = Battery() light = ColorLight()