From abe6990abff93a7e0a543692c5197f8b21807204 Mon Sep 17 00:00:00 2001 From: Lars Vierbergen Date: Tue, 24 Jan 2017 01:00:46 +0100 Subject: [PATCH] Control which symbols are exposed by modules --- daemon.py | 2 +- modules/__init__.py | 2 +- modules/application.py | 1 + modules/caffeine.py | 3 ++- modules/core.py | 2 ++ modules/redshift.py | 1 + modules/toggle.py | 1 + modules/util.py | 1 + modules/volume.py | 2 ++ 9 files changed, 12 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index 7a00520..5a57025 100755 --- a/daemon.py +++ b/daemon.py @@ -12,7 +12,7 @@ modules.Application( separator='' ), modules.ActionWrapperControl( - modules.PulseCtlVolumeControl(), + modules.VolumeControl(), action='pavucontrol', buttons=modules.core.Button.RIGHT ), diff --git a/modules/__init__.py b/modules/__init__.py index 14180f7..97ec9a1 100644 --- a/modules/__init__.py +++ b/modules/__init__.py @@ -2,4 +2,4 @@ from .application import Application from .core import GroupedControl, ActionWrapperControl from .caffeine import CaffeineControl from .redshift import RedshiftControl -from .volume import PaCtlVolumeControl, VolumeControl, PulseCtlVolumeControl +from .volume import VolumeControl diff --git a/modules/application.py b/modules/application.py index 4ab267e..e47a47e 100644 --- a/modules/application.py +++ b/modules/application.py @@ -13,6 +13,7 @@ import stat logger = logging.getLogger(__name__) +__all__ = ['Application'] class CreateFileType(argparse.FileType): def __init__(self, mode='r', bufsize=-1, encoding=None, errors=None): diff --git a/modules/caffeine.py b/modules/caffeine.py index cb5cca9..9bcb87c 100644 --- a/modules/caffeine.py +++ b/modules/caffeine.py @@ -1,10 +1,11 @@ import subprocess import logging - from .toggle import ToggleControl from .util import process_reaper, backoff +__all__ = ['CaffeineControl'] + logger = logging.getLogger(__name__) diff --git a/modules/core.py b/modules/core.py index 1b6e1b6..3de1fca 100644 --- a/modules/core.py +++ b/modules/core.py @@ -6,6 +6,8 @@ import sys import enum import logging +__all__ = ['AbstractControl', 'GroupedControl', 'WrappingControl', 'ActionWrapperControl', 'Button'] + logger = logging.getLogger(__name__) diff --git a/modules/redshift.py b/modules/redshift.py index f549d27..1766449 100644 --- a/modules/redshift.py +++ b/modules/redshift.py @@ -5,6 +5,7 @@ from .core import AbstractControl, action logger = logging.getLogger(__name__) +__all__ = ['RedshiftControl'] class RedshiftControl(AbstractControl): def __init__(self): diff --git a/modules/toggle.py b/modules/toggle.py index 192e346..b99874b 100644 --- a/modules/toggle.py +++ b/modules/toggle.py @@ -2,6 +2,7 @@ import abc from .core import AbstractControl, action +__all__ = ['ToggleControl'] class ToggleControl(AbstractControl, metaclass=abc.ABCMeta): """ diff --git a/modules/util.py b/modules/util.py index 4299dbe..99860e4 100644 --- a/modules/util.py +++ b/modules/util.py @@ -6,6 +6,7 @@ import time from .core import AbstractControl +__all__ = ['ChildReaperControl', 'QuitControl', 'backoff', 'process_reaper'] class QuitControl(AbstractControl): @property diff --git a/modules/volume.py b/modules/volume.py index 517b609..4233f56 100644 --- a/modules/volume.py +++ b/modules/volume.py @@ -7,6 +7,8 @@ from .core import AbstractControl, action, Button logger = logging.getLogger(__name__) +__all__ = ['AbstractControl', 'PaCtlVolumeControl', 'VolumeControl'] + class AbstractVolumeControl(AbstractControl, metaclass=abc.ABCMeta): @abc.abstractmethod