Skip to content

Commit 5a66130

Browse files
committed
Various doc and spelling fixes.
1 parent eccad15 commit 5a66130

File tree

14 files changed

+181
-96
lines changed

14 files changed

+181
-96
lines changed

.vscode/settings.json

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
},
2121
"cSpell.words": [
2222
"ADDA",
23+
"ADDALPHA",
2324
"addressof",
2425
"addsub",
2526
"addx",
2627
"addy",
2728
"algo",
2829
"ALPH",
30+
"ALTERASE",
2931
"arange",
3032
"ARCHS",
3133
"asarray",
@@ -34,7 +36,13 @@
3436
"astype",
3537
"atexit",
3638
"AUDIOCVT",
39+
"AUDIOFASTFORWARD",
40+
"AUDIOMUTE",
41+
"AUDIONEXT",
42+
"AUDIOPLAY",
3743
"AUDIOPREV",
44+
"AUDIOREWIND",
45+
"AUDIOSTOP",
3846
"autoclass",
3947
"autofunction",
4048
"autogenerated",
@@ -45,24 +53,33 @@
4553
"bezier",
4654
"bfade",
4755
"bgcolor",
56+
"bitmask",
4857
"BKGND",
4958
"Blit",
5059
"blits",
5160
"blitting",
61+
"BORDERLESS",
5262
"bresenham",
5363
"Bresenham",
64+
"BRIGHTNESSDOWN",
5465
"BRIGHTNESSUP",
5566
"bysource",
5667
"caeldera",
68+
"CAPSLOCK",
69+
"caxis",
70+
"cbutton",
5771
"ccoef",
5872
"cdef",
73+
"cdevice",
5974
"cffi",
6075
"cflags",
6176
"CFLAGS",
6277
"CHARMAP",
6378
"Chebyshev",
6479
"cibuildwheel",
6580
"CIBW",
81+
"CLEARAGAIN",
82+
"CLEARENTRY",
6683
"CMWC",
6784
"Codacy",
6885
"Codecov",
@@ -71,22 +88,36 @@
7188
"coef",
7289
"Coef",
7390
"COLCTRL",
91+
"COMPILEDVERSION",
7492
"consolas",
93+
"contextdata",
94+
"CONTROLLERAXISMOTION",
95+
"CONTROLLERBUTTONDOWN",
96+
"CONTROLLERBUTTONUP",
97+
"CONTROLLERDEVICEADDED",
98+
"CONTROLLERDEVICEREMAPPED",
99+
"CONTROLLERDEVICEREMOVED",
75100
"cplusplus",
76101
"CPLUSPLUS",
77102
"CRSEL",
78103
"ctypes",
104+
"CURRENCYSUBUNIT",
105+
"CURRENCYUNIT",
79106
"currentmodule",
80107
"datas",
108+
"DBLAMPERSAND",
109+
"DBLVERTICALBAR",
81110
"dcost",
82111
"DCROSS",
112+
"DECIMALSEPARATOR",
83113
"dejavu",
84114
"delocate",
85115
"deque",
86116
"desaturated",
87117
"DESATURATED",
88118
"devel",
89119
"DHLINE",
120+
"DISPLAYSWITCH",
90121
"dlopen",
91122
"Doryen",
92123
"DTEEE",
@@ -101,6 +132,7 @@
101132
"epub",
102133
"EQUALSAS",
103134
"errorvf",
135+
"EXCLAM",
104136
"EXSEL",
105137
"favicon",
106138
"ffade",
@@ -110,6 +142,7 @@
110142
"fmean",
111143
"fontx",
112144
"fonty",
145+
"frombuffer",
113146
"fullscreen",
114147
"fwidth",
115148
"genindex",
@@ -122,6 +155,7 @@
122155
"heapify",
123156
"heightmap",
124157
"hflip",
158+
"HIGHDPI",
125159
"hillclimb",
126160
"hline",
127161
"horiz",
@@ -138,17 +172,32 @@
138172
"INROW",
139173
"isinstance",
140174
"isort",
175+
"itemsize",
141176
"itleref",
142177
"ivar",
178+
"jaxis",
179+
"jball",
180+
"jbutton",
181+
"jdevice",
182+
"jhat",
143183
"jice",
144184
"jieba",
185+
"JOYAXISMOTION",
186+
"JOYBALLMOTION",
187+
"JOYBUTTONDOWN",
188+
"JOYBUTTONUP",
189+
"JOYDEVICEADDED",
190+
"JOYDEVICEREMOVED",
191+
"JOYHATMOTION",
145192
"Kaczor",
146193
"KBDILLUMDOWN",
147194
"KBDILLUMTOGGLE",
148195
"KBDILLUMUP",
149196
"keychar",
197+
"KEYDOWN",
150198
"keyname",
151199
"keypress",
200+
"keysym",
152201
"KEYUP",
153202
"KMOD",
154203
"KPADD",
@@ -162,6 +211,8 @@
162211
"lbutton",
163212
"LCTRL",
164213
"LDFLAGS",
214+
"LEFTBRACE",
215+
"LEFTBRACKET",
165216
"LEFTPAREN",
166217
"lerp",
167218
"LGUI",
@@ -180,16 +231,28 @@
180231
"maxarray",
181232
"maxdepth",
182233
"mbutton",
234+
"MEDIASELECT",
183235
"MEIPASS",
236+
"MEMADD",
237+
"MEMCLEAR",
238+
"MEMDIVIDE",
239+
"MEMMULTIPLY",
240+
"MEMRECALL",
241+
"MEMSTORE",
242+
"MEMSUBTRACT",
184243
"mersenne",
244+
"meshgrid",
185245
"mgrid",
186246
"milli",
187247
"minmax",
188248
"mipmap",
189249
"mipmaps",
190250
"MMASK",
191251
"modindex",
252+
"MOUSEBUTTONDOWN",
192253
"MOUSEBUTTONUP",
254+
"MOUSEMOTION",
255+
"MOUSESTATE",
193256
"msilib",
194257
"MSVC",
195258
"msvcr",
@@ -200,6 +263,7 @@
200263
"namegen",
201264
"ndarray",
202265
"ndim",
266+
"newaxis",
203267
"newh",
204268
"neww",
205269
"noarchive",
@@ -217,16 +281,21 @@
217281
"onefile",
218282
"OPENGL",
219283
"OPER",
284+
"PAGEDOWN",
220285
"PAGEUP",
221286
"pathfinding",
222287
"pathlib",
223288
"pcpp",
289+
"PERLIN",
224290
"PILCROW",
225291
"pilmode",
226292
"PIXELFORMAT",
293+
"PLUSMINUS",
227294
"PRESENTVSYNC",
228295
"PRINTF",
229296
"printn",
297+
"PRINTSCREEN",
298+
"propname",
230299
"pycall",
231300
"pycparser",
232301
"pyinstaller",
@@ -238,6 +307,7 @@
238307
"PYTHONOPTIMIZE",
239308
"Pyup",
240309
"quickstart",
310+
"QUOTEDBL",
241311
"RALT",
242312
"randomizer",
243313
"rbutton",
@@ -249,6 +319,8 @@
249319
"repr",
250320
"rgba",
251321
"RGUI",
322+
"RIGHTBRACE",
323+
"RIGHTBRACKET",
252324
"RIGHTPAREN",
253325
"RMASK",
254326
"rmeta",
@@ -261,13 +333,16 @@
261333
"scalex",
262334
"scaley",
263335
"Scancode",
336+
"scancodes",
264337
"scipy",
265338
"scoef",
339+
"SCROLLLOCK",
266340
"sdist",
267341
"SDL's",
268342
"SDLCALL",
269343
"sdlevent",
270344
"SDLK",
345+
"seealso",
271346
"servernum",
272347
"setuptools",
273348
"SHADOWCAST",
@@ -291,32 +366,56 @@
291366
"TEEW",
292367
"TEXTUREACCESS",
293368
"thirdparty",
369+
"THOUSANDSSEPARATOR",
294370
"Tileset",
295371
"tilesets",
296372
"tilesheet",
373+
"tilesheets",
297374
"timeit",
298375
"toctree",
299376
"todos",
300377
"tolist",
301378
"tris",
302379
"truetype",
380+
"typestr",
303381
"undoc",
304382
"Unifont",
305383
"unraisablehook",
306384
"unraiseable",
307385
"upscaling",
386+
"userdata",
308387
"VAFUNC",
388+
"VALUELIST",
309389
"vcoef",
310390
"venv",
311391
"vertic",
392+
"VERTICALBAR",
312393
"vflip",
313394
"vline",
395+
"VOLUMEDOWN",
314396
"VOLUMEUP",
315397
"voronoi",
316398
"VRAM",
317399
"vsync",
318400
"WASD",
401+
"windowclose",
402+
"windowenter",
403+
"WINDOWEVENT",
404+
"windowexposed",
405+
"windowfocusgained",
406+
"windowfocuslost",
407+
"windowhidden",
408+
"windowhittest",
409+
"windowleave",
410+
"windowmaximized",
411+
"windowminimized",
412+
"windowmoved",
413+
"WINDOWPOS",
319414
"WINDOWRESIZED",
415+
"windowrestored",
416+
"windowshown",
417+
"windowsizechanged",
418+
"windowtakefocus",
320419
"xdst",
321420
"xrel",
322421
"xvfb",

tcod/_internal.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""This module internal helper functions used by the rest of the library.
2-
"""
1+
"""This module internal helper functions used by the rest of the library."""
32
from __future__ import annotations
43

54
import functools
@@ -39,8 +38,7 @@ def pending_deprecate(
3938
category: Any = PendingDeprecationWarning,
4039
stacklevel: int = 0,
4140
) -> Callable[[F], F]:
42-
"""Like deprecate, but the default parameters are filled out for a generic
43-
pending deprecation warning."""
41+
"""Like deprecate, but the default parameters are filled out for a generic pending deprecation warning."""
4442
return deprecate(message, category, stacklevel)
4543

4644

@@ -88,7 +86,7 @@ def _unpack_char_p(char_p: Any) -> str:
8886

8987

9088
def _int(int_or_str: Any) -> int:
91-
"return an integer where a single character string may be expected"
89+
"""Return an integer where a single character string may be expected."""
9290
if isinstance(int_or_str, str):
9391
return ord(int_or_str)
9492
if isinstance(int_or_str, bytes):
@@ -125,8 +123,9 @@ def _fmt(string: str, stacklevel: int = 2) -> bytes:
125123

126124

127125
class _PropagateException:
128-
"""Context manager designed to propagate exceptions outside of a cffi
129-
callback context. Normally cffi suppresses the exception.
126+
"""Context manager designed to propagate exceptions outside of a cffi callback context.
127+
128+
Normally cffi suppresses the exception.
130129
131130
When propagate is called this class will hold onto the error until the
132131
control flow leaves the context, then the error will be raised.
@@ -148,9 +147,7 @@ def propagate(self, *exc_info: Any) -> None:
148147
self.exc_info = exc_info
149148

150149
def __enter__(self) -> Callable[[Any], None]:
151-
"""Once in context, only the propagate call is needed to use this
152-
class effectively.
153-
"""
150+
"""Once in context, only the propagate call is needed to use this class effectively."""
154151
return self.propagate
155152

156153
def __exit__(self, type: Any, value: Any, traceback: Any) -> None:

tcod/bsp.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
r"""
22
The following example shows how to traverse the BSP tree using Python. This
33
assumes `create_room` and `connect_rooms` will be replaced by custom code.
44
@@ -19,7 +19,7 @@
1919
for node in bsp.pre_order():
2020
if node.children:
2121
node1, node2 = node.children
22-
print('Connect the rooms:\\n%s\\n%s' % (node1, node2))
22+
print('Connect the rooms:\n%s\n%s' % (node1, node2))
2323
else:
2424
print('Dig a room for %s.' % node)
2525
"""
@@ -33,8 +33,7 @@
3333

3434

3535
class BSP(object):
36-
"""A binary space partitioning tree which can be used for simple dungeon
37-
generation.
36+
"""A binary space partitioning tree which can be used for simple dungeon generation.
3837
3938
Attributes:
4039
x (int): Rectangle left coordinate.
@@ -242,7 +241,7 @@ def inverted_level_order(self) -> Iterator[BSP]:
242241
yield from levels.pop()
243242

244243
def contains(self, x: int, y: int) -> bool:
245-
"""Returns True if this node contains these coordinates.
244+
"""Return True if this node contains these coordinates.
246245
247246
Args:
248247
x (int): X position to check.

0 commit comments

Comments
 (0)