Browse Source

chore: autogen signals and rewrite forwarded as properties (#410)

pull/411/head
Pier CeccoPierangioliEugenio 10 months ago committed by GitHub
parent
commit
7597980256
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      .vscode/launch.json
  2. 150
      libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/filetree.py
  3. 98
      libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/filetreewidget.py
  4. 86
      libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/table.py
  5. 139
      libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/tablewidget.py
  6. 84
      libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/tree.py
  7. 120
      libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/treewidget.py
  8. 72
      libs/pyTermTk/TermTk/TTkWidgets/TTkTerminal/terminal.py
  9. 104
      libs/pyTermTk/TermTk/TTkWidgets/TTkTerminal/terminalview.py
  10. 39
      libs/pyTermTk/TermTk/TTkWidgets/list_.py
  11. 52
      libs/pyTermTk/TermTk/TTkWidgets/listwidget.py
  12. 156
      libs/pyTermTk/TermTk/TTkWidgets/texedit.py
  13. 57
      tools/autogenForwarded.py

8
.vscode/launch.json vendored

@ -19,7 +19,10 @@
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
"justMyCode": false,
"env": {
"PYTHONPATH": "libs/pyTermTk/"
},
},
{
"name": "Python: Current File with Args",
@ -28,6 +31,9 @@
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
"env": {
"PYTHONPATH": "libs/pyTermTk/"
},
"args": [
"tools/webExporter/js/ttkproxy.js"
]

150
libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/filetree.py

@ -48,7 +48,7 @@ class TTkFileTree(TTkTree):
'setFilter']
)
__slots__ = ('_fileTreeWidget', *_ttk_forward.signals)
__slots__ = ('_fileTreeWidget')
def __init__(self, **kwargs) -> None:
wkwargs = kwargs.copy()
@ -58,10 +58,152 @@ class TTkFileTree(TTkTree):
super().__init__(**kwargs, treeWidget=self._fileTreeWidget)
for _attr in self._ttk_forward.signals:
setattr(self,_attr,getattr(self._fileTreeWidget,_attr))
#--FORWARD-AUTOGEN-START--#
@property
def itemActivated(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.itemActivated`
This signal is emitted when the user activates an item by double-clicking
or pressing a special key (e.g., Enter).
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
return self._fileTreeWidget.itemActivated
@property
def itemChanged(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.itemChanged`
This signal is emitted when the contents of the column in the specified item changes.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column
:type col: int
'''
return self._fileTreeWidget.itemChanged
@property
def itemClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.itemClicked`
This signal is emitted when the user clicks inside the widget.
If no item was clicked, no signal will be emitted.
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
return self._fileTreeWidget.itemClicked
@property
def itemExpanded(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.itemExpanded`
This signal is emitted when the specified item is expanded so that all of its children are displayed.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
'''
return self._fileTreeWidget.itemExpanded
@property
def itemCollapsed(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.itemCollapsed`
This signal is emitted when the specified item is collapsed so that none of its children are displayed.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
'''
return self._fileTreeWidget.itemCollapsed
@property
def itemDoubleClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.itemDoubleClicked`
This signal is emitted when the user double clicks inside the widget.
If no item was double clicked, no signal will be emitted.
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
return self._fileTreeWidget.itemDoubleClicked
@property
def fileClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.fileClicked`
This signal is emitted when a file is clicked
:param file:
:type file: :py:class:`TTkFileTreeWidgetItem`
'''
return self._fileTreeWidget.fileClicked
@property
def folderClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.folderClicked`
This signal is emitted when a folder is clicked
:param folder:
:type folder: :py:class:`TTkFileTreeWidgetItem`
'''
return self._fileTreeWidget.folderClicked
@property
def fileDoubleClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.fileDoubleClicked`
This signal is emitted when a file is doubleclicked
:param file:
:type file: :py:class:`TTkFileTreeWidgetItem`
'''
return self._fileTreeWidget.fileDoubleClicked
@property
def folderDoubleClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.folderDoubleClicked`
This signal is emitted when a folder is doubleclicked
:param folder:
:type folder: :py:class:`TTkFileTreeWidgetItem`
'''
return self._fileTreeWidget.folderDoubleClicked
@property
def fileActivated(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.fileActivated`
This signal is emitted when a file is activated
:param file:
:type file: :py:class:`TTkFileTreeWidgetItem`
'''
return self._fileTreeWidget.fileActivated
@property
def folderActivated(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.folderActivated`
This signal is emitted when a fiilder is activated
:param folder:
:type folder: :py:class:`TTkFileTreeWidgetItem`
'''
return self._fileTreeWidget.folderActivated
def setHeaderLabels(self, labels:TTkString) -> None:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkFileTreeWidget.setHeaderLabels`

98
libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/filetreewidget.py

@ -77,52 +77,64 @@ class TTkFileTreeWidget(TTkTreeWidget):
root.mainloop()
'''
fileClicked:pyTTkSignal
'''
This signal is emitted when a file is clicked
@property
def fileClicked(self) -> pyTTkSignal:
'''
This signal is emitted when a file is clicked
:param file:
:type file: :py:class:`TTkFileTreeWidgetItem`
'''
folderClicked:pyTTkSignal
'''
This signal is emitted when a folder is clicked
:param file:
:type file: :py:class:`TTkFileTreeWidgetItem`
'''
return self._fileClicked
@property
def folderClicked(self) -> pyTTkSignal:
'''
This signal is emitted when a folder is clicked
:param folder:
:type folder: :py:class:`TTkFileTreeWidgetItem`
'''
fileDoubleClicked:pyTTkSignal
'''
This signal is emitted when a file is doubleclicked
:param folder:
:type folder: :py:class:`TTkFileTreeWidgetItem`
'''
return self._folderClicked
@property
def fileDoubleClicked(self) -> pyTTkSignal:
'''
This signal is emitted when a file is doubleclicked
:param file:
:type file: :py:class:`TTkFileTreeWidgetItem`
'''
folderDoubleClicked:pyTTkSignal
'''
This signal is emitted when a folder is doubleclicked
:param file:
:type file: :py:class:`TTkFileTreeWidgetItem`
'''
return self._fileDoubleClicked
@property
def folderDoubleClicked(self) -> pyTTkSignal:
'''
This signal is emitted when a folder is doubleclicked
:param folder:
:type folder: :py:class:`TTkFileTreeWidgetItem`
'''
fileActivated:pyTTkSignal
'''
This signal is emitted when a file is activated
:param folder:
:type folder: :py:class:`TTkFileTreeWidgetItem`
'''
return self._folderDoubleClicked
@property
def fileActivated(self) -> pyTTkSignal:
'''
This signal is emitted when a file is activated
:param file:
:type file: :py:class:`TTkFileTreeWidgetItem`
'''
folderActivated:pyTTkSignal
'''
This signal is emitted when a fiilder is activated
:param file:
:type file: :py:class:`TTkFileTreeWidgetItem`
'''
return self._fileActivated
@property
def folderActivated(self) -> pyTTkSignal:
'''
This signal is emitted when a fiilder is activated
:param folder:
:type folder: :py:class:`TTkFileTreeWidgetItem`
'''
:param folder:
:type folder: :py:class:`TTkFileTreeWidgetItem`
'''
return self._folderActivated
__slots__ = ('_path', '_filter',
# Signals
'fileClicked', 'folderClicked', 'fileDoubleClicked', 'folderDoubleClicked', 'fileActivated', 'folderActivated')
'_fileClicked', '_folderClicked', '_fileDoubleClicked', '_folderDoubleClicked', '_fileActivated', '_folderActivated')
def __init__(self,
path:str='.',
**kwargs) -> None:
@ -131,12 +143,12 @@ class TTkFileTreeWidget(TTkTreeWidget):
:type path: str, optional
'''
# Signals
self.fileClicked = pyTTkSignal(TTkFileTreeWidgetItem)
self.folderClicked = pyTTkSignal(TTkFileTreeWidgetItem)
self.fileDoubleClicked = pyTTkSignal(TTkFileTreeWidgetItem)
self.folderDoubleClicked = pyTTkSignal(TTkFileTreeWidgetItem)
self.fileActivated = pyTTkSignal(TTkFileTreeWidgetItem)
self.folderActivated = pyTTkSignal(TTkFileTreeWidgetItem)
self._fileClicked = pyTTkSignal(TTkFileTreeWidgetItem)
self._folderClicked = pyTTkSignal(TTkFileTreeWidgetItem)
self._fileDoubleClicked = pyTTkSignal(TTkFileTreeWidgetItem)
self._folderDoubleClicked = pyTTkSignal(TTkFileTreeWidgetItem)
self._fileActivated = pyTTkSignal(TTkFileTreeWidgetItem)
self._folderActivated = pyTTkSignal(TTkFileTreeWidgetItem)
self._path = path
self._filter = '*'
super().__init__(**kwargs)

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

@ -22,6 +22,8 @@
__all__ = ['TTkTable']
from typing import Optional
from TermTk.TTkCore.constant import TTkK
from TermTk.TTkCore.signal import pyTTkSignal, pyTTkSlot
from TermTk.TTkWidgets.TTkModelView.tablewidget import TTkTableWidget, TTkHeaderView
@ -60,11 +62,11 @@ class TTkTable(TTkAbstractScrollArea):
'setRowHeight', 'resizeRowToContents', 'resizeRowsToContents']
)
__slots__ = ('_tableView', *_ttk_forward.signals)
__slots__ = ('_tableView')
def __init__(self, *,
tableWidget:TTkTableWidget=None,
tableModel:TTkAbstractTableModel=None,
tableWidget:Optional[TTkTableWidget]=None,
tableModel:Optional[TTkAbstractTableModel]=None,
vSeparator:bool=True,
hSeparator:bool=True,
vHeader:bool=True,
@ -76,7 +78,6 @@ class TTkTable(TTkAbstractScrollArea):
:param tableWidget: a custom Table Widget to be used instead of the default one.
:type tableWidget: :py:class:`TTkTableWidget`, optional
'''
self._tableView = None
self._tableView:TTkTableWidget = tableWidget if tableWidget else TTkTableWidget(
tableModel=tableModel,
vSeparator=vSeparator,
@ -90,9 +91,6 @@ class TTkTable(TTkAbstractScrollArea):
self.setViewport(self._tableView)
# self.setFocusPolicy(TTkK.ClickFocus)
for _attr in self._ttk_forward.signals:
setattr(self,_attr,getattr(self._tableView,_attr))
def style(self):
if self._tableView:
return self._tableView.style()
@ -109,6 +107,80 @@ class TTkTable(TTkAbstractScrollArea):
return super().mergeStyle(style)
#--FORWARD-AUTOGEN-START--#
@property
def cellChanged(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.cellChanged`
This signal is emitted whenever the data of the item in the cell specified by row and column has changed.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
return self._tableView.cellChanged
@property
def cellClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.cellClicked`
This signal is emitted whenever a cell in the table is clicked.
The row and column specified is the cell that was clicked.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
return self._tableView.cellClicked
@property
def cellDoubleClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.cellDoubleClicked`
This signal is emitted whenever a cell in the table is double clicked.
The row and column specified is the cell that was double clicked.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
return self._tableView.cellDoubleClicked
@property
def cellEntered(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.cellEntered`
This signal is emitted when the mouse cursor enters a cell.
The cell is specified by row and column.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
return self._tableView.cellEntered
@property
def currentCellChanged(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTableWidget.currentCellChanged`
This signal is emitted whenever the current cell changes.
The cell specified by **prevRow** and **prevCol** is the cell that previously had the focus,
the cell specified by **currRow** and **currCol** is the new current cell.
:param currRow: the current row
:type currRow: int
:param currColumn: the current column
:type currColumn: int
:param prevRow: the previous row
:type prevRow: int
:param prevCol: the previous column
:type prevCol: int
'''
return self._tableView.currentCellChanged
@pyTTkSlot()
def undo(self) -> None:
'''

139
libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/tablewidget.py

@ -23,6 +23,7 @@
__all__ = ['TTkTableWidget','TTkHeaderView']
from typing import Optional
from dataclasses import dataclass
from TermTk.TTkCore.log import TTkLog
@ -154,61 +155,71 @@ class TTkTableWidget(TTkAbstractScrollView):
'''
cellChanged:pyTTkSignal
'''
This signal is emitted whenever the data of the item in the cell specified by row and column has changed.
@property
def cellChanged(self) -> pyTTkSignal:
'''
This signal is emitted whenever the data of the item in the cell specified by row and column has changed.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
cellClicked:pyTTkSignal
'''
This signal is emitted whenever a cell in the table is clicked.
The row and column specified is the cell that was clicked.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
return self._cellChanged
@property
def cellClicked(self) -> pyTTkSignal:
'''
This signal is emitted whenever a cell in the table is clicked.
The row and column specified is the cell that was clicked.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
cellDoubleClicked:pyTTkSignal
'''
This signal is emitted whenever a cell in the table is double clicked.
The row and column specified is the cell that was double clicked.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
return self._cellClicked
@property
def cellDoubleClicked(self) -> pyTTkSignal:
'''
This signal is emitted whenever a cell in the table is double clicked.
The row and column specified is the cell that was double clicked.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
cellEntered:pyTTkSignal
'''
This signal is emitted when the mouse cursor enters a cell.
The cell is specified by row and column.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
return self._cellDoubleClicked
@property
def cellEntered(self) -> pyTTkSignal:
'''
This signal is emitted when the mouse cursor enters a cell.
The cell is specified by row and column.
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
:param row: the row
:type row: int
:param col: the column
:type col: int
'''
return self._cellEntered
# self.cellPressed = pyTTkSignal(int,int)
currentCellChanged:pyTTkSignal
'''
This signal is emitted whenever the current cell changes.
The cell specified by **prevRow** and **prevCol** is the cell that previously had the focus,
the cell specified by **currRow** and **currCol** is the new current cell.
:param currRow: the current row
:type currRow: int
:param currColumn: the current column
:type currColumn: int
:param prevRow: the previous row
:type prevRow: int
:param prevCol: the previous column
:type prevCol: int
'''
@property
def currentCellChanged(self) -> pyTTkSignal:
'''
This signal is emitted whenever the current cell changes.
The cell specified by **prevRow** and **prevCol** is the cell that previously had the focus,
the cell specified by **currRow** and **currCol** is the new current cell.
:param currRow: the current row
:type currRow: int
:param currColumn: the current column
:type currColumn: int
:param prevRow: the previous row
:type prevRow: int
:param prevCol: the previous column
:type prevCol: int
'''
return self._currentCellChanged
classStyle = {
'default': {
@ -246,15 +257,15 @@ class TTkTableWidget(TTkAbstractScrollView):
'_fastCheck', '_guessDataEdit',
'_snapshot', '_snapshotId',
# Signals
# 'cellActivated',
'cellChanged',
'cellClicked', 'cellDoubleClicked',
'cellEntered', # 'cellPressed',
'currentCellChanged',
# '_cellActivated',
'_cellChanged',
'_cellClicked', '_cellDoubleClicked',
'_cellEntered', # '_cellPressed',
'_currentCellChanged',
)
def __init__(self, *,
tableModel:TTkAbstractTableModel=None,
tableModel:Optional[TTkAbstractTableModel]=None,
vSeparator:bool=True,
hSeparator:bool=True,
vHeader:bool=True,
@ -292,14 +303,14 @@ class TTkTableWidget(TTkAbstractScrollView):
# self.itemExpanded = pyTTkSignal(TTkTableWidgetItem)
# self.itemCollapsed = pyTTkSignal(TTkTableWidgetItem)
# self.cellActivated = pyTTkSignal(int,int)
self.cellChanged = pyTTkSignal(int,int)
self.cellClicked = pyTTkSignal(int,int)
self.cellDoubleClicked = pyTTkSignal(int,int)
self.cellEntered = pyTTkSignal(int,int)
# self.cellPressed = pyTTkSignal(int,int)
self.currentCellChanged = pyTTkSignal(int,int,int,int)
# self.currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous)
# self._cellActivated = pyTTkSignal(int,int)
self._cellChanged = pyTTkSignal(int,int)
self._cellClicked = pyTTkSignal(int,int)
self._cellDoubleClicked = pyTTkSignal(int,int)
self._cellEntered = pyTTkSignal(int,int)
# self._cellPressed = pyTTkSignal(int,int)
self._currentCellChanged = pyTTkSignal(int,int,int,int)
# self._currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous)
self._fastCheck = True
self._guessDataEdit = True

84
libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/tree.py

@ -49,7 +49,7 @@ class TTkTree(TTkAbstractScrollArea):
'addTopLevelItem', 'addTopLevelItems', 'takeTopLevelItem', 'topLevelItem', 'indexOfTopLevelItem', 'selectedItems', 'clear']
)
__slots__ = ('_treeView', *_ttk_forward.signals)
__slots__ = ('_treeView')
def __init__(self, *,
treeWidget:TTkTreeWidget=None,
@ -65,10 +65,86 @@ class TTkTree(TTkAbstractScrollArea):
self.setViewport(self._treeView)
self.setFocusPolicy(TTkK.ClickFocus)
for _attr in self._ttk_forward.signals:
setattr(self,_attr,getattr(self._treeView,_attr))
#--FORWARD-AUTOGEN-START--#
@property
def itemActivated(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTreeWidget.itemActivated`
This signal is emitted when the user activates an item by double-clicking
or pressing a special key (e.g., Enter).
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
return self._treeView.itemActivated
@property
def itemChanged(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTreeWidget.itemChanged`
This signal is emitted when the contents of the column in the specified item changes.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column
:type col: int
'''
return self._treeView.itemChanged
@property
def itemClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTreeWidget.itemClicked`
This signal is emitted when the user clicks inside the widget.
If no item was clicked, no signal will be emitted.
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
return self._treeView.itemClicked
@property
def itemExpanded(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTreeWidget.itemExpanded`
This signal is emitted when the specified item is expanded so that all of its children are displayed.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
'''
return self._treeView.itemExpanded
@property
def itemCollapsed(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTreeWidget.itemCollapsed`
This signal is emitted when the specified item is collapsed so that none of its children are displayed.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
'''
return self._treeView.itemCollapsed
@property
def itemDoubleClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTreeWidget.itemDoubleClicked`
This signal is emitted when the user double clicks inside the widget.
If no item was double clicked, no signal will be emitted.
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
return self._treeView.itemDoubleClicked
def setHeaderLabels(self, labels:TTkString) -> None:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTreeWidget.setHeaderLabels`

120
libs/pyTermTk/TermTk/TTkWidgets/TTkModelView/treewidget.py

@ -81,61 +81,73 @@ class TTkTreeWidget(TTkAbstractScrollView):
The isSortingEnabled() function indicates whether sorting is enabled.
'''
itemActivated:pyTTkSignal
'''
This signal is emitted when the user activates an item by double-clicking
or pressing a special key (e.g., Enter).
@property
def itemActivated(self) -> pyTTkSignal:
'''
This signal is emitted when the user activates an item by double-clicking
or pressing a special key (e.g., Enter).
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
itemChanged:pyTTkSignal
'''
This signal is emitted when the contents of the column in the specified item changes.
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
return self._itemActivated
@property
def itemChanged(self) -> pyTTkSignal:
'''
This signal is emitted when the contents of the column in the specified item changes.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column
:type col: int
'''
itemClicked:pyTTkSignal
'''
This signal is emitted when the user clicks inside the widget.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column
:type col: int
'''
return self._itemChanged
@property
def itemClicked(self) -> pyTTkSignal:
'''
This signal is emitted when the user clicks inside the widget.
If no item was clicked, no signal will be emitted.
If no item was clicked, no signal will be emitted.
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
itemDoubleClicked:pyTTkSignal
'''
This signal is emitted when the user double clicks inside the widget.
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
return self._itemClicked
@property
def itemDoubleClicked(self) -> pyTTkSignal:
'''
This signal is emitted when the user double clicks inside the widget.
If no item was double clicked, no signal will be emitted.
If no item was double clicked, no signal will be emitted.
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
itemExpanded:pyTTkSignal
'''
This signal is emitted when the specified item is expanded so that all of its children are displayed.
:param item: the item that was clicked.
:type item: :py:class:`TTkTreeWidgetItem`
:param col: the item's column that was clicked.
:type col: int
'''
return self._itemDoubleClicked
@property
def itemExpanded(self) -> pyTTkSignal:
'''
This signal is emitted when the specified item is expanded so that all of its children are displayed.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
'''
itemCollapsed:pyTTkSignal
'''
This signal is emitted when the specified item is collapsed so that none of its children are displayed.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
'''
return self._itemExpanded
@property
def itemCollapsed(self) -> pyTTkSignal:
'''
This signal is emitted when the specified item is collapsed so that none of its children are displayed.
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
'''
:param item: the item reported by this signal
:type item: :py:class:`TTkTreeWidgetItem`
'''
return self._itemCollapsed
classStyle = {
'default': {
@ -158,7 +170,7 @@ class TTkTreeWidget(TTkAbstractScrollView):
'_sortColumn', '_sortOrder', '_sortingEnabled',
'_dndMode',
# Signals
'itemChanged', 'itemClicked', 'itemDoubleClicked', 'itemExpanded', 'itemCollapsed', 'itemActivated'
'_itemChanged', '_itemClicked', '_itemDoubleClicked', '_itemExpanded', '_itemCollapsed', '_itemActivated'
)
@dataclass(frozen=True)
class _Cache:
@ -187,12 +199,12 @@ class TTkTreeWidget(TTkAbstractScrollView):
:type dragDropMode: :py:class:`TTkK.DragDropMode`, optional
'''
# Signals
self.itemActivated = pyTTkSignal(TTkTreeWidgetItem, int)
self.itemChanged = pyTTkSignal(TTkTreeWidgetItem, int)
self.itemClicked = pyTTkSignal(TTkTreeWidgetItem, int)
self.itemDoubleClicked = pyTTkSignal(TTkTreeWidgetItem, int)
self.itemExpanded = pyTTkSignal(TTkTreeWidgetItem)
self.itemCollapsed = pyTTkSignal(TTkTreeWidgetItem)
self._itemActivated = pyTTkSignal(TTkTreeWidgetItem, int)
self._itemChanged = pyTTkSignal(TTkTreeWidgetItem, int)
self._itemClicked = pyTTkSignal(TTkTreeWidgetItem, int)
self._itemDoubleClicked = pyTTkSignal(TTkTreeWidgetItem, int)
self._itemExpanded = pyTTkSignal(TTkTreeWidgetItem)
self._itemCollapsed = pyTTkSignal(TTkTreeWidgetItem)
self._dndMode = dragDropMode
self._selected = None

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

@ -43,7 +43,7 @@ class TTkTerminal(TTkAbstractScrollArea):
'termWrite', 'termSize']
)
__slots__ = ('_terminalView', *_ttk_forward.signals)
__slots__ = ('_terminalView')
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
@ -53,9 +53,6 @@ class TTkTerminal(TTkAbstractScrollArea):
self.setFocusPolicy(TTkK.ClickFocus)
self.setViewport(self._terminalView)
for _attr in self._ttk_forward.signals:
setattr(self,_attr,getattr(self._terminalView,_attr))
self.terminalClosed = pyTTkSignal(TTkTerminal)
self._terminalView.terminalClosed.connect(lambda : self.terminalClosed.emit(self))
@ -64,6 +61,73 @@ class TTkTerminal(TTkAbstractScrollArea):
return super().close()
#--FORWARD-AUTOGEN-START--#
@property
def bell(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.bell`
This signal is emitted when the `bell <https://en.wikipedia.org/wiki/Bell_character>`__ is received.
'''
return self._terminalView.bell
@property
def titleChanged(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.titleChanged`
This signal is emitted when the terminal title change through OSC "ESC ]0;"
:param title: the new title
:type title: str
'''
return self._terminalView.titleChanged
@property
def terminalClosed(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.terminalClosed`
This signal is emitted when the terminal is closed.
'''
return self._terminalView.terminalClosed
@property
def textSelected(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.textSelected`
This signal is emitted when a text is selected.
:param text: the selected text
:type text: :py:class:`ttkString`
'''
return self._terminalView.textSelected
@property
def termData(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.termData`
This signal is emitted when data event fires.
This happens for example when the user types or pastes into the terminal.
The event value is whatever 'str' results, in a typical setup,
this should be passed on to the backing pty.
This signal is used in :py:class:`TTkTerminalHelper` through :py:meth:`TTkTerminalHelper.attachTTkTerminal`
to frward all the terminal events to the pty interface.
:param data: the event data
:type data: str
'''
return self._terminalView.termData
@property
def termResized(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.termResized`
This signal is emitted when the terminal is resized.
:param size: the new size [width, height] of the terminal
:type size: (int,int)
'''
return self._terminalView.termResized
def termWrite(self, data:str) -> None:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTerminalView.termWrite`

104
libs/pyTermTk/TermTk/TTkWidgets/TTkTerminal/terminalview.py

@ -139,54 +139,66 @@ class TTkTerminalView(TTkAbstractScrollView, _TTkTerminal_CSI_DEC):
reportMove: bool = False
sgrMode: bool = False
bell:pyTTkSignal
'''
This signal is emitted when the `bell <https://en.wikipedia.org/wiki/Bell_character>`__ is received.
'''
@property
def bell(self) -> pyTTkSignal:
'''
This signal is emitted when the `bell <https://en.wikipedia.org/wiki/Bell_character>`__ is received.
'''
return self._bell
terminalClosed:pyTTkSignal
'''
This signal is emitted when the terminal is closed.
'''
@property
def terminalClosed(self) -> pyTTkSignal:
'''
This signal is emitted when the terminal is closed.
'''
return self._terminalClosed
titleChanged:pyTTkSignal
'''
This signal is emitted when the terminal title change through OSC "ESC ]0;"
@property
def titleChanged(self) -> pyTTkSignal:
'''
This signal is emitted when the terminal title change through OSC "ESC ]0;"
:param title: the new title
:type title: str
'''
:param title: the new title
:type title: str
'''
return self._titleChanged
textSelected:pyTTkSignal
'''
This signal is emitted when a text is selected.
@property
def textSelected(self) -> pyTTkSignal:
'''
This signal is emitted when a text is selected.
:param text: the selected text
:type text: :py:class:`ttkString`
'''
:param text: the selected text
:type text: :py:class:`ttkString`
'''
return self._textSelected
termData:pyTTkSignal
'''
This signal is emitted when data event fires.
@property
def termData(self) -> pyTTkSignal:
'''
This signal is emitted when data event fires.
This happens for example when the user types or pastes into the terminal.
The event value is whatever 'str' results, in a typical setup,
this should be passed on to the backing pty.
This happens for example when the user types or pastes into the terminal.
The event value is whatever 'str' results, in a typical setup,
this should be passed on to the backing pty.
This signal is used in :py:class:`TTkTerminalHelper` through :py:meth:`TTkTerminalHelper.attachTTkTerminal`
to frward all the terminal events to the pty interface.
This signal is used in :py:class:`TTkTerminalHelper` through :py:meth:`TTkTerminalHelper.attachTTkTerminal`
to frward all the terminal events to the pty interface.
:param data: the event data
:type data: str
'''
:param data: the event data
:type data: str
'''
return self._termData
termResized:pyTTkSignal
'''
This signal is emitted when the terminal is resized.
@property
def termResized(self) -> pyTTkSignal:
'''
This signal is emitted when the terminal is resized.
:param size: the new size [width, height] of the terminal
:type size: (int,int)
'''
:param size: the new size [width, height] of the terminal
:type size: (int,int)
'''
return self._termResized
__slots__ = (
'_termLoop', '_newSize',
@ -195,17 +207,17 @@ class TTkTerminalView(TTkAbstractScrollView, _TTkTerminal_CSI_DEC):
'_keyboard', '_mouse', '_terminal',
'_screen_current', '_screen_normal', '_screen_alt',
# Signals
'bell',
'titleChanged', 'terminalClosed', 'textSelected',
'termData','termResized')
'_bell',
'_titleChanged', '_terminalClosed', '_textSelected',
'_termData','_termResized')
def __init__(self, **kwargs) -> None:
#Signals
self.bell = pyTTkSignal()
self.terminalClosed = pyTTkSignal()
self.titleChanged = pyTTkSignal(str)
self.textSelected = pyTTkSignal(TTkString)
self.termData = pyTTkSignal(str)
self.termResized = pyTTkSignal(int,int)
self._bell = pyTTkSignal()
self._terminalClosed = pyTTkSignal()
self._titleChanged = pyTTkSignal(str)
self._textSelected = pyTTkSignal(TTkString)
self._termData = pyTTkSignal(str)
self._termResized = pyTTkSignal(int,int)
self._newSize = None
self._terminal = TTkTerminalView._Terminal()

39
libs/pyTermTk/TermTk/TTkWidgets/list_.py

@ -22,6 +22,7 @@
__all__ = ['TTkList']
from TermTk.TTkCore.signal import pyTTkSignal, pyTTkSlot
from TermTk.TTkCore.constant import TTkK
from TermTk.TTkWidgets.listwidget import TTkListWidget, TTkAbstractListItem
from TermTk.TTkAbstract.abstractscrollarea import TTkAbstractScrollArea, _ForwardData
@ -49,7 +50,7 @@ class TTkList(TTkAbstractScrollArea):
]
)
__slots__ = ('_listView', *_ttk_forward.signals)
__slots__ = ('_listView')
def __init__(self, *,
listWidget:TTkListWidget=None,
@ -69,10 +70,40 @@ class TTkList(TTkAbstractScrollArea):
super().__init__(**kwargs)
self.setViewport(self._listView)
for _attr in self._ttk_forward.signals:
setattr(self,_attr,getattr(self._listView,_attr))
#--FORWARD-AUTOGEN-START--#
@property
def itemClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkListWidget.itemClicked`
This signal is emitted whenever an item is clicked.
:param item: the item selected
:type item: :py:class:`TTkAbstractListItem`
'''
return self._listView.itemClicked
@property
def textClicked(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkListWidget.textClicked`
This signal is emitted whenever an item is clicked.
:param text: the text of the item selected
:type text: str
'''
return self._listView.textClicked
@property
def searchModified(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkListWidget.searchModified`
This signal is emitted whenever the search text is modified.
:param text: the search text
:type text: str
'''
return self._listView.searchModified
def items(self) -> list[TTkAbstractListItem]:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkListWidget.items`

52
libs/pyTermTk/TermTk/TTkWidgets/listwidget.py

@ -155,27 +155,35 @@ class TTkListWidget(TTkAbstractScrollView):
'''
itemClicked:pyTTkSignal
'''
This signal is emitted whenever an item is clicked.
@property
def itemClicked(self) -> pyTTkSignal:
'''
This signal is emitted whenever an item is clicked.
:param item: the item selected
:type item: :py:class:`TTkAbstractListItem`
'''
textClicked:pyTTkSignal
'''
This signal is emitted whenever an item is clicked.
:param item: the item selected
:type item: :py:class:`TTkAbstractListItem`
'''
return self._itemClicked
:param text: the text of the item selected
:type text: str
'''
searchModified:pyTTkSignal
'''
This signal is emitted whenever the search text is modified.
@property
def textClicked(self) -> pyTTkSignal:
'''
This signal is emitted whenever an item is clicked.
:param text: the search text
:type text: str
'''
:param text: the text of the item selected
:type text: str
'''
return self._textClicked
@property
def searchModified(self) -> pyTTkSignal:
'''
This signal is emitted whenever the search text is modified.
:param text: the search text
:type text: str
'''
return self._searchModified
classStyle = {
'default':{'searchColor': TTkColor.fg("#FFFF00") + TTkColor.UNDERLINE}}
@ -190,7 +198,7 @@ class TTkListWidget(TTkAbstractScrollView):
'_dragPos', '_dndMode',
'_searchText', '_showSearch',
# Signals
'itemClicked', 'textClicked', 'searchModified')
'_itemClicked', '_textClicked', '_searchModified')
def __init__(self, *,
items:list[str]=[],
selectionMode:int=TTkK.SelectionMode.SingleSelection,
@ -208,9 +216,9 @@ class TTkListWidget(TTkAbstractScrollView):
:type showSearch: bool, optional
'''
# Signals
self.itemClicked = pyTTkSignal(TTkAbstractListItem)
self.textClicked = pyTTkSignal(str)
self.searchModified = pyTTkSignal(str)
self._itemClicked = pyTTkSignal(TTkAbstractListItem)
self._textClicked = pyTTkSignal(str)
self._searchModified = pyTTkSignal(str)
# Default Class Specific Values
self._selectionMode = selectionMode

156
libs/pyTermTk/TermTk/TTkWidgets/texedit.py

@ -279,46 +279,56 @@ class TTkTextEditView(TTkAbstractScrollView):
'''
self._cursor = cursor
currentColorChanged:pyTTkSignal
'''
This signal is emitted if the current character color has changed,
for example caused by a change of the cursor position.
@property
def currentColorChanged(self) -> pyTTkSignal:
'''
This signal is emitted if the current character color has changed,
for example caused by a change of the cursor position.
:param color: the new color
:type color: :py:class:`TTkColor`
'''
:param color: the new color
:type color: :py:class:`TTkColor`
'''
return self._currentColorChanged
cursorPositionChanged:pyTTkSignal
'''
This signal is emitted whenever the position of the cursor changed.
@property
def cursorPositionChanged(self) -> pyTTkSignal:
'''
This signal is emitted whenever the position of the cursor changed.
:param cursor: the cursor changed.
:type cursor: :py:class:`TTkTextCursor`
'''
:param cursor: the cursor changed.
:type cursor: :py:class:`TTkTextCursor`
'''
return self._cursorPositionChanged_sig
undoAvailable:pyTTkSignal
'''
This signal is emitted whenever undo operations become available (available is true)
or unavailable (available is false).
@property
def undoAvailable(self) -> pyTTkSignal:
'''
This signal is emitted whenever undo operations become available (available is true)
or unavailable (available is false).
:param available: the availability of undo
:type available: bool
'''
:param available: the availability of undo
:type available: bool
'''
return self._undoAvailable_sig
redoAvailable:pyTTkSignal
'''
This signal is emitted whenever redo operations become available (available is true)
or unavailable (available is false).
@property
def redoAvailable(self) -> pyTTkSignal:
'''
This signal is emitted whenever redo operations become available (available is true)
or unavailable (available is false).
:param available: the availability of redo
:type available: bool
'''
:param available: the availability of redo
:type available: bool
'''
return self._redoAvailable_sig
textChanged:pyTTkSignal
'''
This signal is emitted whenever the document's content changes;
for example, when text is inserted or deleted, or when formatting is applied.
'''
@property
def textChanged(self) -> pyTTkSignal:
'''
This signal is emitted whenever the document's content changes;
for example, when text is inserted or deleted, or when formatting is applied.
'''
return self._textChanged
classStyle = {
'default': {'color': TTkColor.fg("#dddddd")+TTkColor.bg("#222222"),
@ -346,9 +356,9 @@ class TTkTextEditView(TTkAbstractScrollView):
# 'wrapWidth', 'setWrapWidth',
# 'wordWrapMode', 'setWordWrapMode',
# Signals
'currentColorChanged', 'cursorPositionChanged',
'undoAvailable', 'redoAvailable',
'textChanged'
'_currentColorChanged', '_cursorPositionChanged_sig',
'_undoAvailable_sig', '_redoAvailable_sig',
'_textChanged'
)
# in order to support the line wrap, I need to divide the full data text in;
@ -377,11 +387,11 @@ class TTkTextEditView(TTkAbstractScrollView):
:type document: :py:class:`TTkTextDocument`, optional
'''
self.currentColorChanged = pyTTkSignal(TTkColor)
self.cursorPositionChanged = pyTTkSignal(TTkTextCursor)
self.undoAvailable = pyTTkSignal(bool)
self.redoAvailable = pyTTkSignal(bool)
self.textChanged = pyTTkSignal()
self._currentColorChanged = pyTTkSignal(TTkColor)
self._cursorPositionChanged_sig = pyTTkSignal(TTkTextCursor)
self._undoAvailable_sig = pyTTkSignal(bool)
self._redoAvailable_sig = pyTTkSignal(bool)
self._textChanged = pyTTkSignal()
self._readOnly:bool = readOnly
self._multiLine:bool = multiLine
@ -931,7 +941,7 @@ class TTkTextEdit(TTkAbstractScrollArea):
forwardClass=TTkTextEditView ,
instance="self._textEditView",
signals=[ # Forwarded Signals From TTkTexteditView
'focusChanged', 'currentColorChanged', 'cursorPositionChanged',
'currentColorChanged', 'cursorPositionChanged',
'undoAvailable', 'redoAvailable',
'textChanged'],
methods=[
@ -953,9 +963,7 @@ class TTkTextEdit(TTkAbstractScrollArea):
__slots__ = (
'_textEditView',
'_lineNumberView', '_lineNumber',
*_ttk_forward.signals
)
'_lineNumberView', '_lineNumber')
def __init__(self, *,
# TTkWidget init
@ -992,9 +1000,7 @@ class TTkTextEdit(TTkAbstractScrollArea):
self._lineNumberView.setTextWrap(self._textEditView._textWrap)
textEditLayout.addWidget(self._lineNumberView,0,0)
self.setViewport(textEditLayout)
for _attr in self._ttk_forward.signals:
setattr(self,_attr,getattr(self._textEditView,_attr))
self.focusChanged = self._textEditView.focusChanged
def ruler(self) -> TTkTextEditRuler:
'''ruler'''
@ -1029,6 +1035,62 @@ class TTkTextEdit(TTkAbstractScrollArea):
self._lineNumberView.setTextWrap(self._textEditView._textWrap)
#--FORWARD-AUTOGEN-START--#
@property
def currentColorChanged(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTextEditView.currentColorChanged`
This signal is emitted if the current character color has changed,
for example caused by a change of the cursor position.
:param color: the new color
:type color: :py:class:`TTkColor`
'''
return self._textEditView.currentColorChanged
@property
def cursorPositionChanged(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTextEditView.cursorPositionChanged`
This signal is emitted whenever the position of the cursor changed.
:param cursor: the cursor changed.
:type cursor: :py:class:`TTkTextCursor`
'''
return self._textEditView.cursorPositionChanged
@property
def undoAvailable(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTextEditView.undoAvailable`
This signal is emitted whenever undo operations become available (available is true)
or unavailable (available is false).
:param available: the availability of undo
:type available: bool
'''
return self._textEditView.undoAvailable
@property
def redoAvailable(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTextEditView.redoAvailable`
This signal is emitted whenever redo operations become available (available is true)
or unavailable (available is false).
:param available: the availability of redo
:type available: bool
'''
return self._textEditView.redoAvailable
@property
def textChanged(self) -> pyTTkSignal:
'''
.. seealso:: this method is forwarded to :py:meth:`TTkTextEditView.textChanged`
This signal is emitted whenever the document's content changes;
for example, when text is inserted or deleted, or when formatting is applied.
'''
return self._textEditView.textChanged
@pyTTkSlot()
def clear(self) -> None:
'''

57
tools/autogenForwarded.py

@ -132,6 +132,60 @@ def autogen_methods(data: _ForwardData) -> List[str]:
return signatures
def autogen_signals(data: _ForwardData) -> List[str]:
"""
Generates a list of signals signatures and return types for a given class.
Args:
data (Dict[str, Any]): A dictionary containing the class name and a list of methods.
Example: {'class': 'TTkTexteditView', 'methods': ['clear', 'setText', ...]}
Returns:
List[str]: A list of strings, where each string is a signal signature and return type.
"""
import TermTk as ttk
class_name = data.forwardClass.__name__
signatures: List[str] = []
for signal_name in data.signals:
try:
# Get the method from the class
signal = getattr(data.forwardClass, signal_name)
# sig = inspect.signature(signal)
doc = inspect.getdoc(signal)
# return_type = sig.return_annotation
# params = ', '.join([f"{_p}={_p}" for _p in sig.parameters.keys() if _p != 'self'])
# source = inspect.getsource(signal)
# Extract the first line, which should be the method definition
# lines = source.splitlines()
# index_func = _index_of(' def ',lines)
# lines = lines[:index_func+1]
doc_lines:List[str] = []
doc_indent = " "
doc_lines.extend([
doc_indent + f"'''",
doc_indent + f".. seealso:: this method is forwarded to :py:meth:`{class_name}.{signal_name}`\n",
])
if doc:
doc_lines.extend([doc_indent + _l for _l in doc.split('\n')])
doc_lines.append(doc_indent + "'''")
# Format the signature string
signatures.extend([
" @property\n",
f" def {signal_name}(self) -> pyTTkSignal:\n",
*[f"{_l}\n" for _l in doc_lines],
f" return {data.instance}.{signal_name}\n"
])
except AttributeError:
print(f"Error: Method '{signal_name}' not found in class '{class_name}'.")
except Exception as e:
print(f"Error: An error occurred while processing method '{signal_name}': {e}")
return signatures
def get_classes_with_source_from_module(module) -> List[Dict[str, Any]]:
classes_with_source: List[Dict[str, Any]] = []
@ -172,7 +226,8 @@ if __name__ == "__main__":
print(f" Module: {class_data['module']}")
print(f" Filename: {class_data['filename']}")
# print(f" Source:\n{class_data['source']}")
autogenenerated = autogen_methods(class_data['forward'])
autogenenerated = autogen_signals(class_data['forward'])
autogenenerated += autogen_methods(class_data['forward'])
if args.apply:
lines = read_file_to_lines(class_data['filename'])
index_start = _index_of(marker_start,lines)

Loading…
Cancel
Save