@@ -17,6 +17,8 @@ from errno import ENOENT
from select import select
from typing import Union, Optional
+__all__ = "Chip"
+
class Chip:
"""
@@ -4,6 +4,8 @@
from dataclasses import dataclass
+__all__ = "ChipInfo"
+
@dataclass(frozen=True, repr=False)
class ChipInfo:
@@ -5,6 +5,8 @@ from . import _ext
from dataclasses import dataclass
from enum import Enum
+__all__ = "EdgeEvent"
+
@dataclass(frozen=True, init=False, repr=False)
class EdgeEvent:
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
# SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
+__all__ = ["ChipClosedError", "RequestReleasedError"]
+
class ChipClosedError(Exception):
"""
@@ -157,8 +157,8 @@ static PyTypeObject *types[] = {
PyMODINIT_FUNC PyInit__ext(void)
{
const struct module_const *modconst;
+ PyObject *module, *all;
PyTypeObject **type;
- PyObject *module;
int ret;
module = PyModule_Create(&module_def);
@@ -172,6 +172,19 @@ PyMODINIT_FUNC PyInit__ext(void)
return NULL;
}
+ all = PyList_New(0);
+ if (!all) {
+ Py_DECREF(module);
+ return NULL;
+ }
+
+ ret = PyModule_AddObjectRef(module, "__all__", all);
+ Py_DECREF(all);
+ if (ret) {
+ Py_DECREF(module);
+ return NULL;
+ }
+
for (type = types; *type; type++) {
ret = PyModule_AddType(module, *type);
if (ret) {
@@ -6,6 +6,8 @@ from .line_info import LineInfo
from dataclasses import dataclass
from enum import Enum
+__all__ = "InfoEvent"
+
@dataclass(frozen=True, init=False, repr=False)
class InfoEvent:
@@ -5,6 +5,8 @@ from datetime import timedelta
from select import select
from typing import Optional, Union
+__all__ = []
+
def poll_fd(fd: int, timeout: Optional[Union[timedelta, float]] = None) -> bool:
if isinstance(timeout, timedelta):
@@ -5,6 +5,8 @@
from . import _ext
from enum import Enum
+__all__ = ["Value", "Direction", "Bias", "Drive", "Edge", "Clock"]
+
class Value(Enum):
"""Logical line states."""
@@ -6,6 +6,8 @@ from dataclasses import dataclass
from datetime import timedelta
from gpiod.line import Direction, Bias, Drive, Edge, Clock
+__all__ = "LineInfo"
+
@dataclass(frozen=True, init=False, repr=False)
class LineInfo:
@@ -11,6 +11,8 @@ from collections.abc import Iterable
from datetime import timedelta
from typing import Optional, Union
+__all__ = "LineRequest"
+
class LineRequest:
"""
@@ -6,6 +6,8 @@ from dataclasses import dataclass
from datetime import timedelta
from gpiod.line import Direction, Bias, Drive, Edge, Clock, Value
+__all__ = "LineSettings"
+
@dataclass(repr=False)
class LineSettings: