Skip to content

Commit f2d35ae

Browse files
chore: reworked autogen
1 parent 14e7739 commit f2d35ae

4 files changed

Lines changed: 43 additions & 43 deletions

File tree

libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/table.py

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def isUndoAvailable(self) -> bool:
202202
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.isUndoAvailable`
203203
204204
isUndoAvailable
205-
205+
206206
:return: bool
207207
'''
208208
return self._tableView.isUndoAvailable()
@@ -211,7 +211,7 @@ def isRedoAvailable(self) -> bool:
211211
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.isRedoAvailable`
212212
213213
isRedoAvailable
214-
214+
215215
:return: bool
216216
'''
217217
return self._tableView.isRedoAvailable()
@@ -247,9 +247,9 @@ def setSortingEnabled(self, enable:bool) -> None:
247247
If enable is true, enables sorting for the table and immediately trigger a
248248
call to :meth:`sortByColumn`
249249
with the current sort section and order
250-
250+
251251
**Note**: Setter function for property sortingEnabled.
252-
252+
253253
:param enable: the availability of undo
254254
:type enable: bool
255255
'''
@@ -261,11 +261,11 @@ def isSortingEnabled(self) -> bool:
261261
This property holds whether sorting is enabled
262262
If this property is true, sorting is enabled for the table.
263263
If this property is false, sorting is not enabled. The default value is false.
264-
264+
265265
**Note**: . Setting the property to true with :meth:`setSortingEnabled`
266266
immediately triggers a call to :meth:`sortByColumn`
267267
with the current sort section and order.
268-
268+
269269
:return: bool
270270
'''
271271
return self._tableView.isSortingEnabled()
@@ -275,13 +275,13 @@ def sortByColumn(self, column:int, order:TTkK.SortOrder) -> None:
275275
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.sortByColumn`
276276
277277
Sorts the model by the values in the given column and order.
278-
278+
279279
column may be -1, in which case no sort indicator will be shown and the model will return to its natural, unsorted order.
280280
Note that not all models support this and may even crash in this case.
281-
281+
282282
:param column: the column used for the sorting, -1 to keep the table unsorted
283283
:type column: bool
284-
284+
285285
:param order: the sort order
286286
:type order: :py:class:`TTkK.SortOrder`
287287
'''
@@ -307,7 +307,7 @@ def setSelection(self, pos:tuple[int,int], size:tuple[int,int], flags:TTkK.TTkIt
307307
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.setSelection`
308308
309309
Selects the items within the given rect and in accordance with the specified selection flags.
310-
310+
311311
:param pos: the x,y position of the rect
312312
:type pos: tuple[int,int]
313313
:param size: the width,height of the rect used for the selection
@@ -321,7 +321,7 @@ def selectRow(self, row:int) -> None:
321321
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.selectRow`
322322
323323
Selects the given row in the table view
324-
324+
325325
:param row: the row to be selected
326326
:type row: int
327327
'''
@@ -331,7 +331,7 @@ def selectColumn(self, col:int) -> None:
331331
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.selectColumn`
332332
333333
Selects the given column in the table view
334-
334+
335335
:param col: the column to be selected
336336
:type col: int
337337
'''
@@ -341,7 +341,7 @@ def unselectRow(self, row:int) -> None:
341341
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.unselectRow`
342342
343343
Unselects the given row in the table view
344-
344+
345345
:param row: the row to be unselected
346346
:type row: int
347347
'''
@@ -351,7 +351,7 @@ def unselectColumn(self, column:int) -> None:
351351
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.unselectColumn`
352352
353353
Unselects the given column in the table view
354-
354+
355355
:param column: the column to be unselected
356356
:type column: int
357357
'''
@@ -361,7 +361,7 @@ def rowCount(self) -> int:
361361
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.rowCount`
362362
363363
Returns the number of rows.
364-
364+
365365
:return: int
366366
'''
367367
return self._tableView.rowCount()
@@ -370,7 +370,7 @@ def currentRow(self) -> int:
370370
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.currentRow`
371371
372372
Returns the row of the current item.
373-
373+
374374
:return: int
375375
'''
376376
return self._tableView.currentRow()
@@ -379,7 +379,7 @@ def columnCount(self) -> int:
379379
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.columnCount`
380380
381381
Returns the number of columns.
382-
382+
383383
:return: int
384384
'''
385385
return self._tableView.columnCount()
@@ -388,7 +388,7 @@ def currentColumn(self) -> int:
388388
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.currentColumn`
389389
390390
Returns the column of the current item.
391-
391+
392392
:return: int
393393
'''
394394
return self._tableView.currentColumn()
@@ -397,7 +397,7 @@ def verticalHeader(self) -> TTkHeaderView:
397397
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.verticalHeader`
398398
399399
Returns the table view's vertical header.
400-
400+
401401
:return: :py:class:`TTkHeaderView`
402402
'''
403403
return self._tableView.verticalHeader()
@@ -406,7 +406,7 @@ def horizontalHeader(self) -> TTkHeaderView:
406406
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.horizontalHeader`
407407
408408
Returns the table view's horizontal header.
409-
409+
410410
:return: :py:class:`TTkHeaderView`
411411
'''
412412
return self._tableView.horizontalHeader()
@@ -415,7 +415,7 @@ def hSeparatorVisibility(self) -> bool:
415415
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.hSeparatorVisibility`
416416
417417
Returns the visibility status of the horizontal separator
418-
418+
419419
:return: bool
420420
'''
421421
return self._tableView.hSeparatorVisibility()
@@ -424,7 +424,7 @@ def vSeparatorVisibility(self) -> bool:
424424
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.vSeparatorVisibility`
425425
426426
Returns the visibility status of the vertical separator
427-
427+
428428
:return: bool
429429
'''
430430
return self._tableView.vSeparatorVisibility()
@@ -433,17 +433,17 @@ def setHSeparatorVisibility(self, visibility:bool) -> None:
433433
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.setHSeparatorVisibility`
434434
435435
Set the the visibility of the horizontal separators (lines)
436-
436+
437437
::
438-
438+
439439
Customer Id First Name Last Name Company
440440
1 │ DD37Cf93aecA6Dc Sheryl Baxter Rasmussen Group
441441
╾╌╌┼───────────────────────────────────────────────────────────
442442
2 │ 1Ef7b82A4CAAD10 Preston Lozano Vega-Gentry
443443
╾╌╌┼───────────────────────────────────────────────────────────
444444
3 │ 6F94879bDAfE5a6 Roy Berry Murillo-Perry
445445
╾╌╌┼───────────────────────────────────────────────────────────
446-
446+
447447
:param visibility: the visibility status
448448
:type visibility: bool
449449
'''
@@ -453,17 +453,17 @@ def setVSeparatorVisibility(self, visibility:bool):
453453
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.setVSeparatorVisibility`
454454
455455
Set the the visibility of the vertical separators (lines)
456-
456+
457457
::
458-
458+
459459
Customer Id ╿First Name ╿Last Name ╿Company ╿
460460
1 │ DD37Cf93aecA6Dc │Sheryl │Baxter │Rasmussen Group │
461461
2 │ 1Ef7b82A4CAAD10 │Preston │Lozano │Vega-Gentry │
462462
3 │ 6F94879bDAfE5a6 │Roy │Berry │Murillo-Perry │
463463
4 │ 5Cef8BFA16c5e3c │Linda │Olsen │Dominguez, Mcmillan and Don │
464464
5 │ 053d585Ab6b3159 │Joanna │Bender │Martin, Lang and Andrade │
465465
6 │ 2d08FB17EE273F4 │Aimee │Downs │Steele Group │
466-
466+
467467
:param visibility: the visibility status
468468
:type visibility: bool
469469
'''
@@ -473,7 +473,7 @@ def model(self) -> TTkAbstractTableModel:
473473
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.model`
474474
475475
Returns the model that this view is presenting.
476-
476+
477477
:return: :py:class:`TTkAbstractTableModel`
478478
'''
479479
return self._tableView.model()
@@ -482,7 +482,7 @@ def setModel(self, model:TTkAbstractTableModel) -> None:
482482
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.setModel`
483483
484484
Sets the model for the view to present.
485-
485+
486486
:param model:
487487
:type model: :py:class:`TTkAbstractTableModel`
488488
'''
@@ -493,7 +493,7 @@ def setColumnWidth(self, column:int, width: int) -> None:
493493
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.setColumnWidth`
494494
495495
Sets the width of the given column.
496-
496+
497497
:param column: the column
498498
:type column: int
499499
:param width: its width
@@ -506,7 +506,7 @@ def resizeColumnToContents(self, column:int) -> None:
506506
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.resizeColumnToContents`
507507
508508
Resizes the given column based on the size hints of the delegate used to render each item in the column.
509-
509+
510510
:param column: the column to be resized
511511
:type column: int
512512
'''
@@ -525,7 +525,7 @@ def setRowHeight(self, row:int, height: int) -> None:
525525
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.setRowHeight`
526526
527527
Sets the height of the given row.
528-
528+
529529
:param row: the row
530530
:type row: int
531531
:param height: its height
@@ -538,7 +538,7 @@ def resizeRowToContents(self, row:int) -> None:
538538
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.resizeRowToContents`
539539
540540
Resizes the given row based on the size hints of the delegate used to render each item in the row.
541-
541+
542542
:param row: the row to be resized
543543
:type row: int
544544
'''

libs/pyTermTk/TermTk/TTkWidgets/TTkTerminal/terminal.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def titleChanged(self) -> pyTTkSignal:
7272
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.titleChanged`
7373
7474
This signal is emitted when the terminal title change through OSC "ESC ]0;"
75-
75+
7676
:param title: the new title
7777
:type title: str
7878
'''
@@ -91,7 +91,7 @@ def textSelected(self) -> pyTTkSignal:
9191
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.textSelected`
9292
9393
This signal is emitted when a text is selected.
94-
94+
9595
:param text: the selected text
9696
:type text: :py:class:`ttkString`
9797
'''
@@ -102,14 +102,14 @@ def termData(self) -> pyTTkSignal:
102102
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.termData`
103103
104104
This signal is emitted when data event fires.
105-
105+
106106
This happens for example when the user types or pastes into the terminal.
107107
The event value is whatever 'str' results, in a typical setup,
108108
this should be passed on to the backing pty.
109-
109+
110110
This signal is used in :py:class:`TTkTerminalHelper` through :py:meth:`TTkTerminalHelper.attachTTkTerminal`
111111
to frward all the terminal events to the pty interface.
112-
112+
113113
:param data: the event data
114114
:type data: str
115115
'''
@@ -120,7 +120,7 @@ def termResized(self) -> pyTTkSignal:
120120
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.termResized`
121121
122122
This signal is emitted when the terminal is resized.
123-
123+
124124
:param size: the new size [width, height] of the terminal
125125
:type size: (int,int)
126126
'''

libs/pyTermTk/TermTk/TTkWidgets/texedit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ def extraSelections(self) -> list[ExtraSelection]:
12001200
.. seealso:: this method is forwarded to :py:meth:`TTkTextEditView.extraSelections`
12011201
12021202
Returns previously set extra selections.
1203-
1203+
12041204
:rtype: list[:py:class:`ExtraSelection`]
12051205
'''
12061206
return self._textEditView.extraSelections()
@@ -1211,7 +1211,7 @@ def setExtraSelections(self, extraSelections:list[ExtraSelection]) -> None:
12111211
This function allows temporarily marking certain regions in the document with a given color,
12121212
specified as selections. This can be useful for example in a programming editor to mark a
12131213
whole line of text with a given background color to indicate the existence of a breakpoint.
1214-
1214+
12151215
:param extraSelections: the list of extra selections.
12161216
:type extraSelections: list[:py:class:`ExtraSelection`]
12171217
'''

tools/autogenForwarded.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def autogen_methods(data: _ForwardData) -> List[str]:
109109
doc_indent + f".. seealso:: this method is forwarded to :py:meth:`{class_name}.{method_name}`\n",
110110
])
111111
if doc:
112-
lines.extend([doc_indent + _l for _l in doc.split('\n')])
112+
lines.extend([f"{doc_indent}{_l}" if _l else '' for _l in doc.split('\n')])
113113
lines.append(doc_indent + "'''")
114114
# Format the signature string
115115
signatures.extend([

0 commit comments

Comments
 (0)