https://github.com/ousttrue/gi_tool
pygobject utility
https://github.com/ousttrue/gi_tool
Last synced: over 1 year ago
JSON representation
pygobject utility
- Host: GitHub
- URL: https://github.com/ousttrue/gi_tool
- Owner: ousttrue
- Created: 2022-11-13T18:13:04.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-17T13:38:53.000Z (over 3 years ago)
- Last Synced: 2025-01-21T00:20:01.048Z (over 1 year ago)
- Language: Python
- Size: 37.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gi_tool
## gi_tool.girstub
Python stub generator for pygobject from `gir` file.
A [pygobject-stubs](https://github.com/pygobject/pygobject-stubs/tree/master/tools) alternative.
```py
def insert_column(self, column: TreeViewColumn, position: int) -> int: ...
```
👇
More rich annotation.
```py
def insert_column(self, column: 'TreeViewColumn', position: int) -> int:
"""This inserts the @column into the @tree_view at @position. If @position is
-1, then the column is inserted at the end. If @tree_view has
“fixed_height” mode enabled, then @column must have its “sizing” property
set to be GTK_TREE_VIEW_COLUMN_FIXED."""
...
```
## usage
Generate a stub from a gir, Send to standard output.
```
# usage: girstub gen gir_dir module version
> python gi_tool/girstub.py gen C:/gnome/share/gir-1.0 Gtk 4.0 > C:\Python311\Lib\site-packages\gi-stubs\repository\Gtk.pyi
```
Convert the gifs in folder and write each result to the output folder.
```
# usage: girstub all gir_dir site_packages
> python gi_tool/girstub.py all C:/gnome/share/gir-1.0 C:\Python311\Lib\site-packages
```