Skip to content

Commit fed5e99

Browse files
committed
Fix pdoc
1 parent 5a33a4d commit fed5e99

File tree

6 files changed

+14
-29
lines changed

6 files changed

+14
-29
lines changed

cros_ec_python/devices/dev.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
from ..commands.general import EC_CMD_READ_MEMMAP
1212
from ..exceptions import ECError
1313

14+
__all__ = ["CrosEcDev"]
15+
1416
CROS_EC_IOC_MAGIC: Final = 0xEC
1517

1618

17-
def _IOC(dir: int, type: int, nr: int, size: int):
19+
def IOC(dir: int, type: int, nr: int, size: int):
1820
"""
1921
Create an ioctl command number.
2022
Based on the Linux kernels include/uapi/asm-generic/ioctl.h.
@@ -28,15 +30,15 @@ def _IOC(dir: int, type: int, nr: int, size: int):
2830
return dir << dir_shift | size << size_shift | type << type_shift | nr << nr_shift
2931

3032

31-
def _IORW(type: int, nr: int, size: int):
33+
def IORW(type: int, nr: int, size: int):
3234
"""
3335
Create an ioctl command number for read/write commands.
3436
Based on the Linux kernels include/uapi/asm-generic/ioctl.h.
3537
"""
3638
none = 0
3739
write = 1
3840
read = 2
39-
return _IOC((read | write), type, nr, size)
41+
return IOC((read | write), type, nr, size)
4042

4143

4244
class CrosEcDev(CrosEcClass):
@@ -99,7 +101,7 @@ def command(
99101
buf = bytearray(cmd + bytes(max(outsize, insize)))
100102
buf[len(cmd): len(cmd) + outsize] = data
101103

102-
CROS_EC_DEV_IOCXCMD = _IORW(CROS_EC_IOC_MAGIC, 0, len(cmd))
104+
CROS_EC_DEV_IOCXCMD = IORW(CROS_EC_IOC_MAGIC, 0, len(cmd))
103105
result = ioctl(self.fd, CROS_EC_DEV_IOCXCMD, buf)
104106

105107
if result < 0:
@@ -125,7 +127,7 @@ def memmap(self, offset: Int32, num_bytes: Int32) -> bytes:
125127
if self.memmap_ioctl:
126128
data = struct.pack("<II", offset, num_bytes)
127129
buf = bytearray(data + bytes(num_bytes))
128-
CROS_EC_DEV_IOCRDMEM = _IORW(
130+
CROS_EC_DEV_IOCRDMEM = IORW(
129131
CROS_EC_IOC_MAGIC, 1, len(data) + EC_MEMMAP_SIZE + 1
130132
)
131133
try:

cros_ec_python/devices/win_fw_ec.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
import warnings
33
import os
44
import ctypes
5-
from ctypes import wintypes, windll
5+
from ctypes import wintypes
6+
7+
# Workaround for pdoc failing on Linux
8+
if os.name == 'nt':
9+
from ctypes import windll
10+
11+
__all__ = ["WinFrameworkEc"]
612

713
from ..baseclass import CrosEcClass
814
from ..constants.COMMON import *

pdoc/custom.css

Lines changed: 0 additions & 20 deletions
This file was deleted.

pdoc/resources/exclamation-octagon-fill.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

pdoc/resources/exclamation-square-fill.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

pdoc/resources/lightbulb.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)