@scrypted/server 0.0.139 → 0.0.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @scrypted/server might be problematic. Click here for more details.
- package/dist/plugin/media.js +20 -15
- package/dist/plugin/media.js.map +1 -1
- package/dist/rpc.js +9 -5
- package/dist/rpc.js.map +1 -1
- package/dist/runtime.js +6 -0
- package/dist/runtime.js.map +1 -1
- package/package.json +2 -2
- package/src/plugin/media.ts +20 -16
- package/src/rpc.ts +11 -3
- package/src/runtime.ts +7 -0
- package/.venv/bin/Activate.ps1 +0 -241
- package/.venv/bin/activate +0 -66
- package/.venv/bin/activate.csh +0 -25
- package/.venv/bin/activate.fish +0 -64
- package/.venv/bin/pip +0 -8
- package/.venv/bin/pip3 +0 -8
- package/.venv/bin/pip3.9 +0 -8
- package/.venv/lib/python3.9/site-packages/_distutils_hack/__init__.py +0 -198
- package/.venv/lib/python3.9/site-packages/_distutils_hack/override.py +0 -1
- package/.venv/lib/python3.9/site-packages/distutils-precedence.pth +0 -1
- package/.venv/lib/python3.9/site-packages/pgi/__init__.py +0 -62
- package/.venv/lib/python3.9/site-packages/pgi/_compat.py +0 -74
- package/.venv/lib/python3.9/site-packages/pgi/callback.py +0 -15
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/__init__.py +0 -12
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/_compat.py +0 -25
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/_utils.py +0 -119
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/__init__.py +0 -60
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/_cdef.py +0 -574
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/_ffi.py +0 -25
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/error.py +0 -13
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/giarginfo.py +0 -73
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/giargument.py +0 -36
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/gibaseinfo.py +0 -113
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/gicallableinfo.py +0 -75
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/giconstantinfo.py +0 -22
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/gienuminfo.py +0 -59
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/gifieldinfo.py +0 -40
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/gifunctioninfo.py +0 -64
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/giinterfaceinfo.py +0 -93
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/giobjectinfo.py +0 -143
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/gipropertyinfo.py +0 -28
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/giregisteredtypeinfo.py +0 -27
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/girepository.py +0 -143
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/gisignalinfo.py +0 -55
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/gistructinfo.py +0 -55
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/gitypeinfo.py +0 -66
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/gitypelib.py +0 -40
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gir/giunioninfo.py +0 -66
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/glib/__init__.py +0 -8
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/glib/_cdef.py +0 -101
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/glib/glib.py +0 -260
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gobject/__init__.py +0 -15
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gobject/_cdef.py +0 -45
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gobject/_ffi.py +0 -26
- package/.venv/lib/python3.9/site-packages/pgi/cffilib/gobject/gobject.py +0 -27
- package/.venv/lib/python3.9/site-packages/pgi/clib/__init__.py +0 -11
- package/.venv/lib/python3.9/site-packages/pgi/clib/_compat.py +0 -20
- package/.venv/lib/python3.9/site-packages/pgi/clib/_utils.py +0 -213
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/__init__.py +0 -71
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/error.py +0 -13
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/giarginfo.py +0 -65
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/giargument.py +0 -58
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/gibaseinfo.py +0 -152
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/gicallableinfo.py +0 -203
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/giconstantinfo.py +0 -35
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/gienuminfo.py +0 -64
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/gifieldinfo.py +0 -46
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/giinterfaceinfo.py +0 -83
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/giobjectinfo.py +0 -134
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/gipropertyinfo.py +0 -36
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/giregisteredtypeinfo.py +0 -34
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/girepository.py +0 -200
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/gistructinfo.py +0 -55
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/gitypeinfo.py +0 -97
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/gitypelib.py +0 -56
- package/.venv/lib/python3.9/site-packages/pgi/clib/gir/giunioninfo.py +0 -60
- package/.venv/lib/python3.9/site-packages/pgi/clib/glib.py +0 -336
- package/.venv/lib/python3.9/site-packages/pgi/clib/gobject.py +0 -405
- package/.venv/lib/python3.9/site-packages/pgi/codegen/__init__.py +0 -28
- package/.venv/lib/python3.9/site-packages/pgi/codegen/arguments.py +0 -640
- package/.venv/lib/python3.9/site-packages/pgi/codegen/backend.py +0 -95
- package/.venv/lib/python3.9/site-packages/pgi/codegen/cbargs.py +0 -152
- package/.venv/lib/python3.9/site-packages/pgi/codegen/cbreturn.py +0 -77
- package/.venv/lib/python3.9/site-packages/pgi/codegen/cffi_backend.py +0 -424
- package/.venv/lib/python3.9/site-packages/pgi/codegen/construct.py +0 -222
- package/.venv/lib/python3.9/site-packages/pgi/codegen/ctypes_backend/__init__.py +0 -11
- package/.venv/lib/python3.9/site-packages/pgi/codegen/ctypes_backend/main.py +0 -184
- package/.venv/lib/python3.9/site-packages/pgi/codegen/ctypes_backend/types_basic.py +0 -705
- package/.venv/lib/python3.9/site-packages/pgi/codegen/ctypes_backend/types_container.py +0 -236
- package/.venv/lib/python3.9/site-packages/pgi/codegen/ctypes_backend/types_interface.py +0 -402
- package/.venv/lib/python3.9/site-packages/pgi/codegen/ctypes_backend/types_other.py +0 -93
- package/.venv/lib/python3.9/site-packages/pgi/codegen/ctypes_backend/utils.py +0 -168
- package/.venv/lib/python3.9/site-packages/pgi/codegen/fieldgen.py +0 -114
- package/.venv/lib/python3.9/site-packages/pgi/codegen/fields.py +0 -244
- package/.venv/lib/python3.9/site-packages/pgi/codegen/funcgen.py +0 -376
- package/.venv/lib/python3.9/site-packages/pgi/codegen/null_backend.py +0 -110
- package/.venv/lib/python3.9/site-packages/pgi/codegen/returnvalues.py +0 -443
- package/.venv/lib/python3.9/site-packages/pgi/codegen/siggen.py +0 -157
- package/.venv/lib/python3.9/site-packages/pgi/codegen/utils.py +0 -248
- package/.venv/lib/python3.9/site-packages/pgi/const.py +0 -9
- package/.venv/lib/python3.9/site-packages/pgi/constant.py +0 -32
- package/.venv/lib/python3.9/site-packages/pgi/debug.py +0 -31
- package/.venv/lib/python3.9/site-packages/pgi/enum.py +0 -244
- package/.venv/lib/python3.9/site-packages/pgi/field.py +0 -58
- package/.venv/lib/python3.9/site-packages/pgi/finalizer.py +0 -3
- package/.venv/lib/python3.9/site-packages/pgi/foreign/__init__.py +0 -71
- package/.venv/lib/python3.9/site-packages/pgi/foreign/_base.py +0 -43
- package/.venv/lib/python3.9/site-packages/pgi/foreign/cairo.py +0 -41
- package/.venv/lib/python3.9/site-packages/pgi/function.py +0 -12
- package/.venv/lib/python3.9/site-packages/pgi/gerror.py +0 -58
- package/.venv/lib/python3.9/site-packages/pgi/gtype.py +0 -168
- package/.venv/lib/python3.9/site-packages/pgi/importer.py +0 -189
- package/.venv/lib/python3.9/site-packages/pgi/module.py +0 -141
- package/.venv/lib/python3.9/site-packages/pgi/obj.py +0 -519
- package/.venv/lib/python3.9/site-packages/pgi/overrides/GLib.py +0 -1013
- package/.venv/lib/python3.9/site-packages/pgi/overrides/GObject.py +0 -583
- package/.venv/lib/python3.9/site-packages/pgi/overrides/Gdk.py +0 -454
- package/.venv/lib/python3.9/site-packages/pgi/overrides/Gio.py +0 -237
- package/.venv/lib/python3.9/site-packages/pgi/overrides/Gtk.py +0 -2412
- package/.venv/lib/python3.9/site-packages/pgi/overrides/Pango.py +0 -53
- package/.venv/lib/python3.9/site-packages/pgi/overrides/Poppler.py +0 -61
- package/.venv/lib/python3.9/site-packages/pgi/overrides/__init__.py +0 -327
- package/.venv/lib/python3.9/site-packages/pgi/overrides/keysyms.py +0 -54
- package/.venv/lib/python3.9/site-packages/pgi/properties.py +0 -313
- package/.venv/lib/python3.9/site-packages/pgi/propertyhelper.py +0 -12
- package/.venv/lib/python3.9/site-packages/pgi/repository/__init__.py +0 -10
- package/.venv/lib/python3.9/site-packages/pgi/signalhelper.py +0 -18
- package/.venv/lib/python3.9/site-packages/pgi/signals.py +0 -122
- package/.venv/lib/python3.9/site-packages/pgi/static.py +0 -189
- package/.venv/lib/python3.9/site-packages/pgi/structure.py +0 -131
- package/.venv/lib/python3.9/site-packages/pgi/util.py +0 -342
- package/.venv/lib/python3.9/site-packages/pgi-0.0.11.2.dist-info/COPYING +0 -502
- package/.venv/lib/python3.9/site-packages/pgi-0.0.11.2.dist-info/INSTALLER +0 -1
- package/.venv/lib/python3.9/site-packages/pgi-0.0.11.2.dist-info/METADATA +0 -22
- package/.venv/lib/python3.9/site-packages/pgi-0.0.11.2.dist-info/RECORD +0 -229
- package/.venv/lib/python3.9/site-packages/pgi-0.0.11.2.dist-info/REQUESTED +0 -0
- package/.venv/lib/python3.9/site-packages/pgi-0.0.11.2.dist-info/WHEEL +0 -5
- package/.venv/lib/python3.9/site-packages/pgi-0.0.11.2.dist-info/top_level.txt +0 -1
- package/.venv/lib/python3.9/site-packages/pip/__init__.py +0 -13
- package/.venv/lib/python3.9/site-packages/pip/__main__.py +0 -31
- package/.venv/lib/python3.9/site-packages/pip/_internal/__init__.py +0 -19
- package/.venv/lib/python3.9/site-packages/pip/_internal/build_env.py +0 -293
- package/.venv/lib/python3.9/site-packages/pip/_internal/cache.py +0 -264
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/__init__.py +0 -4
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py +0 -163
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/base_command.py +0 -214
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/cmdoptions.py +0 -1010
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/command_context.py +0 -27
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/main.py +0 -70
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py +0 -87
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/parser.py +0 -292
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/progress_bars.py +0 -250
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/req_command.py +0 -469
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/spinners.py +0 -157
- package/.venv/lib/python3.9/site-packages/pip/_internal/cli/status_codes.py +0 -6
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/__init__.py +0 -127
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/cache.py +0 -223
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/check.py +0 -53
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/completion.py +0 -96
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/configuration.py +0 -266
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/debug.py +0 -202
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/download.py +0 -139
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/freeze.py +0 -97
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/hash.py +0 -59
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/help.py +0 -41
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/index.py +0 -138
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/install.py +0 -770
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/list.py +0 -361
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/search.py +0 -174
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/show.py +0 -235
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/uninstall.py +0 -105
- package/.venv/lib/python3.9/site-packages/pip/_internal/commands/wheel.py +0 -177
- package/.venv/lib/python3.9/site-packages/pip/_internal/configuration.py +0 -367
- package/.venv/lib/python3.9/site-packages/pip/_internal/distributions/__init__.py +0 -21
- package/.venv/lib/python3.9/site-packages/pip/_internal/distributions/base.py +0 -36
- package/.venv/lib/python3.9/site-packages/pip/_internal/distributions/installed.py +0 -22
- package/.venv/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py +0 -129
- package/.venv/lib/python3.9/site-packages/pip/_internal/distributions/wheel.py +0 -31
- package/.venv/lib/python3.9/site-packages/pip/_internal/exceptions.py +0 -402
- package/.venv/lib/python3.9/site-packages/pip/_internal/index/__init__.py +0 -2
- package/.venv/lib/python3.9/site-packages/pip/_internal/index/collector.py +0 -536
- package/.venv/lib/python3.9/site-packages/pip/_internal/index/package_finder.py +0 -993
- package/.venv/lib/python3.9/site-packages/pip/_internal/index/sources.py +0 -224
- package/.venv/lib/python3.9/site-packages/pip/_internal/locations/__init__.py +0 -446
- package/.venv/lib/python3.9/site-packages/pip/_internal/locations/_distutils.py +0 -169
- package/.venv/lib/python3.9/site-packages/pip/_internal/locations/_sysconfig.py +0 -219
- package/.venv/lib/python3.9/site-packages/pip/_internal/locations/base.py +0 -52
- package/.venv/lib/python3.9/site-packages/pip/_internal/main.py +0 -12
- package/.venv/lib/python3.9/site-packages/pip/_internal/metadata/__init__.py +0 -51
- package/.venv/lib/python3.9/site-packages/pip/_internal/metadata/base.py +0 -330
- package/.venv/lib/python3.9/site-packages/pip/_internal/metadata/pkg_resources.py +0 -146
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/__init__.py +0 -2
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/candidate.py +0 -34
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/direct_url.py +0 -220
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/format_control.py +0 -80
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/index.py +0 -28
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/link.py +0 -288
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/scheme.py +0 -31
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/search_scope.py +0 -129
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/selection_prefs.py +0 -51
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/target_python.py +0 -110
- package/.venv/lib/python3.9/site-packages/pip/_internal/models/wheel.py +0 -89
- package/.venv/lib/python3.9/site-packages/pip/_internal/network/__init__.py +0 -2
- package/.venv/lib/python3.9/site-packages/pip/_internal/network/auth.py +0 -323
- package/.venv/lib/python3.9/site-packages/pip/_internal/network/cache.py +0 -69
- package/.venv/lib/python3.9/site-packages/pip/_internal/network/download.py +0 -184
- package/.venv/lib/python3.9/site-packages/pip/_internal/network/lazy_wheel.py +0 -210
- package/.venv/lib/python3.9/site-packages/pip/_internal/network/session.py +0 -454
- package/.venv/lib/python3.9/site-packages/pip/_internal/network/utils.py +0 -96
- package/.venv/lib/python3.9/site-packages/pip/_internal/network/xmlrpc.py +0 -60
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/build/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/build/metadata.py +0 -30
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -34
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -67
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/build/wheel.py +0 -37
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -46
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -105
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/check.py +0 -149
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/freeze.py +0 -254
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/install/__init__.py +0 -2
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -46
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/install/legacy.py +0 -125
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/install/wheel.py +0 -738
- package/.venv/lib/python3.9/site-packages/pip/_internal/operations/prepare.py +0 -632
- package/.venv/lib/python3.9/site-packages/pip/_internal/pyproject.py +0 -183
- package/.venv/lib/python3.9/site-packages/pip/_internal/req/__init__.py +0 -94
- package/.venv/lib/python3.9/site-packages/pip/_internal/req/constructors.py +0 -466
- package/.venv/lib/python3.9/site-packages/pip/_internal/req/req_file.py +0 -536
- package/.venv/lib/python3.9/site-packages/pip/_internal/req/req_install.py +0 -891
- package/.venv/lib/python3.9/site-packages/pip/_internal/req/req_set.py +0 -189
- package/.venv/lib/python3.9/site-packages/pip/_internal/req/req_tracker.py +0 -124
- package/.venv/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py +0 -633
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/base.py +0 -20
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -467
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -141
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -540
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -701
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -155
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -215
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -68
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -166
- package/.venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -251
- package/.venv/lib/python3.9/site-packages/pip/_internal/self_outdated_check.py +0 -182
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/_log.py +0 -38
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/appdirs.py +0 -52
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/compat.py +0 -63
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/compatibility_tags.py +0 -165
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/datetime.py +0 -11
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/deprecation.py +0 -120
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/distutils_args.py +0 -42
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/egg_link.py +0 -75
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/encoding.py +0 -36
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/entrypoints.py +0 -27
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/filesystem.py +0 -182
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/filetypes.py +0 -27
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/glibc.py +0 -88
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/hashes.py +0 -144
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/inject_securetransport.py +0 -35
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/logging.py +0 -358
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/misc.py +0 -689
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/models.py +0 -39
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/packaging.py +0 -84
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/parallel.py +0 -103
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/pkg_resources.py +0 -33
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/setuptools_build.py +0 -167
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/subprocess.py +0 -289
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/temp_dir.py +0 -246
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/unpacking.py +0 -258
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/urls.py +0 -62
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/virtualenv.py +0 -104
- package/.venv/lib/python3.9/site-packages/pip/_internal/utils/wheel.py +0 -182
- package/.venv/lib/python3.9/site-packages/pip/_internal/vcs/__init__.py +0 -15
- package/.venv/lib/python3.9/site-packages/pip/_internal/vcs/bazaar.py +0 -93
- package/.venv/lib/python3.9/site-packages/pip/_internal/vcs/git.py +0 -513
- package/.venv/lib/python3.9/site-packages/pip/_internal/vcs/mercurial.py +0 -153
- package/.venv/lib/python3.9/site-packages/pip/_internal/vcs/subversion.py +0 -318
- package/.venv/lib/python3.9/site-packages/pip/_internal/vcs/versioncontrol.py +0 -693
- package/.venv/lib/python3.9/site-packages/pip/_internal/wheel_builder.py +0 -375
- package/.venv/lib/python3.9/site-packages/pip/_vendor/__init__.py +0 -111
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -11
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -57
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -133
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/cache.py +0 -39
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -2
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -146
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -33
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/compat.py +0 -29
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/controller.py +0 -376
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -80
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -135
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -188
- package/.venv/lib/python3.9/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -29
- package/.venv/lib/python3.9/site-packages/pip/_vendor/certifi/__init__.py +0 -3
- package/.venv/lib/python3.9/site-packages/pip/_vendor/certifi/__main__.py +0 -12
- package/.venv/lib/python3.9/site-packages/pip/_vendor/certifi/cacert.pem +0 -4257
- package/.venv/lib/python3.9/site-packages/pip/_vendor/certifi/core.py +0 -76
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/__init__.py +0 -83
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/big5freq.py +0 -386
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/big5prober.py +0 -47
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/chardistribution.py +0 -233
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/charsetgroupprober.py +0 -107
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/charsetprober.py +0 -145
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/cli/__init__.py +0 -1
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/cli/chardetect.py +0 -84
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/codingstatemachine.py +0 -88
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/compat.py +0 -36
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/cp949prober.py +0 -49
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/enums.py +0 -76
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/escprober.py +0 -101
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/escsm.py +0 -246
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/eucjpprober.py +0 -92
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/euckrfreq.py +0 -195
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/euckrprober.py +0 -47
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/euctwfreq.py +0 -387
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/euctwprober.py +0 -46
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/gb2312freq.py +0 -283
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/gb2312prober.py +0 -46
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/hebrewprober.py +0 -292
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/jisfreq.py +0 -325
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/jpcntx.py +0 -233
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/langbulgarianmodel.py +0 -4650
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/langgreekmodel.py +0 -4398
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/langhebrewmodel.py +0 -4383
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/langhungarianmodel.py +0 -4650
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/langrussianmodel.py +0 -5718
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/langthaimodel.py +0 -4383
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/langturkishmodel.py +0 -4383
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/latin1prober.py +0 -145
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/mbcharsetprober.py +0 -91
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/mbcsgroupprober.py +0 -54
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/mbcssm.py +0 -572
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/metadata/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/metadata/languages.py +0 -310
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/sbcharsetprober.py +0 -145
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/sbcsgroupprober.py +0 -83
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/sjisprober.py +0 -92
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/universaldetector.py +0 -286
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/utf8prober.py +0 -82
- package/.venv/lib/python3.9/site-packages/pip/_vendor/chardet/version.py +0 -9
- package/.venv/lib/python3.9/site-packages/pip/_vendor/colorama/__init__.py +0 -6
- package/.venv/lib/python3.9/site-packages/pip/_vendor/colorama/ansi.py +0 -102
- package/.venv/lib/python3.9/site-packages/pip/_vendor/colorama/ansitowin32.py +0 -258
- package/.venv/lib/python3.9/site-packages/pip/_vendor/colorama/initialise.py +0 -80
- package/.venv/lib/python3.9/site-packages/pip/_vendor/colorama/win32.py +0 -152
- package/.venv/lib/python3.9/site-packages/pip/_vendor/colorama/winterm.py +0 -169
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/__init__.py +0 -23
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/__init__.py +0 -6
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/misc.py +0 -41
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/shutil.py +0 -764
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg +0 -84
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/sysconfig.py +0 -786
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/tarfile.py +0 -2607
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/compat.py +0 -1122
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/database.py +0 -1339
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/index.py +0 -509
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/locators.py +0 -1300
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/manifest.py +0 -393
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/markers.py +0 -147
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/metadata.py +0 -1058
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/resources.py +0 -358
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/scripts.py +0 -429
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/t32.exe +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/t64-arm.exe +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/t64.exe +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/util.py +0 -1969
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/version.py +0 -739
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/w32.exe +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/w64-arm.exe +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/w64.exe +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/wheel.py +0 -1053
- package/.venv/lib/python3.9/site-packages/pip/_vendor/distro.py +0 -1386
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/__init__.py +0 -35
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/_ihatexml.py +0 -289
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/_inputstream.py +0 -918
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/_tokenizer.py +0 -1735
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/_trie/__init__.py +0 -5
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/_trie/_base.py +0 -40
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/_trie/py.py +0 -67
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/_utils.py +0 -159
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/constants.py +0 -2946
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/filters/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +0 -29
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/filters/base.py +0 -12
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +0 -73
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/filters/lint.py +0 -93
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +0 -207
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +0 -916
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/filters/whitespace.py +0 -38
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/html5parser.py +0 -2795
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/serializer.py +0 -409
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py +0 -30
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py +0 -54
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treeadapters/sax.py +0 -50
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +0 -88
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treebuilders/base.py +0 -417
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +0 -239
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +0 -343
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +0 -392
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py +0 -154
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treewalkers/base.py +0 -252
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treewalkers/dom.py +0 -43
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treewalkers/etree.py +0 -131
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.py +0 -215
- package/.venv/lib/python3.9/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py +0 -69
- package/.venv/lib/python3.9/site-packages/pip/_vendor/idna/__init__.py +0 -44
- package/.venv/lib/python3.9/site-packages/pip/_vendor/idna/codec.py +0 -117
- package/.venv/lib/python3.9/site-packages/pip/_vendor/idna/compat.py +0 -16
- package/.venv/lib/python3.9/site-packages/pip/_vendor/idna/core.py +0 -409
- package/.venv/lib/python3.9/site-packages/pip/_vendor/idna/idnadata.py +0 -2050
- package/.venv/lib/python3.9/site-packages/pip/_vendor/idna/intranges.py +0 -58
- package/.venv/lib/python3.9/site-packages/pip/_vendor/idna/package_data.py +0 -2
- package/.venv/lib/python3.9/site-packages/pip/_vendor/idna/uts46data.py +0 -8438
- package/.venv/lib/python3.9/site-packages/pip/_vendor/msgpack/__init__.py +0 -54
- package/.venv/lib/python3.9/site-packages/pip/_vendor/msgpack/_version.py +0 -1
- package/.venv/lib/python3.9/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
- package/.venv/lib/python3.9/site-packages/pip/_vendor/msgpack/ext.py +0 -193
- package/.venv/lib/python3.9/site-packages/pip/_vendor/msgpack/fallback.py +0 -1087
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/__about__.py +0 -26
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/__init__.py +0 -25
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/_manylinux.py +0 -301
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/_musllinux.py +0 -136
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/_structures.py +0 -67
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/markers.py +0 -304
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/requirements.py +0 -146
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/specifiers.py +0 -828
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/tags.py +0 -484
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/utils.py +0 -136
- package/.venv/lib/python3.9/site-packages/pip/_vendor/packaging/version.py +0 -504
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/__init__.py +0 -6
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/build.py +0 -127
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/check.py +0 -207
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/colorlog.py +0 -115
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/compat.py +0 -51
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/dirtools.py +0 -44
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/envbuild.py +0 -171
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/__init__.py +0 -17
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py +0 -363
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/meta.py +0 -92
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py +0 -375
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3296
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/py31compat.py +0 -23
- package/.venv/lib/python3.9/site-packages/pip/_vendor/platformdirs/__init__.py +0 -329
- package/.venv/lib/python3.9/site-packages/pip/_vendor/platformdirs/__main__.py +0 -44
- package/.venv/lib/python3.9/site-packages/pip/_vendor/platformdirs/android.py +0 -117
- package/.venv/lib/python3.9/site-packages/pip/_vendor/platformdirs/api.py +0 -155
- package/.venv/lib/python3.9/site-packages/pip/_vendor/platformdirs/macos.py +0 -62
- package/.venv/lib/python3.9/site-packages/pip/_vendor/platformdirs/unix.py +0 -180
- package/.venv/lib/python3.9/site-packages/pip/_vendor/platformdirs/version.py +0 -4
- package/.venv/lib/python3.9/site-packages/pip/_vendor/platformdirs/windows.py +0 -180
- package/.venv/lib/python3.9/site-packages/pip/_vendor/progress/__init__.py +0 -189
- package/.venv/lib/python3.9/site-packages/pip/_vendor/progress/bar.py +0 -93
- package/.venv/lib/python3.9/site-packages/pip/_vendor/progress/colors.py +0 -79
- package/.venv/lib/python3.9/site-packages/pip/_vendor/progress/counter.py +0 -47
- package/.venv/lib/python3.9/site-packages/pip/_vendor/progress/spinner.py +0 -45
- package/.venv/lib/python3.9/site-packages/pip/_vendor/pyparsing.py +0 -7107
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/__init__.py +0 -154
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/__version__.py +0 -14
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/_internal_utils.py +0 -42
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/adapters.py +0 -533
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/api.py +0 -159
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/auth.py +0 -305
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/certs.py +0 -18
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/compat.py +0 -76
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/cookies.py +0 -549
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/exceptions.py +0 -127
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/help.py +0 -132
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/hooks.py +0 -34
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/models.py +0 -966
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/packages.py +0 -16
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/sessions.py +0 -781
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/status_codes.py +0 -123
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/structures.py +0 -105
- package/.venv/lib/python3.9/site-packages/pip/_vendor/requests/utils.py +0 -1013
- package/.venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/__init__.py +0 -26
- package/.venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/compat/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/compat/collections_abc.py +0 -6
- package/.venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/providers.py +0 -133
- package/.venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/reporters.py +0 -37
- package/.venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py +0 -483
- package/.venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/structs.py +0 -165
- package/.venv/lib/python3.9/site-packages/pip/_vendor/six.py +0 -998
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/__init__.py +0 -517
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/_asyncio.py +0 -92
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/_utils.py +0 -68
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/after.py +0 -46
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/before.py +0 -41
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/before_sleep.py +0 -58
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/nap.py +0 -43
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/retry.py +0 -213
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/stop.py +0 -96
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/tornadoweb.py +0 -59
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tenacity/wait.py +0 -191
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tomli/__init__.py +0 -6
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tomli/_parser.py +0 -703
- package/.venv/lib/python3.9/site-packages/pip/_vendor/tomli/_re.py +0 -83
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/__init__.py +0 -85
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/_collections.py +0 -337
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/_version.py +0 -2
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/connection.py +0 -569
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1078
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -511
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -922
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/fields.py +0 -274
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -5
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1077
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__init__.py +0 -24
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py +0 -160
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -536
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/request.py +0 -170
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/response.py +0 -821
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/connection.py +0 -150
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/request.py +0 -143
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/retry.py +0 -602
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -495
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -268
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/url.py +0 -432
- package/.venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/wait.py +0 -153
- package/.venv/lib/python3.9/site-packages/pip/_vendor/vendor.txt +0 -22
- package/.venv/lib/python3.9/site-packages/pip/_vendor/webencodings/__init__.py +0 -342
- package/.venv/lib/python3.9/site-packages/pip/_vendor/webencodings/labels.py +0 -231
- package/.venv/lib/python3.9/site-packages/pip/_vendor/webencodings/mklabels.py +0 -59
- package/.venv/lib/python3.9/site-packages/pip/_vendor/webencodings/tests.py +0 -153
- package/.venv/lib/python3.9/site-packages/pip/_vendor/webencodings/x_user_defined.py +0 -325
- package/.venv/lib/python3.9/site-packages/pip/py.typed +0 -4
- package/.venv/lib/python3.9/site-packages/pip-21.3.1.dist-info/INSTALLER +0 -1
- package/.venv/lib/python3.9/site-packages/pip-21.3.1.dist-info/LICENSE.txt +0 -20
- package/.venv/lib/python3.9/site-packages/pip-21.3.1.dist-info/METADATA +0 -93
- package/.venv/lib/python3.9/site-packages/pip-21.3.1.dist-info/RECORD +0 -819
- package/.venv/lib/python3.9/site-packages/pip-21.3.1.dist-info/REQUESTED +0 -0
- package/.venv/lib/python3.9/site-packages/pip-21.3.1.dist-info/WHEEL +0 -5
- package/.venv/lib/python3.9/site-packages/pip-21.3.1.dist-info/entry_points.txt +0 -5
- package/.venv/lib/python3.9/site-packages/pip-21.3.1.dist-info/top_level.txt +0 -1
- package/.venv/lib/python3.9/site-packages/pkg_resources/__init__.py +0 -3303
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/appdirs.py +0 -608
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/__about__.py +0 -26
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/__init__.py +0 -25
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/_manylinux.py +0 -301
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/_musllinux.py +0 -136
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/_structures.py +0 -67
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/markers.py +0 -304
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/requirements.py +0 -146
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/specifiers.py +0 -828
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/tags.py +0 -484
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/utils.py +0 -136
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py +0 -504
- package/.venv/lib/python3.9/site-packages/pkg_resources/_vendor/pyparsing.py +0 -5742
- package/.venv/lib/python3.9/site-packages/pkg_resources/extern/__init__.py +0 -73
- package/.venv/lib/python3.9/site-packages/pkg_resources/tests/data/my-test-package-source/setup.py +0 -6
- package/.venv/lib/python3.9/site-packages/setuptools/__init__.py +0 -244
- package/.venv/lib/python3.9/site-packages/setuptools/_deprecation_warning.py +0 -7
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/__init__.py +0 -24
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/_collections.py +0 -56
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/_msvccompiler.py +0 -561
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/archive_util.py +0 -256
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/bcppcompiler.py +0 -393
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/ccompiler.py +0 -1123
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/cmd.py +0 -403
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/__init__.py +0 -31
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/bdist.py +0 -143
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/bdist_dumb.py +0 -123
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/bdist_msi.py +0 -749
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/bdist_rpm.py +0 -579
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/bdist_wininst.py +0 -377
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/build.py +0 -157
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/build_clib.py +0 -209
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py +0 -755
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/build_py.py +0 -392
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/build_scripts.py +0 -152
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/check.py +0 -148
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/clean.py +0 -76
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/config.py +0 -344
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/install.py +0 -775
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/install_data.py +0 -79
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/install_egg_info.py +0 -84
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/install_headers.py +0 -47
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/install_lib.py +0 -217
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/install_scripts.py +0 -60
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/py37compat.py +0 -30
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/register.py +0 -304
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/sdist.py +0 -494
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/command/upload.py +0 -214
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/config.py +0 -130
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/core.py +0 -249
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/cygwinccompiler.py +0 -362
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/debug.py +0 -5
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/dep_util.py +0 -92
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/dir_util.py +0 -210
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/dist.py +0 -1257
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/errors.py +0 -97
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/extension.py +0 -240
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/fancy_getopt.py +0 -457
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/file_util.py +0 -238
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/filelist.py +0 -355
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/log.py +0 -81
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/msvc9compiler.py +0 -788
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/msvccompiler.py +0 -643
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/py35compat.py +0 -19
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/py38compat.py +0 -7
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/spawn.py +0 -106
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/sysconfig.py +0 -567
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/text_file.py +0 -286
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/unixccompiler.py +0 -325
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/util.py +0 -548
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/version.py +0 -363
- package/.venv/lib/python3.9/site-packages/setuptools/_distutils/versionpredicate.py +0 -169
- package/.venv/lib/python3.9/site-packages/setuptools/_imp.py +0 -82
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/more_itertools/__init__.py +0 -4
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/more_itertools/more.py +0 -3825
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/more_itertools/recipes.py +0 -620
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/ordered_set.py +0 -488
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/__about__.py +0 -26
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/__init__.py +0 -25
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/_manylinux.py +0 -301
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/_musllinux.py +0 -136
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/_structures.py +0 -67
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/markers.py +0 -304
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/requirements.py +0 -146
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/specifiers.py +0 -828
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/tags.py +0 -484
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/utils.py +0 -136
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/packaging/version.py +0 -504
- package/.venv/lib/python3.9/site-packages/setuptools/_vendor/pyparsing.py +0 -5742
- package/.venv/lib/python3.9/site-packages/setuptools/archive_util.py +0 -205
- package/.venv/lib/python3.9/site-packages/setuptools/build_meta.py +0 -290
- package/.venv/lib/python3.9/site-packages/setuptools/cli-32.exe +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools/cli-64.exe +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools/cli-arm64.exe +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools/cli.exe +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools/command/__init__.py +0 -8
- package/.venv/lib/python3.9/site-packages/setuptools/command/alias.py +0 -78
- package/.venv/lib/python3.9/site-packages/setuptools/command/bdist_egg.py +0 -456
- package/.venv/lib/python3.9/site-packages/setuptools/command/bdist_rpm.py +0 -40
- package/.venv/lib/python3.9/site-packages/setuptools/command/build_clib.py +0 -101
- package/.venv/lib/python3.9/site-packages/setuptools/command/build_ext.py +0 -328
- package/.venv/lib/python3.9/site-packages/setuptools/command/build_py.py +0 -242
- package/.venv/lib/python3.9/site-packages/setuptools/command/develop.py +0 -193
- package/.venv/lib/python3.9/site-packages/setuptools/command/dist_info.py +0 -36
- package/.venv/lib/python3.9/site-packages/setuptools/command/easy_install.py +0 -2304
- package/.venv/lib/python3.9/site-packages/setuptools/command/egg_info.py +0 -755
- package/.venv/lib/python3.9/site-packages/setuptools/command/install.py +0 -132
- package/.venv/lib/python3.9/site-packages/setuptools/command/install_egg_info.py +0 -62
- package/.venv/lib/python3.9/site-packages/setuptools/command/install_lib.py +0 -122
- package/.venv/lib/python3.9/site-packages/setuptools/command/install_scripts.py +0 -69
- package/.venv/lib/python3.9/site-packages/setuptools/command/launcher manifest.xml +0 -15
- package/.venv/lib/python3.9/site-packages/setuptools/command/py36compat.py +0 -134
- package/.venv/lib/python3.9/site-packages/setuptools/command/register.py +0 -18
- package/.venv/lib/python3.9/site-packages/setuptools/command/rotate.py +0 -64
- package/.venv/lib/python3.9/site-packages/setuptools/command/saveopts.py +0 -22
- package/.venv/lib/python3.9/site-packages/setuptools/command/sdist.py +0 -196
- package/.venv/lib/python3.9/site-packages/setuptools/command/setopt.py +0 -149
- package/.venv/lib/python3.9/site-packages/setuptools/command/test.py +0 -252
- package/.venv/lib/python3.9/site-packages/setuptools/command/upload.py +0 -17
- package/.venv/lib/python3.9/site-packages/setuptools/command/upload_docs.py +0 -202
- package/.venv/lib/python3.9/site-packages/setuptools/config.py +0 -751
- package/.venv/lib/python3.9/site-packages/setuptools/dep_util.py +0 -25
- package/.venv/lib/python3.9/site-packages/setuptools/depends.py +0 -176
- package/.venv/lib/python3.9/site-packages/setuptools/dist.py +0 -1156
- package/.venv/lib/python3.9/site-packages/setuptools/errors.py +0 -40
- package/.venv/lib/python3.9/site-packages/setuptools/extension.py +0 -55
- package/.venv/lib/python3.9/site-packages/setuptools/extern/__init__.py +0 -73
- package/.venv/lib/python3.9/site-packages/setuptools/glob.py +0 -167
- package/.venv/lib/python3.9/site-packages/setuptools/gui-32.exe +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools/gui-64.exe +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools/gui-arm64.exe +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools/gui.exe +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools/installer.py +0 -104
- package/.venv/lib/python3.9/site-packages/setuptools/launch.py +0 -36
- package/.venv/lib/python3.9/site-packages/setuptools/logging.py +0 -30
- package/.venv/lib/python3.9/site-packages/setuptools/monkey.py +0 -177
- package/.venv/lib/python3.9/site-packages/setuptools/msvc.py +0 -1805
- package/.venv/lib/python3.9/site-packages/setuptools/namespaces.py +0 -107
- package/.venv/lib/python3.9/site-packages/setuptools/package_index.py +0 -1127
- package/.venv/lib/python3.9/site-packages/setuptools/py34compat.py +0 -13
- package/.venv/lib/python3.9/site-packages/setuptools/sandbox.py +0 -530
- package/.venv/lib/python3.9/site-packages/setuptools/script (dev).tmpl +0 -6
- package/.venv/lib/python3.9/site-packages/setuptools/script.tmpl +0 -3
- package/.venv/lib/python3.9/site-packages/setuptools/tests/integration/__init__.py +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools/tests/integration/helpers.py +0 -61
- package/.venv/lib/python3.9/site-packages/setuptools/tests/integration/test_pip_install_sdist.py +0 -218
- package/.venv/lib/python3.9/site-packages/setuptools/unicode_utils.py +0 -42
- package/.venv/lib/python3.9/site-packages/setuptools/version.py +0 -6
- package/.venv/lib/python3.9/site-packages/setuptools/wheel.py +0 -213
- package/.venv/lib/python3.9/site-packages/setuptools/windows_support.py +0 -29
- package/.venv/lib/python3.9/site-packages/setuptools-60.5.0.dist-info/INSTALLER +0 -1
- package/.venv/lib/python3.9/site-packages/setuptools-60.5.0.dist-info/LICENSE +0 -19
- package/.venv/lib/python3.9/site-packages/setuptools-60.5.0.dist-info/METADATA +0 -142
- package/.venv/lib/python3.9/site-packages/setuptools-60.5.0.dist-info/RECORD +0 -308
- package/.venv/lib/python3.9/site-packages/setuptools-60.5.0.dist-info/REQUESTED +0 -0
- package/.venv/lib/python3.9/site-packages/setuptools-60.5.0.dist-info/WHEEL +0 -5
- package/.venv/lib/python3.9/site-packages/setuptools-60.5.0.dist-info/entry_points.txt +0 -56
- package/.venv/lib/python3.9/site-packages/setuptools-60.5.0.dist-info/top_level.txt +0 -3
- package/.venv/pyvenv.cfg +0 -3
- package/.vscode/launch.json +0 -62
- package/.vscode/settings.json +0 -8
|
@@ -1,2412 +0,0 @@
|
|
|
1
|
-
# -*- Mode: Python; py-indent-offset: 4 -*-
|
|
2
|
-
# vim: tabstop=4 shiftwidth=4 expandtab
|
|
3
|
-
#
|
|
4
|
-
# Copyright (C) 2009 Johan Dahlin <johan@gnome.org>
|
|
5
|
-
# 2010 Simon van der Linden <svdlinden@src.gnome.org>
|
|
6
|
-
#
|
|
7
|
-
# This library is free software; you can redistribute it and/or
|
|
8
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
9
|
-
# License as published by the Free Software Foundation; either
|
|
10
|
-
# version 2.1 of the License, or (at your option) any later version.
|
|
11
|
-
#
|
|
12
|
-
# This library is distributed in the hope that it will be useful,
|
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
15
|
-
# Lesser General Public License for more details.
|
|
16
|
-
#
|
|
17
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
18
|
-
# License along with this library; if not, write to the Free Software
|
|
19
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
|
|
20
|
-
# USA
|
|
21
|
-
|
|
22
|
-
import collections
|
|
23
|
-
import sys
|
|
24
|
-
import warnings
|
|
25
|
-
|
|
26
|
-
from pgi.repository import GObject
|
|
27
|
-
from pgi.overrides import override, get_introspection_module, \
|
|
28
|
-
strip_boolean_result, deprecated_init
|
|
29
|
-
from pgi import PyGIDeprecationWarning
|
|
30
|
-
|
|
31
|
-
if sys.version_info >= (3, 0):
|
|
32
|
-
_basestring = str
|
|
33
|
-
_callable = lambda c: hasattr(c, '__call__')
|
|
34
|
-
else:
|
|
35
|
-
_basestring = basestring
|
|
36
|
-
_callable = callable
|
|
37
|
-
|
|
38
|
-
Gtk = get_introspection_module('Gtk')
|
|
39
|
-
|
|
40
|
-
__all__ = []
|
|
41
|
-
|
|
42
|
-
if Gtk._version == '2.0':
|
|
43
|
-
warn_msg = "You have imported the Gtk 2.0 module. Because Gtk 2.0 \
|
|
44
|
-
was not designed for use with introspection some of the \
|
|
45
|
-
interfaces and API will fail. As such this is not supported \
|
|
46
|
-
by the pygobject development team and we encourage you to \
|
|
47
|
-
port your app to Gtk 3 or greater. PyGTK is the recomended \
|
|
48
|
-
python module to use with Gtk 2.0"
|
|
49
|
-
|
|
50
|
-
warnings.warn(warn_msg, RuntimeWarning)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class PyGTKDeprecationWarning(PyGIDeprecationWarning):
|
|
54
|
-
pass
|
|
55
|
-
|
|
56
|
-
__all__.append('PyGTKDeprecationWarning')
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def _construct_target_list(targets):
|
|
60
|
-
"""Create a list of TargetEntry items from a list of tuples in the form (target, flags, info)
|
|
61
|
-
|
|
62
|
-
The list can also contain existing TargetEntry items in which case the existing entry
|
|
63
|
-
is re-used in the return list.
|
|
64
|
-
"""
|
|
65
|
-
target_entries = []
|
|
66
|
-
for entry in targets:
|
|
67
|
-
if not isinstance(entry, Gtk.TargetEntry):
|
|
68
|
-
entry = Gtk.TargetEntry.new(*entry)
|
|
69
|
-
target_entries.append(entry)
|
|
70
|
-
return target_entries
|
|
71
|
-
|
|
72
|
-
__all__.append('_construct_target_list')
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def _extract_handler_and_args(obj_or_map, handler_name):
|
|
76
|
-
handler = None
|
|
77
|
-
if isinstance(obj_or_map, collections.Mapping):
|
|
78
|
-
handler = obj_or_map.get(handler_name, None)
|
|
79
|
-
else:
|
|
80
|
-
handler = getattr(obj_or_map, handler_name, None)
|
|
81
|
-
|
|
82
|
-
if handler is None:
|
|
83
|
-
raise AttributeError('Handler %s not found' % handler_name)
|
|
84
|
-
|
|
85
|
-
args = ()
|
|
86
|
-
if isinstance(handler, collections.Sequence):
|
|
87
|
-
if len(handler) == 0:
|
|
88
|
-
raise TypeError("Handler %s tuple can not be empty" % handler)
|
|
89
|
-
args = handler[1:]
|
|
90
|
-
handler = handler[0]
|
|
91
|
-
|
|
92
|
-
elif not _callable(handler):
|
|
93
|
-
raise TypeError('Handler %s is not a method, function or tuple' % handler)
|
|
94
|
-
|
|
95
|
-
return handler, args
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
# Exposed for unit-testing.
|
|
99
|
-
__all__.append('_extract_handler_and_args')
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
def _builder_connect_callback(builder, gobj, signal_name, handler_name, connect_obj, flags, obj_or_map):
|
|
103
|
-
handler, args = _extract_handler_and_args(obj_or_map, handler_name)
|
|
104
|
-
|
|
105
|
-
after = flags & GObject.ConnectFlags.AFTER
|
|
106
|
-
if connect_obj is not None:
|
|
107
|
-
if after:
|
|
108
|
-
gobj.connect_object_after(signal_name, handler, connect_obj, *args)
|
|
109
|
-
else:
|
|
110
|
-
gobj.connect_object(signal_name, handler, connect_obj, *args)
|
|
111
|
-
else:
|
|
112
|
-
if after:
|
|
113
|
-
gobj.connect_after(signal_name, handler, *args)
|
|
114
|
-
else:
|
|
115
|
-
gobj.connect(signal_name, handler, *args)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
class Widget(Gtk.Widget):
|
|
119
|
-
|
|
120
|
-
translate_coordinates = strip_boolean_result(Gtk.Widget.translate_coordinates)
|
|
121
|
-
"""
|
|
122
|
-
:param dest_widget: a :obj:`Gtk.Widget`
|
|
123
|
-
:type dest_widget: :obj:`Gtk.Widget`
|
|
124
|
-
:param src_x: X position relative to `self`
|
|
125
|
-
:type src_x: :obj:`int`
|
|
126
|
-
:param src_y: Y position relative to `self`
|
|
127
|
-
:type src_y: :obj:`int`
|
|
128
|
-
:returns:
|
|
129
|
-
:obj:`None` if either widget was not realized, or there
|
|
130
|
-
was no common ancestor. Otherwise a ``(dest_x, dest_y)`` tuple
|
|
131
|
-
containing the X and Y position relative to `dest_widget`.
|
|
132
|
-
:rtype: (**dest_x**: :obj:`int`, **dest_y**: :obj:`int`) or :obj:`None`
|
|
133
|
-
|
|
134
|
-
{{ docs }}
|
|
135
|
-
"""
|
|
136
|
-
|
|
137
|
-
def drag_dest_set_target_list(self, target_list):
|
|
138
|
-
if (target_list is not None) and (not isinstance(target_list, Gtk.TargetList)):
|
|
139
|
-
target_list = Gtk.TargetList.new(_construct_target_list(target_list))
|
|
140
|
-
super(Widget, self).drag_dest_set_target_list(target_list)
|
|
141
|
-
|
|
142
|
-
def drag_source_set_target_list(self, target_list):
|
|
143
|
-
if (target_list is not None) and (not isinstance(target_list, Gtk.TargetList)):
|
|
144
|
-
target_list = Gtk.TargetList.new(_construct_target_list(target_list))
|
|
145
|
-
super(Widget, self).drag_source_set_target_list(target_list)
|
|
146
|
-
|
|
147
|
-
def style_get_property(self, property_name, value=None):
|
|
148
|
-
"""style_get_property(property_name, value=None)
|
|
149
|
-
|
|
150
|
-
:param property_name:
|
|
151
|
-
the name of a style property
|
|
152
|
-
:type property_name: :obj:`str`
|
|
153
|
-
|
|
154
|
-
:param value:
|
|
155
|
-
Either :obj:`None` or a correctly initialized :obj:`GObject.Value`
|
|
156
|
-
:type value: :obj:`GObject.Value` or :obj:`None`
|
|
157
|
-
|
|
158
|
-
:returns: The Python value of the style property
|
|
159
|
-
|
|
160
|
-
{{ docs }}
|
|
161
|
-
"""
|
|
162
|
-
|
|
163
|
-
if value is None:
|
|
164
|
-
prop = self.find_style_property(property_name)
|
|
165
|
-
if prop is None:
|
|
166
|
-
raise ValueError('Class "%s" does not contain style property "%s"' %
|
|
167
|
-
(self, property_name))
|
|
168
|
-
value = GObject.Value(prop.value_type)
|
|
169
|
-
|
|
170
|
-
Gtk.Widget.style_get_property(self, property_name, value)
|
|
171
|
-
return value.get_value()
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
Widget = override(Widget)
|
|
175
|
-
__all__.append('Widget')
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
class Container(Gtk.Container, Widget):
|
|
179
|
-
def __len__(self):
|
|
180
|
-
return len(self.get_children())
|
|
181
|
-
|
|
182
|
-
def __contains__(self, child):
|
|
183
|
-
return child in self.get_children()
|
|
184
|
-
|
|
185
|
-
def __iter__(self):
|
|
186
|
-
return iter(self.get_children())
|
|
187
|
-
|
|
188
|
-
def __bool__(self):
|
|
189
|
-
return True
|
|
190
|
-
|
|
191
|
-
# alias for Python 2.x object protocol
|
|
192
|
-
__nonzero__ = __bool__
|
|
193
|
-
|
|
194
|
-
get_focus_chain = strip_boolean_result(Gtk.Container.get_focus_chain)
|
|
195
|
-
"""
|
|
196
|
-
:returns:
|
|
197
|
-
A list of focusable widgets or :obj:`None` if no focus chain has
|
|
198
|
-
been explicitly set.
|
|
199
|
-
|
|
200
|
-
:rtype: [:obj:`Gtk.Widget`] or :obj:`None`
|
|
201
|
-
|
|
202
|
-
Retrieves the focus chain of the container, if one has been
|
|
203
|
-
set explicitly. If no focus chain has been explicitly
|
|
204
|
-
set, GTK+ computes the focus chain based on the positions
|
|
205
|
-
of the children. In that case returns :obj:`None`.
|
|
206
|
-
"""
|
|
207
|
-
|
|
208
|
-
def child_get_property(self, child, property_name, value=None):
|
|
209
|
-
"""child_get_property(child, property_name, value=None)
|
|
210
|
-
|
|
211
|
-
:param child:
|
|
212
|
-
a widget which is a child of `self`
|
|
213
|
-
:type child: :obj:`Gtk.Widget`
|
|
214
|
-
|
|
215
|
-
:param property_name:
|
|
216
|
-
the name of the property to get
|
|
217
|
-
:type property_name: :obj:`str`
|
|
218
|
-
|
|
219
|
-
:param value:
|
|
220
|
-
Either :obj:`None` or a correctly initialized :obj:`GObject.Value`
|
|
221
|
-
:type value: :obj:`GObject.Value` or :obj:`None`
|
|
222
|
-
|
|
223
|
-
:returns: The Python value of the child property
|
|
224
|
-
|
|
225
|
-
{{ docs }}
|
|
226
|
-
"""
|
|
227
|
-
|
|
228
|
-
if value is None:
|
|
229
|
-
prop = self.find_child_property(property_name)
|
|
230
|
-
if prop is None:
|
|
231
|
-
raise ValueError('Class "%s" does not contain child property "%s"' %
|
|
232
|
-
(self, property_name))
|
|
233
|
-
value = GObject.Value(prop.value_type)
|
|
234
|
-
|
|
235
|
-
Gtk.Container.child_get_property(self, child, property_name, value)
|
|
236
|
-
return value.get_value()
|
|
237
|
-
|
|
238
|
-
def child_get(self, child, *prop_names):
|
|
239
|
-
"""Returns a list of child property values for the given names."""
|
|
240
|
-
|
|
241
|
-
return [self.child_get_property(child, name) for name in prop_names]
|
|
242
|
-
|
|
243
|
-
def child_set(self, child, **kwargs):
|
|
244
|
-
"""Set a child properties on the given child to key/value pairs."""
|
|
245
|
-
|
|
246
|
-
for name, value in kwargs.items():
|
|
247
|
-
name = name.replace('_', '-')
|
|
248
|
-
self.child_set_property(child, name, value)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
Container = override(Container)
|
|
252
|
-
__all__.append('Container')
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
class Editable(Gtk.Editable):
|
|
256
|
-
|
|
257
|
-
def insert_text(self, text, position):
|
|
258
|
-
"""insert_text(self, text, position)
|
|
259
|
-
|
|
260
|
-
:param new_text:
|
|
261
|
-
the text to append
|
|
262
|
-
:type new_text: :obj:`str`
|
|
263
|
-
|
|
264
|
-
:param position:
|
|
265
|
-
location of the position text will be inserted at
|
|
266
|
-
:type position: :obj:`int`
|
|
267
|
-
|
|
268
|
-
:returns:
|
|
269
|
-
location of the position text will be inserted at
|
|
270
|
-
:rtype: :obj:`int`
|
|
271
|
-
|
|
272
|
-
Inserts `new_text` into the contents of the
|
|
273
|
-
widget, at position `position`.
|
|
274
|
-
|
|
275
|
-
Note that the position is in characters, not in bytes.
|
|
276
|
-
"""
|
|
277
|
-
|
|
278
|
-
return super(Editable, self).insert_text(text, -1, position)
|
|
279
|
-
|
|
280
|
-
get_selection_bounds = strip_boolean_result(Gtk.Editable.get_selection_bounds, fail_ret=())
|
|
281
|
-
"""
|
|
282
|
-
:returns:
|
|
283
|
-
An empty tuple if no area is selected or a tuple containing:
|
|
284
|
-
|
|
285
|
-
:start_pos: the starting position
|
|
286
|
-
:end_pos: the end position
|
|
287
|
-
|
|
288
|
-
:rtype: (**start_pos**: :obj:`int`, **end_pos**: :obj:`int`) or ``()``
|
|
289
|
-
|
|
290
|
-
Retrieves the selection bound of the editable. start_pos will be filled
|
|
291
|
-
with the start of the selection and `end_pos` with end. If no text was
|
|
292
|
-
selected an empty tuple will be returned.
|
|
293
|
-
|
|
294
|
-
Note that positions are specified in characters, not bytes.
|
|
295
|
-
"""
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
Editable = override(Editable)
|
|
299
|
-
__all__.append("Editable")
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
class Action(Gtk.Action):
|
|
303
|
-
__init__ = deprecated_init(Gtk.Action.__init__,
|
|
304
|
-
arg_names=('name', 'label', 'tooltip', 'stock_id'),
|
|
305
|
-
category=PyGTKDeprecationWarning)
|
|
306
|
-
|
|
307
|
-
Action = override(Action)
|
|
308
|
-
__all__.append("Action")
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
class RadioAction(Gtk.RadioAction):
|
|
312
|
-
__init__ = deprecated_init(Gtk.RadioAction.__init__,
|
|
313
|
-
arg_names=('name', 'label', 'tooltip', 'stock_id', 'value'),
|
|
314
|
-
category=PyGTKDeprecationWarning)
|
|
315
|
-
|
|
316
|
-
RadioAction = override(RadioAction)
|
|
317
|
-
__all__.append("RadioAction")
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
class ActionGroup(Gtk.ActionGroup):
|
|
321
|
-
__init__ = deprecated_init(Gtk.ActionGroup.__init__,
|
|
322
|
-
arg_names=('name',),
|
|
323
|
-
category=PyGTKDeprecationWarning)
|
|
324
|
-
|
|
325
|
-
def add_actions(self, entries, user_data=None):
|
|
326
|
-
"""
|
|
327
|
-
The add_actions() method is a convenience method that creates a number
|
|
328
|
-
of gtk.Action objects based on the information in the list of action
|
|
329
|
-
entry tuples contained in entries and adds them to the action group.
|
|
330
|
-
The entry tuples can vary in size from one to six items with the
|
|
331
|
-
following information:
|
|
332
|
-
|
|
333
|
-
* The name of the action. Must be specified.
|
|
334
|
-
* The stock id for the action. Optional with a default value of None
|
|
335
|
-
if a label is specified.
|
|
336
|
-
* The label for the action. This field should typically be marked
|
|
337
|
-
for translation, see the set_translation_domain() method. Optional
|
|
338
|
-
with a default value of None if a stock id is specified.
|
|
339
|
-
* The accelerator for the action, in the format understood by the
|
|
340
|
-
gtk.accelerator_parse() function. Optional with a default value of
|
|
341
|
-
None.
|
|
342
|
-
* The tooltip for the action. This field should typically be marked
|
|
343
|
-
for translation, see the set_translation_domain() method. Optional
|
|
344
|
-
with a default value of None.
|
|
345
|
-
* The callback function invoked when the action is activated.
|
|
346
|
-
Optional with a default value of None.
|
|
347
|
-
|
|
348
|
-
The "activate" signals of the actions are connected to the callbacks and
|
|
349
|
-
their accel paths are set to <Actions>/group-name/action-name.
|
|
350
|
-
"""
|
|
351
|
-
try:
|
|
352
|
-
iter(entries)
|
|
353
|
-
except (TypeError):
|
|
354
|
-
raise TypeError('entries must be iterable')
|
|
355
|
-
|
|
356
|
-
def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None):
|
|
357
|
-
action = Action(name=name, label=label, tooltip=tooltip, stock_id=stock_id)
|
|
358
|
-
if callback is not None:
|
|
359
|
-
if user_data is None:
|
|
360
|
-
action.connect('activate', callback)
|
|
361
|
-
else:
|
|
362
|
-
action.connect('activate', callback, user_data)
|
|
363
|
-
|
|
364
|
-
self.add_action_with_accel(action, accelerator)
|
|
365
|
-
|
|
366
|
-
for e in entries:
|
|
367
|
-
# using inner function above since entries can leave out optional arguments
|
|
368
|
-
_process_action(*e)
|
|
369
|
-
|
|
370
|
-
def add_toggle_actions(self, entries, user_data=None):
|
|
371
|
-
"""
|
|
372
|
-
The add_toggle_actions() method is a convenience method that creates a
|
|
373
|
-
number of gtk.ToggleAction objects based on the information in the list
|
|
374
|
-
of action entry tuples contained in entries and adds them to the action
|
|
375
|
-
group. The toggle action entry tuples can vary in size from one to seven
|
|
376
|
-
items with the following information:
|
|
377
|
-
|
|
378
|
-
* The name of the action. Must be specified.
|
|
379
|
-
* The stock id for the action. Optional with a default value of None
|
|
380
|
-
if a label is specified.
|
|
381
|
-
* The label for the action. This field should typically be marked
|
|
382
|
-
for translation, see the set_translation_domain() method. Optional
|
|
383
|
-
with a default value of None if a stock id is specified.
|
|
384
|
-
* The accelerator for the action, in the format understood by the
|
|
385
|
-
gtk.accelerator_parse() function. Optional with a default value of
|
|
386
|
-
None.
|
|
387
|
-
* The tooltip for the action. This field should typically be marked
|
|
388
|
-
for translation, see the set_translation_domain() method. Optional
|
|
389
|
-
with a default value of None.
|
|
390
|
-
* The callback function invoked when the action is activated.
|
|
391
|
-
Optional with a default value of None.
|
|
392
|
-
* A flag indicating whether the toggle action is active. Optional
|
|
393
|
-
with a default value of False.
|
|
394
|
-
|
|
395
|
-
The "activate" signals of the actions are connected to the callbacks and
|
|
396
|
-
their accel paths are set to <Actions>/group-name/action-name.
|
|
397
|
-
"""
|
|
398
|
-
|
|
399
|
-
try:
|
|
400
|
-
iter(entries)
|
|
401
|
-
except (TypeError):
|
|
402
|
-
raise TypeError('entries must be iterable')
|
|
403
|
-
|
|
404
|
-
def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None, is_active=False):
|
|
405
|
-
action = Gtk.ToggleAction(name=name, label=label, tooltip=tooltip, stock_id=stock_id)
|
|
406
|
-
action.set_active(is_active)
|
|
407
|
-
if callback is not None:
|
|
408
|
-
if user_data is None:
|
|
409
|
-
action.connect('activate', callback)
|
|
410
|
-
else:
|
|
411
|
-
action.connect('activate', callback, user_data)
|
|
412
|
-
|
|
413
|
-
self.add_action_with_accel(action, accelerator)
|
|
414
|
-
|
|
415
|
-
for e in entries:
|
|
416
|
-
# using inner function above since entries can leave out optional arguments
|
|
417
|
-
_process_action(*e)
|
|
418
|
-
|
|
419
|
-
def add_radio_actions(self, entries, value=None, on_change=None, user_data=None):
|
|
420
|
-
"""
|
|
421
|
-
The add_radio_actions() method is a convenience method that creates a
|
|
422
|
-
number of gtk.RadioAction objects based on the information in the list
|
|
423
|
-
of action entry tuples contained in entries and adds them to the action
|
|
424
|
-
group. The entry tuples can vary in size from one to six items with the
|
|
425
|
-
following information:
|
|
426
|
-
|
|
427
|
-
* The name of the action. Must be specified.
|
|
428
|
-
* The stock id for the action. Optional with a default value of None
|
|
429
|
-
if a label is specified.
|
|
430
|
-
* The label for the action. This field should typically be marked
|
|
431
|
-
for translation, see the set_translation_domain() method. Optional
|
|
432
|
-
with a default value of None if a stock id is specified.
|
|
433
|
-
* The accelerator for the action, in the format understood by the
|
|
434
|
-
gtk.accelerator_parse() function. Optional with a default value of
|
|
435
|
-
None.
|
|
436
|
-
* The tooltip for the action. This field should typically be marked
|
|
437
|
-
for translation, see the set_translation_domain() method. Optional
|
|
438
|
-
with a default value of None.
|
|
439
|
-
* The value to set on the radio action. Optional with a default
|
|
440
|
-
value of 0. Should be specified in applications.
|
|
441
|
-
|
|
442
|
-
The value parameter specifies the radio action that should be set
|
|
443
|
-
active. The "changed" signal of the first radio action is connected to
|
|
444
|
-
the on_change callback (if specified and not None) and the accel paths
|
|
445
|
-
of the actions are set to <Actions>/group-name/action-name.
|
|
446
|
-
"""
|
|
447
|
-
try:
|
|
448
|
-
iter(entries)
|
|
449
|
-
except (TypeError):
|
|
450
|
-
raise TypeError('entries must be iterable')
|
|
451
|
-
|
|
452
|
-
first_action = None
|
|
453
|
-
|
|
454
|
-
def _process_action(group_source, name, stock_id=None, label=None, accelerator=None, tooltip=None, entry_value=0):
|
|
455
|
-
action = RadioAction(name=name, label=label, tooltip=tooltip, stock_id=stock_id, value=entry_value)
|
|
456
|
-
|
|
457
|
-
# FIXME: join_group is a patch to Gtk+ 3.0
|
|
458
|
-
# otherwise we can't effectively add radio actions to a
|
|
459
|
-
# group. Should we depend on 3.0 and error out here
|
|
460
|
-
# or should we offer the functionality via a compat
|
|
461
|
-
# C module?
|
|
462
|
-
if hasattr(action, 'join_group'):
|
|
463
|
-
action.join_group(group_source)
|
|
464
|
-
|
|
465
|
-
if value == entry_value:
|
|
466
|
-
action.set_active(True)
|
|
467
|
-
|
|
468
|
-
self.add_action_with_accel(action, accelerator)
|
|
469
|
-
return action
|
|
470
|
-
|
|
471
|
-
for e in entries:
|
|
472
|
-
# using inner function above since entries can leave out optional arguments
|
|
473
|
-
action = _process_action(first_action, *e)
|
|
474
|
-
if first_action is None:
|
|
475
|
-
first_action = action
|
|
476
|
-
|
|
477
|
-
if first_action is not None and on_change is not None:
|
|
478
|
-
if user_data is None:
|
|
479
|
-
first_action.connect('changed', on_change)
|
|
480
|
-
else:
|
|
481
|
-
first_action.connect('changed', on_change, user_data)
|
|
482
|
-
|
|
483
|
-
ActionGroup = override(ActionGroup)
|
|
484
|
-
__all__.append('ActionGroup')
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
class UIManager(Gtk.UIManager):
|
|
488
|
-
def add_ui_from_string(self, buffer, length=-1):
|
|
489
|
-
"""add_ui_from_string(buffer, length=-1)
|
|
490
|
-
|
|
491
|
-
{{ all }}
|
|
492
|
-
"""
|
|
493
|
-
|
|
494
|
-
return Gtk.UIManager.add_ui_from_string(self, buffer, length)
|
|
495
|
-
|
|
496
|
-
def insert_action_group(self, action_group, pos=-1):
|
|
497
|
-
return Gtk.UIManager.insert_action_group(self, action_group, pos)
|
|
498
|
-
|
|
499
|
-
UIManager = override(UIManager)
|
|
500
|
-
__all__.append('UIManager')
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
class ComboBox(Gtk.ComboBox, Container):
|
|
504
|
-
get_active_iter = strip_boolean_result(Gtk.ComboBox.get_active_iter)
|
|
505
|
-
"""
|
|
506
|
-
:returns: a :obj:`Gtk.TreeIter` or :obj:`None` if there is no active item
|
|
507
|
-
:rtype: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
508
|
-
|
|
509
|
-
Returns the `iter` for the current active item, if it exists.
|
|
510
|
-
"""
|
|
511
|
-
|
|
512
|
-
ComboBox = override(ComboBox)
|
|
513
|
-
__all__.append('ComboBox')
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
class Box(Gtk.Box):
|
|
517
|
-
__init__ = deprecated_init(Gtk.Box.__init__,
|
|
518
|
-
arg_names=('homogeneous', 'spacing'),
|
|
519
|
-
category=PyGTKDeprecationWarning)
|
|
520
|
-
|
|
521
|
-
Box = override(Box)
|
|
522
|
-
__all__.append('Box')
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
class SizeGroup(Gtk.SizeGroup):
|
|
526
|
-
__init__ = deprecated_init(Gtk.SizeGroup.__init__,
|
|
527
|
-
arg_names=('mode',),
|
|
528
|
-
deprecated_defaults={'mode': Gtk.SizeGroupMode.VERTICAL},
|
|
529
|
-
category=PyGTKDeprecationWarning)
|
|
530
|
-
|
|
531
|
-
SizeGroup = override(SizeGroup)
|
|
532
|
-
__all__.append('SizeGroup')
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
class MenuItem(Gtk.MenuItem):
|
|
536
|
-
__init__ = deprecated_init(Gtk.MenuItem.__init__,
|
|
537
|
-
arg_names=('label',),
|
|
538
|
-
category=PyGTKDeprecationWarning)
|
|
539
|
-
|
|
540
|
-
MenuItem = override(MenuItem)
|
|
541
|
-
__all__.append('MenuItem')
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
class Builder(Gtk.Builder):
|
|
545
|
-
def connect_signals(self, obj_or_map):
|
|
546
|
-
"""connect_signals(self, obj_or_map)
|
|
547
|
-
|
|
548
|
-
Connect signals specified by this builder to a name, handler mapping.
|
|
549
|
-
|
|
550
|
-
Connect signal, name, and handler sets specified in the builder with
|
|
551
|
-
the given mapping "obj_or_map". The handler/value aspect of the mapping
|
|
552
|
-
can also contain a tuple in the form of (handler [,arg1 [,argN]])
|
|
553
|
-
allowing for extra arguments to be passed to the handler. For example:
|
|
554
|
-
|
|
555
|
-
.. code-block:: python
|
|
556
|
-
|
|
557
|
-
builder.connect_signals({'on_clicked': (on_clicked, arg1, arg2)})
|
|
558
|
-
"""
|
|
559
|
-
self.connect_signals_full(_builder_connect_callback, obj_or_map)
|
|
560
|
-
|
|
561
|
-
def add_from_string(self, buffer, length=-1):
|
|
562
|
-
"""add_from_string(buffer, length=-1)
|
|
563
|
-
|
|
564
|
-
{{ all }}
|
|
565
|
-
"""
|
|
566
|
-
|
|
567
|
-
return Gtk.Builder.add_from_string(self, buffer, length)
|
|
568
|
-
|
|
569
|
-
def add_objects_from_string(self, buffer, object_ids):
|
|
570
|
-
"""add_objects_from_string(buffer, object_ids)
|
|
571
|
-
|
|
572
|
-
:param buffer: the string to parse
|
|
573
|
-
:type buffer: :obj:`str`
|
|
574
|
-
:param object_ids: array of objects to build
|
|
575
|
-
:type object_ids: [:obj:`str`]
|
|
576
|
-
|
|
577
|
-
:raises: :class:`GLib.Error`
|
|
578
|
-
|
|
579
|
-
:returns: A positive value on success, 0 if an error occurred
|
|
580
|
-
:rtype: :obj:`int`
|
|
581
|
-
|
|
582
|
-
{{ docs }}
|
|
583
|
-
"""
|
|
584
|
-
|
|
585
|
-
length = -1
|
|
586
|
-
return Gtk.Builder.add_objects_from_string(self, buffer, length, object_ids)
|
|
587
|
-
|
|
588
|
-
Builder = override(Builder)
|
|
589
|
-
__all__.append('Builder')
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
# NOTE: This must come before any other Window/Dialog subclassing, to ensure
|
|
593
|
-
# that we have a correct inheritance hierarchy.
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
class Window(Gtk.Window):
|
|
597
|
-
__init__ = deprecated_init(Gtk.Window.__init__,
|
|
598
|
-
arg_names=('type',),
|
|
599
|
-
category=PyGTKDeprecationWarning)
|
|
600
|
-
|
|
601
|
-
Window = override(Window)
|
|
602
|
-
__all__.append('Window')
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
class Dialog(Gtk.Dialog, Container):
|
|
606
|
-
_old_arg_names = ('title', 'parent', 'flags', 'buttons', '_buttons_property')
|
|
607
|
-
_init = deprecated_init(Gtk.Dialog.__init__,
|
|
608
|
-
arg_names=('title', 'transient_for', 'flags',
|
|
609
|
-
'add_buttons', 'buttons'),
|
|
610
|
-
ignore=('flags', 'add_buttons'),
|
|
611
|
-
deprecated_aliases={'transient_for': 'parent',
|
|
612
|
-
'buttons': '_buttons_property'},
|
|
613
|
-
category=PyGTKDeprecationWarning)
|
|
614
|
-
|
|
615
|
-
def __init__(self, *args, **kwargs):
|
|
616
|
-
|
|
617
|
-
new_kwargs = kwargs.copy()
|
|
618
|
-
old_kwargs = dict(zip(self._old_arg_names, args))
|
|
619
|
-
old_kwargs.update(kwargs)
|
|
620
|
-
|
|
621
|
-
# Increment the warning stacklevel for sub-classes which implement their own __init__.
|
|
622
|
-
stacklevel = 2
|
|
623
|
-
if self.__class__ != Dialog and self.__class__.__init__ != Dialog.__init__:
|
|
624
|
-
stacklevel += 1
|
|
625
|
-
|
|
626
|
-
# buttons was overloaded by PyGtk but is needed for Gtk.MessageDialog
|
|
627
|
-
# as a pass through, so type check the argument and give a deprecation
|
|
628
|
-
# when it is not of type Gtk.ButtonsType
|
|
629
|
-
add_buttons = old_kwargs.get('buttons', None)
|
|
630
|
-
if add_buttons is not None and not isinstance(add_buttons, Gtk.ButtonsType):
|
|
631
|
-
warnings.warn('The "buttons" argument must be a Gtk.ButtonsType enum value. '
|
|
632
|
-
'Please use the "add_buttons" method for adding buttons. '
|
|
633
|
-
'See: https://wiki.gnome.org/PyGObject/InitializerDeprecations',
|
|
634
|
-
PyGTKDeprecationWarning, stacklevel=stacklevel)
|
|
635
|
-
if 'buttons' in new_kwargs:
|
|
636
|
-
del new_kwargs['buttons']
|
|
637
|
-
else:
|
|
638
|
-
add_buttons = None
|
|
639
|
-
|
|
640
|
-
flags = old_kwargs.get('flags', 0)
|
|
641
|
-
if flags:
|
|
642
|
-
warnings.warn('The "flags" argument for dialog construction is deprecated. '
|
|
643
|
-
'Please use initializer keywords: modal=True and/or destroy_with_parent=True. '
|
|
644
|
-
'See: https://wiki.gnome.org/PyGObject/InitializerDeprecations',
|
|
645
|
-
PyGTKDeprecationWarning, stacklevel=stacklevel)
|
|
646
|
-
|
|
647
|
-
if flags & Gtk.DialogFlags.MODAL:
|
|
648
|
-
new_kwargs['modal'] = True
|
|
649
|
-
|
|
650
|
-
if flags & Gtk.DialogFlags.DESTROY_WITH_PARENT:
|
|
651
|
-
new_kwargs['destroy_with_parent'] = True
|
|
652
|
-
|
|
653
|
-
self._init(*args, **new_kwargs)
|
|
654
|
-
|
|
655
|
-
if add_buttons:
|
|
656
|
-
self.add_buttons(*add_buttons)
|
|
657
|
-
|
|
658
|
-
action_area = property(lambda dialog: dialog.get_action_area())
|
|
659
|
-
vbox = property(lambda dialog: dialog.get_content_area())
|
|
660
|
-
|
|
661
|
-
def add_buttons(self, *args):
|
|
662
|
-
"""add_buttons(*args)
|
|
663
|
-
|
|
664
|
-
The add_buttons() method adds several buttons to the Gtk.Dialog using
|
|
665
|
-
the button data passed as arguments to the method. This method is the
|
|
666
|
-
same as calling the Gtk.Dialog.add_button() repeatedly. The button data
|
|
667
|
-
pairs - button text (or stock ID) and a response ID integer are passed
|
|
668
|
-
individually. For example:
|
|
669
|
-
|
|
670
|
-
.. code-block:: python
|
|
671
|
-
|
|
672
|
-
dialog.add_buttons(Gtk.STOCK_OPEN, 42, "Close", Gtk.ResponseType.CLOSE)
|
|
673
|
-
|
|
674
|
-
will add "Open" and "Close" buttons to dialog.
|
|
675
|
-
"""
|
|
676
|
-
def _button(b):
|
|
677
|
-
while b:
|
|
678
|
-
t, r = b[0:2]
|
|
679
|
-
b = b[2:]
|
|
680
|
-
yield t, r
|
|
681
|
-
|
|
682
|
-
try:
|
|
683
|
-
for text, response in _button(args):
|
|
684
|
-
self.add_button(text, response)
|
|
685
|
-
except (IndexError):
|
|
686
|
-
raise TypeError('Must pass an even number of arguments')
|
|
687
|
-
|
|
688
|
-
Dialog = override(Dialog)
|
|
689
|
-
__all__.append('Dialog')
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
class MessageDialog(Gtk.MessageDialog, Dialog):
|
|
693
|
-
__init__ = deprecated_init(Gtk.MessageDialog.__init__,
|
|
694
|
-
arg_names=('parent', 'flags', 'message_type',
|
|
695
|
-
'buttons', 'message_format'),
|
|
696
|
-
deprecated_aliases={'text': 'message_format',
|
|
697
|
-
'message_type': 'type'},
|
|
698
|
-
category=PyGTKDeprecationWarning)
|
|
699
|
-
|
|
700
|
-
def format_secondary_text(self, message_format):
|
|
701
|
-
self.set_property('secondary-use-markup', False)
|
|
702
|
-
self.set_property('secondary-text', message_format)
|
|
703
|
-
|
|
704
|
-
def format_secondary_markup(self, message_format):
|
|
705
|
-
self.set_property('secondary-use-markup', True)
|
|
706
|
-
self.set_property('secondary-text', message_format)
|
|
707
|
-
|
|
708
|
-
MessageDialog = override(MessageDialog)
|
|
709
|
-
__all__.append('MessageDialog')
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
class ColorSelectionDialog(Gtk.ColorSelectionDialog):
|
|
713
|
-
__init__ = deprecated_init(Gtk.ColorSelectionDialog.__init__,
|
|
714
|
-
arg_names=('title',),
|
|
715
|
-
category=PyGTKDeprecationWarning)
|
|
716
|
-
|
|
717
|
-
ColorSelectionDialog = override(ColorSelectionDialog)
|
|
718
|
-
__all__.append('ColorSelectionDialog')
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
class FileChooserDialog(Gtk.FileChooserDialog):
|
|
722
|
-
__init__ = deprecated_init(Gtk.FileChooserDialog.__init__,
|
|
723
|
-
arg_names=('title', 'parent', 'action', 'buttons'),
|
|
724
|
-
category=PyGTKDeprecationWarning)
|
|
725
|
-
|
|
726
|
-
FileChooserDialog = override(FileChooserDialog)
|
|
727
|
-
__all__.append('FileChooserDialog')
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
class FontSelectionDialog(Gtk.FontSelectionDialog):
|
|
731
|
-
__init__ = deprecated_init(Gtk.FontSelectionDialog.__init__,
|
|
732
|
-
arg_names=('title',),
|
|
733
|
-
category=PyGTKDeprecationWarning)
|
|
734
|
-
|
|
735
|
-
FontSelectionDialog = override(FontSelectionDialog)
|
|
736
|
-
__all__.append('FontSelectionDialog')
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
class RecentChooserDialog(Gtk.RecentChooserDialog):
|
|
740
|
-
# Note, the "manager" keyword must work across the entire 3.x series because
|
|
741
|
-
# "recent_manager" is not backwards compatible with PyGObject versions prior to 3.10.
|
|
742
|
-
__init__ = deprecated_init(Gtk.RecentChooserDialog.__init__,
|
|
743
|
-
arg_names=('title', 'parent', 'recent_manager', 'buttons'),
|
|
744
|
-
deprecated_aliases={'recent_manager': 'manager'},
|
|
745
|
-
category=PyGTKDeprecationWarning)
|
|
746
|
-
|
|
747
|
-
RecentChooserDialog = override(RecentChooserDialog)
|
|
748
|
-
__all__.append('RecentChooserDialog')
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
class IconView(Gtk.IconView):
|
|
752
|
-
__init__ = deprecated_init(Gtk.IconView.__init__,
|
|
753
|
-
arg_names=('model',),
|
|
754
|
-
category=PyGTKDeprecationWarning)
|
|
755
|
-
|
|
756
|
-
get_item_at_pos = strip_boolean_result(Gtk.IconView.get_item_at_pos)
|
|
757
|
-
"""
|
|
758
|
-
:param x: The x position to be identified
|
|
759
|
-
:type x: :obj:`int`
|
|
760
|
-
|
|
761
|
-
:param y: The y position to be identified
|
|
762
|
-
:type y: :obj:`int`
|
|
763
|
-
|
|
764
|
-
:returns:
|
|
765
|
-
If not item exists at the specified position returns :obj:`None`,
|
|
766
|
-
otherwise a tuple containing:
|
|
767
|
-
|
|
768
|
-
:path: The path
|
|
769
|
-
:cell: The renderer responsible for the cell at (`x`, `y`)
|
|
770
|
-
|
|
771
|
-
:rtype: (**path**: :obj:`Gtk.TreePath`, **cell**: :obj:`Gtk.CellRenderer`) or :obj:`None`
|
|
772
|
-
|
|
773
|
-
{{ docs }}
|
|
774
|
-
"""
|
|
775
|
-
|
|
776
|
-
get_visible_range = strip_boolean_result(Gtk.IconView.get_visible_range)
|
|
777
|
-
"""
|
|
778
|
-
:returns:
|
|
779
|
-
Returns :obj:`None` if there is no visible range or a tuple
|
|
780
|
-
containing:
|
|
781
|
-
|
|
782
|
-
:start_path: Start of region
|
|
783
|
-
:end_path: End of region
|
|
784
|
-
|
|
785
|
-
:rtype: (**start_path**: :obj:`Gtk.TreePath`, **end_path**: :obj:`Gtk.TreePath`) or :obj:`None`
|
|
786
|
-
|
|
787
|
-
{{ docs }}
|
|
788
|
-
"""
|
|
789
|
-
|
|
790
|
-
get_dest_item_at_pos = strip_boolean_result(Gtk.IconView.get_dest_item_at_pos)
|
|
791
|
-
"""
|
|
792
|
-
:param drag_x:
|
|
793
|
-
the position to determine the destination item for
|
|
794
|
-
:type drag_x: :obj:`int`
|
|
795
|
-
|
|
796
|
-
:param drag_y:
|
|
797
|
-
the position to determine the destination item for
|
|
798
|
-
:type drag_y: :obj:`int`
|
|
799
|
-
|
|
800
|
-
:returns:
|
|
801
|
-
If there is no item at the given position return :obj:`None` otherwise
|
|
802
|
-
a tuple containing:
|
|
803
|
-
|
|
804
|
-
:path: The path of the item
|
|
805
|
-
:pos: The drop position
|
|
806
|
-
|
|
807
|
-
:rtype: (**path**: :obj:`Gtk.TreePath`, **pos**: :obj:`Gtk.IconViewDropPosition`) or :obj:`None`
|
|
808
|
-
|
|
809
|
-
{{ docs }}
|
|
810
|
-
"""
|
|
811
|
-
|
|
812
|
-
IconView = override(IconView)
|
|
813
|
-
__all__.append('IconView')
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
class ToolButton(Gtk.ToolButton):
|
|
817
|
-
__init__ = deprecated_init(Gtk.ToolButton.__init__,
|
|
818
|
-
arg_names=('stock_id',),
|
|
819
|
-
category=PyGTKDeprecationWarning)
|
|
820
|
-
|
|
821
|
-
ToolButton = override(ToolButton)
|
|
822
|
-
__all__.append('ToolButton')
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
class IMContext(Gtk.IMContext):
|
|
826
|
-
get_surrounding = strip_boolean_result(Gtk.IMContext.get_surrounding)
|
|
827
|
-
"""
|
|
828
|
-
:returns:
|
|
829
|
-
:obj:`None` if no surrounding text was provided; otherwise a tuple
|
|
830
|
-
containing:
|
|
831
|
-
|
|
832
|
-
:text: text holding context around the insertion point.
|
|
833
|
-
:cursor_index: byte index of the insertion cursor within `text`
|
|
834
|
-
|
|
835
|
-
:rtype: (**text**: :obj:`str`, **cursor_index**: :obj:`int`) or :obj:`None`
|
|
836
|
-
|
|
837
|
-
{{ docs }}
|
|
838
|
-
"""
|
|
839
|
-
|
|
840
|
-
IMContext = override(IMContext)
|
|
841
|
-
__all__.append('IMContext')
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
class RecentInfo(Gtk.RecentInfo):
|
|
845
|
-
get_application_info = strip_boolean_result(Gtk.RecentInfo.get_application_info)
|
|
846
|
-
"""
|
|
847
|
-
:param app_name: the name of the application that has registered this item
|
|
848
|
-
:type app_name: :obj:`str`
|
|
849
|
-
|
|
850
|
-
:returns:
|
|
851
|
-
:obj:`None` if no application with `app_name` has registered this
|
|
852
|
-
resource inside the recently used list otherwise a tuple containing:
|
|
853
|
-
|
|
854
|
-
:app_exec: string containing the command line
|
|
855
|
-
:count: the number of times this item was registered
|
|
856
|
-
:time_: the timestamp this item was last registered for this application
|
|
857
|
-
|
|
858
|
-
:rtype: (**app_exec**: :obj:`str`, **count**: :obj:`int`, **time_**: :obj:`int`) or :obj:`None`
|
|
859
|
-
|
|
860
|
-
{{ docs }}
|
|
861
|
-
"""
|
|
862
|
-
|
|
863
|
-
RecentInfo = override(RecentInfo)
|
|
864
|
-
__all__.append('RecentInfo')
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
class TextBuffer(Gtk.TextBuffer):
|
|
868
|
-
def _get_or_create_tag_table(self):
|
|
869
|
-
table = self.get_tag_table()
|
|
870
|
-
if table is None:
|
|
871
|
-
table = Gtk.TextTagTable()
|
|
872
|
-
self.set_tag_table(table)
|
|
873
|
-
|
|
874
|
-
return table
|
|
875
|
-
|
|
876
|
-
def create_tag(self, tag_name=None, **properties):
|
|
877
|
-
"""Creates a tag and adds it to the tag table of the TextBuffer.
|
|
878
|
-
|
|
879
|
-
:param str tag_name:
|
|
880
|
-
Name of the new tag, or None
|
|
881
|
-
:param **properties:
|
|
882
|
-
Keyword list of properties and their values
|
|
883
|
-
:returns:
|
|
884
|
-
A new tag.
|
|
885
|
-
|
|
886
|
-
This is equivalent to creating a Gtk.TextTag and then adding the
|
|
887
|
-
tag to the buffer's tag table. The returned tag is owned by
|
|
888
|
-
the buffer's tag table.
|
|
889
|
-
|
|
890
|
-
If ``tag_name`` is None, the tag is anonymous.
|
|
891
|
-
|
|
892
|
-
If ``tag_name`` is not None, a tag called ``tag_name`` must not already
|
|
893
|
-
exist in the tag table for this buffer.
|
|
894
|
-
|
|
895
|
-
Properties are passed as a keyword list of names and values (e.g.
|
|
896
|
-
foreground='DodgerBlue', weight=Pango.Weight.BOLD)
|
|
897
|
-
"""
|
|
898
|
-
|
|
899
|
-
tag = Gtk.TextTag(name=tag_name, **properties)
|
|
900
|
-
self._get_or_create_tag_table().add(tag)
|
|
901
|
-
return tag
|
|
902
|
-
|
|
903
|
-
def create_mark(self, mark_name, where, left_gravity=False):
|
|
904
|
-
return Gtk.TextBuffer.create_mark(self, mark_name, where, left_gravity)
|
|
905
|
-
|
|
906
|
-
def set_text(self, text, length=-1):
|
|
907
|
-
"""set_text(text, length=-1)
|
|
908
|
-
|
|
909
|
-
{{ all }}
|
|
910
|
-
"""
|
|
911
|
-
|
|
912
|
-
Gtk.TextBuffer.set_text(self, text, length)
|
|
913
|
-
|
|
914
|
-
def insert(self, iter, text, length=-1):
|
|
915
|
-
"""insert(iter, text, length=-1)
|
|
916
|
-
|
|
917
|
-
{{ all }}
|
|
918
|
-
"""
|
|
919
|
-
|
|
920
|
-
Gtk.TextBuffer.insert(self, iter, text, length)
|
|
921
|
-
|
|
922
|
-
def insert_with_tags(self, iter, text, *tags):
|
|
923
|
-
start_offset = iter.get_offset()
|
|
924
|
-
self.insert(iter, text)
|
|
925
|
-
|
|
926
|
-
if not tags:
|
|
927
|
-
return
|
|
928
|
-
|
|
929
|
-
start = self.get_iter_at_offset(start_offset)
|
|
930
|
-
|
|
931
|
-
for tag in tags:
|
|
932
|
-
self.apply_tag(tag, start, iter)
|
|
933
|
-
|
|
934
|
-
def insert_with_tags_by_name(self, iter, text, *tags):
|
|
935
|
-
if not tags:
|
|
936
|
-
return
|
|
937
|
-
|
|
938
|
-
tag_objs = []
|
|
939
|
-
|
|
940
|
-
for tag in tags:
|
|
941
|
-
tag_obj = self.get_tag_table().lookup(tag)
|
|
942
|
-
if not tag_obj:
|
|
943
|
-
raise ValueError('unknown text tag: %s' % tag)
|
|
944
|
-
tag_objs.append(tag_obj)
|
|
945
|
-
|
|
946
|
-
self.insert_with_tags(iter, text, *tag_objs)
|
|
947
|
-
|
|
948
|
-
def insert_at_cursor(self, text, length=-1):
|
|
949
|
-
if not isinstance(text, _basestring):
|
|
950
|
-
raise TypeError('text must be a string, not %s' % type(text))
|
|
951
|
-
|
|
952
|
-
Gtk.TextBuffer.insert_at_cursor(self, text, length)
|
|
953
|
-
|
|
954
|
-
get_selection_bounds = strip_boolean_result(Gtk.TextBuffer.get_selection_bounds, fail_ret=())
|
|
955
|
-
"""
|
|
956
|
-
:returns:
|
|
957
|
-
If there is no selection returns an empty tuple otherwise a tuple
|
|
958
|
-
containing:
|
|
959
|
-
|
|
960
|
-
:start: selection start
|
|
961
|
-
:end: selection end
|
|
962
|
-
|
|
963
|
-
:rtype: (**start**: :obj:`Gtk.TextIter`, **end**: :obj:`Gtk.TextIter`) or :obj:`None`
|
|
964
|
-
|
|
965
|
-
{{ docs }}
|
|
966
|
-
"""
|
|
967
|
-
|
|
968
|
-
TextBuffer = override(TextBuffer)
|
|
969
|
-
__all__.append('TextBuffer')
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
class TextIter(Gtk.TextIter):
|
|
973
|
-
forward_search = strip_boolean_result(Gtk.TextIter.forward_search)
|
|
974
|
-
"""
|
|
975
|
-
:param str: a search string
|
|
976
|
-
:type str: :obj:`str`
|
|
977
|
-
|
|
978
|
-
:param flags: flags affecting how the search is done
|
|
979
|
-
:type flags: :obj:`Gtk.TextSearchFlags`
|
|
980
|
-
|
|
981
|
-
:param limit: location of last possible `match_end`, or :obj:`None` for the end of the buffer
|
|
982
|
-
:type limit: :obj:`Gtk.TextIter` or :obj:`None`
|
|
983
|
-
|
|
984
|
-
:returns:
|
|
985
|
-
If no match was found returns :obj:`None` otherwise a tuple containing:
|
|
986
|
-
|
|
987
|
-
:match_start: start of match
|
|
988
|
-
:match_end: end of match
|
|
989
|
-
|
|
990
|
-
:rtype: (**match\_start**: :obj:`Gtk.TextIter`, **match\_end**: :obj:`Gtk.TextIter`) or :obj:`None`
|
|
991
|
-
|
|
992
|
-
{{ docs }}
|
|
993
|
-
"""
|
|
994
|
-
|
|
995
|
-
backward_search = strip_boolean_result(Gtk.TextIter.backward_search)
|
|
996
|
-
"""
|
|
997
|
-
:param str: search string
|
|
998
|
-
:type str: :obj:`str`
|
|
999
|
-
|
|
1000
|
-
:param flags: bitmask of flags affecting the search
|
|
1001
|
-
:type flags: :obj:`Gtk.TextSearchFlags`
|
|
1002
|
-
|
|
1003
|
-
:param limit: location of last possible `match_start`, or :obj:`None` for start of buffer
|
|
1004
|
-
:type limit: :obj:`Gtk.TextIter` or :obj:`None`
|
|
1005
|
-
|
|
1006
|
-
:returns:
|
|
1007
|
-
:obj:`None` if not match was found otherwise a tuple containing:
|
|
1008
|
-
|
|
1009
|
-
:match_start: start of match
|
|
1010
|
-
:match_end: end of match
|
|
1011
|
-
|
|
1012
|
-
:rtype: (**match_start**: :obj:`Gtk.TextIter`, **match_end**: :obj:`Gtk.TextIter`) or :obj:`None`
|
|
1013
|
-
|
|
1014
|
-
{{ docs }}
|
|
1015
|
-
"""
|
|
1016
|
-
|
|
1017
|
-
TextIter = override(TextIter)
|
|
1018
|
-
__all__.append('TextIter')
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
class TreeModel(Gtk.TreeModel):
|
|
1022
|
-
"""
|
|
1023
|
-
.. note::
|
|
1024
|
-
|
|
1025
|
-
Implements ``__len__``, ``__bool__``, ``__nonzero__``, ``__iter__``,
|
|
1026
|
-
``__getitem__``, ``__setitem__`` and ``__delitem__``.
|
|
1027
|
-
|
|
1028
|
-
Iterating over a :obj:`Gtk.TreeModel` yields
|
|
1029
|
-
:obj:`Gtk.TreeModelRow` instances.
|
|
1030
|
-
|
|
1031
|
-
``__getitem__`` returns a :obj:`Gtk.TreeModelRow`.
|
|
1032
|
-
|
|
1033
|
-
{{ all }}
|
|
1034
|
-
"""
|
|
1035
|
-
|
|
1036
|
-
def __len__(self):
|
|
1037
|
-
return self.iter_n_children(None)
|
|
1038
|
-
|
|
1039
|
-
def __bool__(self):
|
|
1040
|
-
return True
|
|
1041
|
-
|
|
1042
|
-
# alias for Python 2.x object protocol
|
|
1043
|
-
__nonzero__ = __bool__
|
|
1044
|
-
|
|
1045
|
-
def _getiter(self, key):
|
|
1046
|
-
if isinstance(key, Gtk.TreeIter):
|
|
1047
|
-
return key
|
|
1048
|
-
elif isinstance(key, int) and key < 0:
|
|
1049
|
-
index = len(self) + key
|
|
1050
|
-
if index < 0:
|
|
1051
|
-
raise IndexError("row index is out of bounds: %d" % key)
|
|
1052
|
-
try:
|
|
1053
|
-
aiter = self.get_iter(index)
|
|
1054
|
-
except ValueError:
|
|
1055
|
-
raise IndexError("could not find tree path '%s'" % key)
|
|
1056
|
-
return aiter
|
|
1057
|
-
else:
|
|
1058
|
-
try:
|
|
1059
|
-
aiter = self.get_iter(key)
|
|
1060
|
-
except ValueError:
|
|
1061
|
-
raise IndexError("could not find tree path '%s'" % key)
|
|
1062
|
-
return aiter
|
|
1063
|
-
|
|
1064
|
-
def _coerce_path(self, path):
|
|
1065
|
-
if isinstance(path, Gtk.TreePath):
|
|
1066
|
-
return path
|
|
1067
|
-
else:
|
|
1068
|
-
return TreePath(path)
|
|
1069
|
-
|
|
1070
|
-
def __getitem__(self, key):
|
|
1071
|
-
aiter = self._getiter(key)
|
|
1072
|
-
return TreeModelRow(self, aiter)
|
|
1073
|
-
|
|
1074
|
-
def __setitem__(self, key, value):
|
|
1075
|
-
row = self[key]
|
|
1076
|
-
self.set_row(row.iter, value)
|
|
1077
|
-
|
|
1078
|
-
def __delitem__(self, key):
|
|
1079
|
-
aiter = self._getiter(key)
|
|
1080
|
-
self.remove(aiter)
|
|
1081
|
-
|
|
1082
|
-
def __iter__(self):
|
|
1083
|
-
return TreeModelRowIter(self, self.get_iter_first())
|
|
1084
|
-
|
|
1085
|
-
get_iter_first = strip_boolean_result(Gtk.TreeModel.get_iter_first)
|
|
1086
|
-
"""
|
|
1087
|
-
:returns: :obj:`Gtk.TreeIter` or :obj:`None` if the tree is empty.
|
|
1088
|
-
:rtype: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1089
|
-
|
|
1090
|
-
{{ docs }}
|
|
1091
|
-
"""
|
|
1092
|
-
|
|
1093
|
-
iter_children = strip_boolean_result(Gtk.TreeModel.iter_children)
|
|
1094
|
-
"""
|
|
1095
|
-
:param parent: the :obj:`Gtk.TreeIter`-struct, or :obj:`None`
|
|
1096
|
-
:type parent: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1097
|
-
|
|
1098
|
-
:returns: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1099
|
-
:rtype: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1100
|
-
|
|
1101
|
-
Sets `iter` to point to the first child of `parent`.
|
|
1102
|
-
If `parent` has no children, :obj:`None` is returned.
|
|
1103
|
-
If `parent` is :obj:`None` returns the first node, equivalent to
|
|
1104
|
-
``Gtk.TreeModel.iter_first()``.
|
|
1105
|
-
"""
|
|
1106
|
-
|
|
1107
|
-
iter_nth_child = strip_boolean_result(Gtk.TreeModel.iter_nth_child)
|
|
1108
|
-
"""
|
|
1109
|
-
:param parent: the :obj:`Gtk.TreeIter`-struct to get the child from, or :obj:`None`.
|
|
1110
|
-
:type parent: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1111
|
-
|
|
1112
|
-
:param n: the index of the desired child
|
|
1113
|
-
:type n: :obj:`int`
|
|
1114
|
-
|
|
1115
|
-
:returns: :obj:`Gtk.TreeIter` if `parent` has an `n`-th child otherwise :obj:`None`
|
|
1116
|
-
:rtype: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1117
|
-
|
|
1118
|
-
Returns child `iter` of `parent`, using the given index.
|
|
1119
|
-
|
|
1120
|
-
The first index is 0. If `n` is too big, or `parent` has no children,
|
|
1121
|
-
:obj:`None` is returned. `parent` will remain a valid node after this
|
|
1122
|
-
function has been called. As a special case, if `parent` is :obj:`None`,
|
|
1123
|
-
then the `n`-th root node is set.
|
|
1124
|
-
"""
|
|
1125
|
-
|
|
1126
|
-
iter_parent = strip_boolean_result(Gtk.TreeModel.iter_parent)
|
|
1127
|
-
"""
|
|
1128
|
-
:param child: the :obj:`Gtk.TreeIter`-struct
|
|
1129
|
-
:type child: :obj:`Gtk.TreeIter`
|
|
1130
|
-
|
|
1131
|
-
:returns: :obj:`Gtk.TreeIter` or :obj:`None` if `child` has a parent.
|
|
1132
|
-
:rtype: :obj:`Gtk.TreeIter` or :obj`None`
|
|
1133
|
-
|
|
1134
|
-
Returns iter of the parent of `child`.
|
|
1135
|
-
|
|
1136
|
-
If `child` is at the toplevel, and doesn't have a parent, then :obj:`None`
|
|
1137
|
-
is returned. `child` will remain a valid node after this function has been
|
|
1138
|
-
called.
|
|
1139
|
-
"""
|
|
1140
|
-
|
|
1141
|
-
get_iter_from_string = strip_boolean_result(Gtk.TreeModel.get_iter_from_string,
|
|
1142
|
-
ValueError, 'invalid tree path')
|
|
1143
|
-
"""
|
|
1144
|
-
:param path_string: a string representation of a :obj:`Gtk.TreePath`-struct
|
|
1145
|
-
:type path_string: :obj:`str`
|
|
1146
|
-
|
|
1147
|
-
:raises: :class:`ValueError` if an iterator pointing to `path_string` does not exist.
|
|
1148
|
-
:returns: a :obj:`Gtk.TreeIter`
|
|
1149
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1150
|
-
|
|
1151
|
-
Returns a valid iterator pointing to `path_string`, if it
|
|
1152
|
-
exists. Otherwise raises :class:`ValueError`
|
|
1153
|
-
"""
|
|
1154
|
-
|
|
1155
|
-
def get_iter(self, path):
|
|
1156
|
-
"""
|
|
1157
|
-
:param path: the :obj:`Gtk.TreePath`-struct
|
|
1158
|
-
:type path: :obj:`Gtk.TreePath`
|
|
1159
|
-
|
|
1160
|
-
:raises: :class:`ValueError` if `path` doesn't exist
|
|
1161
|
-
:returns: a :obj:`Gtk.TreeIter`
|
|
1162
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1163
|
-
|
|
1164
|
-
Returns an iterator pointing to `path`. If `path` does not exist
|
|
1165
|
-
:class:`ValueError` is raised.
|
|
1166
|
-
"""
|
|
1167
|
-
|
|
1168
|
-
path = self._coerce_path(path)
|
|
1169
|
-
success, aiter = super(TreeModel, self).get_iter(path)
|
|
1170
|
-
if not success:
|
|
1171
|
-
raise ValueError("invalid tree path '%s'" % path)
|
|
1172
|
-
return aiter
|
|
1173
|
-
|
|
1174
|
-
def iter_next(self, iter):
|
|
1175
|
-
"""
|
|
1176
|
-
:param iter: the :obj:`Gtk.TreeIter`-struct
|
|
1177
|
-
:type iter: :obj:`Gtk.TreeIter`
|
|
1178
|
-
|
|
1179
|
-
:returns: a :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1180
|
-
:rtype: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1181
|
-
|
|
1182
|
-
Returns an iterator pointing to the node following `iter` at the
|
|
1183
|
-
current level.
|
|
1184
|
-
|
|
1185
|
-
If there is no next `iter`, :obj:`None` is returned.
|
|
1186
|
-
"""
|
|
1187
|
-
|
|
1188
|
-
next_iter = iter.copy()
|
|
1189
|
-
success = super(TreeModel, self).iter_next(next_iter)
|
|
1190
|
-
if success:
|
|
1191
|
-
return next_iter
|
|
1192
|
-
|
|
1193
|
-
def iter_previous(self, iter):
|
|
1194
|
-
"""
|
|
1195
|
-
:param iter: the :obj:`Gtk.TreeIter`-struct
|
|
1196
|
-
:type iter: :obj:`Gtk.TreeIter`
|
|
1197
|
-
|
|
1198
|
-
:returns: a :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1199
|
-
:rtype: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1200
|
-
|
|
1201
|
-
Returns an iterator pointing to the previous node at the current level.
|
|
1202
|
-
|
|
1203
|
-
If there is no previous `iter`, :obj:`None` is returned.
|
|
1204
|
-
"""
|
|
1205
|
-
|
|
1206
|
-
prev_iter = iter.copy()
|
|
1207
|
-
success = super(TreeModel, self).iter_previous(prev_iter)
|
|
1208
|
-
if success:
|
|
1209
|
-
return prev_iter
|
|
1210
|
-
|
|
1211
|
-
def _convert_row(self, row):
|
|
1212
|
-
# TODO: Accept a dictionary for row
|
|
1213
|
-
# model.append(None,{COLUMN_ICON: icon, COLUMN_NAME: name})
|
|
1214
|
-
if isinstance(row, str):
|
|
1215
|
-
raise TypeError('Expected a list or tuple, but got str')
|
|
1216
|
-
|
|
1217
|
-
n_columns = self.get_n_columns()
|
|
1218
|
-
if len(row) != n_columns:
|
|
1219
|
-
raise ValueError('row sequence has the incorrect number of elements')
|
|
1220
|
-
|
|
1221
|
-
result = []
|
|
1222
|
-
columns = []
|
|
1223
|
-
for cur_col, value in enumerate(row):
|
|
1224
|
-
# do not try to set None values, they are causing warnings
|
|
1225
|
-
if value is None:
|
|
1226
|
-
continue
|
|
1227
|
-
result.append(self._convert_value(cur_col, value))
|
|
1228
|
-
columns.append(cur_col)
|
|
1229
|
-
return (result, columns)
|
|
1230
|
-
|
|
1231
|
-
def set_row(self, treeiter, row):
|
|
1232
|
-
"""
|
|
1233
|
-
:param treeiter: the :obj:`Gtk.TreeIter`
|
|
1234
|
-
:type treeiter: :obj:`Gtk.TreeIter`
|
|
1235
|
-
|
|
1236
|
-
:param row: a list of values for each column
|
|
1237
|
-
:type row: [:obj:`object`]
|
|
1238
|
-
|
|
1239
|
-
Sets all values of a row pointed to by `treeiter` from a list of
|
|
1240
|
-
values passes as `row`. The length of the row has to match the number
|
|
1241
|
-
of columns of the model. :obj:`None` in `row` means the value will be
|
|
1242
|
-
skipped and not set.
|
|
1243
|
-
|
|
1244
|
-
Also see :obj:`Gtk.ListStore.set_value`\() and
|
|
1245
|
-
:obj:`Gtk.TreeStore.set_value`\()
|
|
1246
|
-
"""
|
|
1247
|
-
|
|
1248
|
-
converted_row, columns = self._convert_row(row)
|
|
1249
|
-
for column in columns:
|
|
1250
|
-
value = row[column]
|
|
1251
|
-
if value is None:
|
|
1252
|
-
continue # None means skip this row
|
|
1253
|
-
|
|
1254
|
-
self.set_value(treeiter, column, value)
|
|
1255
|
-
|
|
1256
|
-
def _convert_value(self, column, value):
|
|
1257
|
-
'''Convert value to a GObject.Value of the expected type'''
|
|
1258
|
-
|
|
1259
|
-
if isinstance(value, GObject.Value):
|
|
1260
|
-
return value
|
|
1261
|
-
return GObject.Value(self.get_column_type(column), value)
|
|
1262
|
-
|
|
1263
|
-
def get(self, treeiter, *columns):
|
|
1264
|
-
"""
|
|
1265
|
-
:param treeiter: the :obj:`Gtk.TreeIter`
|
|
1266
|
-
:type treeiter: :obj:`Gtk.TreeIter`
|
|
1267
|
-
|
|
1268
|
-
:param \\*columns: a list of column indices to fetch
|
|
1269
|
-
:type columns: (:obj:`int`)
|
|
1270
|
-
|
|
1271
|
-
Returns a tuple of all values specified by their indices in `columns`
|
|
1272
|
-
in the order the indices are contained in `columns`
|
|
1273
|
-
|
|
1274
|
-
Also see :obj:`Gtk.TreeStore.get_value`\()
|
|
1275
|
-
"""
|
|
1276
|
-
|
|
1277
|
-
n_columns = self.get_n_columns()
|
|
1278
|
-
|
|
1279
|
-
values = []
|
|
1280
|
-
for col in columns:
|
|
1281
|
-
if not isinstance(col, int):
|
|
1282
|
-
raise TypeError("column numbers must be ints")
|
|
1283
|
-
|
|
1284
|
-
if col < 0 or col >= n_columns:
|
|
1285
|
-
raise ValueError("column number is out of range")
|
|
1286
|
-
|
|
1287
|
-
values.append(self.get_value(treeiter, col))
|
|
1288
|
-
|
|
1289
|
-
return tuple(values)
|
|
1290
|
-
|
|
1291
|
-
#
|
|
1292
|
-
# Signals supporting python iterables as tree paths
|
|
1293
|
-
#
|
|
1294
|
-
def row_changed(self, path, iter):
|
|
1295
|
-
return super(TreeModel, self).row_changed(self._coerce_path(path), iter)
|
|
1296
|
-
|
|
1297
|
-
def row_inserted(self, path, iter):
|
|
1298
|
-
return super(TreeModel, self).row_inserted(self._coerce_path(path), iter)
|
|
1299
|
-
|
|
1300
|
-
def row_has_child_toggled(self, path, iter):
|
|
1301
|
-
return super(TreeModel, self).row_has_child_toggled(self._coerce_path(path),
|
|
1302
|
-
iter)
|
|
1303
|
-
|
|
1304
|
-
def row_deleted(self, path):
|
|
1305
|
-
return super(TreeModel, self).row_deleted(self._coerce_path(path))
|
|
1306
|
-
|
|
1307
|
-
def rows_reordered(self, path, iter, new_order):
|
|
1308
|
-
return super(TreeModel, self).rows_reordered(self._coerce_path(path),
|
|
1309
|
-
iter, new_order)
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
TreeModel = override(TreeModel)
|
|
1313
|
-
__all__.append('TreeModel')
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
class TreeSortable(Gtk.TreeSortable, ):
|
|
1317
|
-
|
|
1318
|
-
get_sort_column_id = strip_boolean_result(Gtk.TreeSortable.get_sort_column_id, fail_ret=(None, None))
|
|
1319
|
-
"""
|
|
1320
|
-
:returns:
|
|
1321
|
-
`(None, None)` if the sort column is one of the special sort
|
|
1322
|
-
column ids. Otherwise a tuple containing:
|
|
1323
|
-
|
|
1324
|
-
:sort_column_id: The sort column id
|
|
1325
|
-
:order: The :obj:`Gtk.SortType`
|
|
1326
|
-
|
|
1327
|
-
:rtype: (**sort_column_id**: :obj:`int`, **order**: :obj:`Gtk.SortType`) or (:obj:`None`, :obj:`None`)
|
|
1328
|
-
|
|
1329
|
-
Returns `sort_column_id` and `order` with the current sort column and the
|
|
1330
|
-
order. It returns (:obj:`None`, :obj:`None`) if the `sort_column_id` is
|
|
1331
|
-
:obj:`Gtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID` or
|
|
1332
|
-
:obj:`Gtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID`.
|
|
1333
|
-
"""
|
|
1334
|
-
|
|
1335
|
-
def set_sort_func(self, sort_column_id, sort_func, user_data=None):
|
|
1336
|
-
super(TreeSortable, self).set_sort_func(sort_column_id, sort_func, user_data)
|
|
1337
|
-
|
|
1338
|
-
def set_default_sort_func(self, sort_func, user_data=None):
|
|
1339
|
-
super(TreeSortable, self).set_default_sort_func(sort_func, user_data)
|
|
1340
|
-
|
|
1341
|
-
TreeSortable = override(TreeSortable)
|
|
1342
|
-
__all__.append('TreeSortable')
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
class TreeModelSort(Gtk.TreeModelSort):
|
|
1346
|
-
__init__ = deprecated_init(Gtk.TreeModelSort.__init__,
|
|
1347
|
-
arg_names=('model',),
|
|
1348
|
-
category=PyGTKDeprecationWarning)
|
|
1349
|
-
|
|
1350
|
-
TreeModelSort = override(TreeModelSort)
|
|
1351
|
-
__all__.append('TreeModelSort')
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
class ListStore(Gtk.ListStore, TreeModel, TreeSortable):
|
|
1355
|
-
def __init__(self, *column_types):
|
|
1356
|
-
Gtk.ListStore.__init__(self)
|
|
1357
|
-
self.set_column_types(column_types)
|
|
1358
|
-
|
|
1359
|
-
def _do_insert(self, position, row):
|
|
1360
|
-
if row is not None:
|
|
1361
|
-
row, columns = self._convert_row(row)
|
|
1362
|
-
treeiter = self.insert_with_valuesv(position, columns, row)
|
|
1363
|
-
else:
|
|
1364
|
-
treeiter = Gtk.ListStore.insert(self, position)
|
|
1365
|
-
|
|
1366
|
-
return treeiter
|
|
1367
|
-
|
|
1368
|
-
def append(self, row=None):
|
|
1369
|
-
"""append(row=None)
|
|
1370
|
-
|
|
1371
|
-
:param row: a list of values to apply to the newly append row or :obj:`None`
|
|
1372
|
-
:type row: [:obj:`object`] or :obj:`None`
|
|
1373
|
-
|
|
1374
|
-
:returns: :obj:`Gtk.TreeIter` of the appended row
|
|
1375
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1376
|
-
|
|
1377
|
-
If `row` is :obj:`None` the appended row will be empty and to fill in
|
|
1378
|
-
values you need to call :obj:`Gtk.ListStore.set`\() or
|
|
1379
|
-
:obj:`Gtk.ListStore.set_value`\().
|
|
1380
|
-
|
|
1381
|
-
If `row` isn't :obj:`None` it has to be a list of values which will be
|
|
1382
|
-
used to fill the row .
|
|
1383
|
-
"""
|
|
1384
|
-
|
|
1385
|
-
if row:
|
|
1386
|
-
return self._do_insert(-1, row)
|
|
1387
|
-
# gtk_list_store_insert() does not know about the "position == -1"
|
|
1388
|
-
# case, so use append() here
|
|
1389
|
-
else:
|
|
1390
|
-
return Gtk.ListStore.append(self)
|
|
1391
|
-
|
|
1392
|
-
def prepend(self, row=None):
|
|
1393
|
-
"""prepend(row=None)
|
|
1394
|
-
|
|
1395
|
-
:param row: a list of values to apply to the newly prepend row or :obj:`None`
|
|
1396
|
-
:type row: [:obj:`object`] or :obj:`None`
|
|
1397
|
-
|
|
1398
|
-
:returns: :obj:`Gtk.TreeIter` of the prepended row
|
|
1399
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1400
|
-
|
|
1401
|
-
If `row` is :obj:`None` the prepended row will be empty and to fill in
|
|
1402
|
-
values you need to call :obj:`Gtk.ListStore.set`\() or
|
|
1403
|
-
:obj:`Gtk.ListStore.set_value`\().
|
|
1404
|
-
|
|
1405
|
-
If `row` isn't :obj:`None` it has to be a list of values which will be
|
|
1406
|
-
used to fill the row.
|
|
1407
|
-
"""
|
|
1408
|
-
|
|
1409
|
-
return self._do_insert(0, row)
|
|
1410
|
-
|
|
1411
|
-
def insert(self, position, row=None):
|
|
1412
|
-
"""insert(position, row=None)
|
|
1413
|
-
|
|
1414
|
-
:param position: the position the new row will be inserted at
|
|
1415
|
-
:type position: :obj:`int`
|
|
1416
|
-
|
|
1417
|
-
:param row: a list of values to apply to the newly inserted row or :obj:`None`
|
|
1418
|
-
:type row: [:obj:`object`] or :obj:`None`
|
|
1419
|
-
|
|
1420
|
-
:returns: :obj:`Gtk.TreeIter` of the inserted row
|
|
1421
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1422
|
-
|
|
1423
|
-
If `row` is :obj:`None` the inserted row will be empty and to fill in
|
|
1424
|
-
values you need to call :obj:`Gtk.ListStore.set`\() or
|
|
1425
|
-
:obj:`Gtk.ListStore.set_value`\().
|
|
1426
|
-
|
|
1427
|
-
If `row` isn't :obj:`None` it has to be a list of values which will be
|
|
1428
|
-
used to fill the row.
|
|
1429
|
-
|
|
1430
|
-
If `position` is -1 or is larger than the number of rows on the list,
|
|
1431
|
-
then the new row will be appended to the list.
|
|
1432
|
-
"""
|
|
1433
|
-
|
|
1434
|
-
return self._do_insert(position, row)
|
|
1435
|
-
|
|
1436
|
-
# FIXME: sends two signals; check if this can use an atomic
|
|
1437
|
-
# insert_with_valuesv()
|
|
1438
|
-
|
|
1439
|
-
def insert_before(self, sibling, row=None):
|
|
1440
|
-
"""insert_before(sibling, row=None)
|
|
1441
|
-
|
|
1442
|
-
:param sibling: A valid :obj:`Gtk.TreeIter`, or :obj:`None`
|
|
1443
|
-
:type sibling: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1444
|
-
|
|
1445
|
-
:param row: a list of values to apply to the newly inserted row or :obj:`None`
|
|
1446
|
-
:type row: [:obj:`object`] or :obj:`None`
|
|
1447
|
-
|
|
1448
|
-
:returns: :obj:`Gtk.TreeIter` pointing to the new row
|
|
1449
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1450
|
-
|
|
1451
|
-
Inserts a new row before `sibling`. If `sibling` is :obj:`None`, then
|
|
1452
|
-
the row will be appended to the end of the list.
|
|
1453
|
-
|
|
1454
|
-
The row will be empty if `row` is :obj:`None. To fill in values, you
|
|
1455
|
-
need to call :obj:`Gtk.ListStore.set`\() or
|
|
1456
|
-
:obj:`Gtk.ListStore.set_value`\().
|
|
1457
|
-
|
|
1458
|
-
If `row` isn't :obj:`None` it has to be a list of values which will be
|
|
1459
|
-
used to fill the row.
|
|
1460
|
-
"""
|
|
1461
|
-
|
|
1462
|
-
treeiter = Gtk.ListStore.insert_before(self, sibling)
|
|
1463
|
-
|
|
1464
|
-
if row is not None:
|
|
1465
|
-
self.set_row(treeiter, row)
|
|
1466
|
-
|
|
1467
|
-
return treeiter
|
|
1468
|
-
|
|
1469
|
-
# FIXME: sends two signals; check if this can use an atomic
|
|
1470
|
-
# insert_with_valuesv()
|
|
1471
|
-
|
|
1472
|
-
def insert_after(self, sibling, row=None):
|
|
1473
|
-
"""insert_after(sibling, row=None)
|
|
1474
|
-
|
|
1475
|
-
:param sibling: A valid :obj:`Gtk.TreeIter`, or :obj:`None`
|
|
1476
|
-
:type sibling: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1477
|
-
|
|
1478
|
-
:param row: a list of values to apply to the newly inserted row or :obj:`None`
|
|
1479
|
-
:type row: [:obj:`object`] or :obj:`None`
|
|
1480
|
-
|
|
1481
|
-
:returns: :obj:`Gtk.TreeIter` pointing to the new row
|
|
1482
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1483
|
-
|
|
1484
|
-
Inserts a new row after `sibling`. If `sibling` is :obj:`None`, then
|
|
1485
|
-
the row will be prepended to the beginning of the list.
|
|
1486
|
-
|
|
1487
|
-
The row will be empty if `row` is :obj:`None. To fill in values, you
|
|
1488
|
-
need to call :obj:`Gtk.ListStore.set`\() or
|
|
1489
|
-
:obj:`Gtk.ListStore.set_value`\().
|
|
1490
|
-
|
|
1491
|
-
If `row` isn't :obj:`None` it has to be a list of values which will be
|
|
1492
|
-
used to fill the row.
|
|
1493
|
-
"""
|
|
1494
|
-
|
|
1495
|
-
treeiter = Gtk.ListStore.insert_after(self, sibling)
|
|
1496
|
-
|
|
1497
|
-
if row is not None:
|
|
1498
|
-
self.set_row(treeiter, row)
|
|
1499
|
-
|
|
1500
|
-
return treeiter
|
|
1501
|
-
|
|
1502
|
-
def set_value(self, treeiter, column, value):
|
|
1503
|
-
"""
|
|
1504
|
-
{{ all }}
|
|
1505
|
-
|
|
1506
|
-
`value` can also be a Python value and will be converted to a
|
|
1507
|
-
:obj:`GObject.Value` using the corresponding column type (See
|
|
1508
|
-
:obj:`Gtk.ListStore.set_column_types`\()).
|
|
1509
|
-
"""
|
|
1510
|
-
|
|
1511
|
-
value = self._convert_value(column, value)
|
|
1512
|
-
Gtk.ListStore.set_value(self, treeiter, column, value)
|
|
1513
|
-
|
|
1514
|
-
def set(self, treeiter, *args):
|
|
1515
|
-
def _set_lists(columns, values):
|
|
1516
|
-
if len(columns) != len(values):
|
|
1517
|
-
raise TypeError('The number of columns do not match the number of values')
|
|
1518
|
-
for col_num, val in zip(columns, values):
|
|
1519
|
-
if not isinstance(col_num, int):
|
|
1520
|
-
raise TypeError('TypeError: Expected integer argument for column.')
|
|
1521
|
-
self.set_value(treeiter, col_num, val)
|
|
1522
|
-
|
|
1523
|
-
if args:
|
|
1524
|
-
if isinstance(args[0], int):
|
|
1525
|
-
columns = args[::2]
|
|
1526
|
-
values = args[1::2]
|
|
1527
|
-
_set_lists(columns, values)
|
|
1528
|
-
elif isinstance(args[0], (tuple, list)):
|
|
1529
|
-
if len(args) != 2:
|
|
1530
|
-
raise TypeError('Too many arguments')
|
|
1531
|
-
_set_lists(args[0], args[1])
|
|
1532
|
-
elif isinstance(args[0], dict):
|
|
1533
|
-
columns = args[0].keys()
|
|
1534
|
-
values = args[0].values()
|
|
1535
|
-
_set_lists(columns, values)
|
|
1536
|
-
else:
|
|
1537
|
-
raise TypeError('Argument list must be in the form of (column, value, ...), ((columns,...), (values, ...)) or {column: value}. No -1 termination is needed.')
|
|
1538
|
-
|
|
1539
|
-
ListStore = override(ListStore)
|
|
1540
|
-
__all__.append('ListStore')
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
class TreeModelRow(object):
|
|
1544
|
-
"""A :obj:`Gtk.TreeModelRow` object represents a row in a
|
|
1545
|
-
:obj:`Gtk.TreeModel`. A :obj:`Gtk.TreeModelRow` is created by taking the
|
|
1546
|
-
mapping of a :obj:`Gtk.TreeModel`. For example::
|
|
1547
|
-
|
|
1548
|
-
treemodelrow = liststore[0]
|
|
1549
|
-
treemodelrow = liststore[(0,)]
|
|
1550
|
-
treemodelrow = liststore['0']
|
|
1551
|
-
|
|
1552
|
-
all create a :obj:`Gtk.TreeModelRow` for the first row in liststore. The
|
|
1553
|
-
:obj:`Gtk.TreeModelRow` implements some of the Python sequence protocol
|
|
1554
|
-
that makes the row behave like a sequence of objects. Specifically a tree
|
|
1555
|
-
model row has the capability of:
|
|
1556
|
-
|
|
1557
|
-
* getting and setting column values,
|
|
1558
|
-
* returning a tuple or list containing the column values, and
|
|
1559
|
-
* getting the number of values in the row i.e. the number of columns
|
|
1560
|
-
|
|
1561
|
-
For example to get and set the value in the second column of a row, you
|
|
1562
|
-
could do the following::
|
|
1563
|
-
|
|
1564
|
-
value = treemodelrow[1]
|
|
1565
|
-
treemodelrow[1] = value
|
|
1566
|
-
|
|
1567
|
-
You can use the Python len() function to get the number of columns in the
|
|
1568
|
-
row and you can retrieve all the column values as a list (tuple) using the
|
|
1569
|
-
Python list() (tuple()) function.
|
|
1570
|
-
|
|
1571
|
-
The :obj:`Gtk.TreeModelRow` supports one method: the iterchildren() method
|
|
1572
|
-
that returns a :obj:`Gtk.TreeModelRowIter` for iterating over the children
|
|
1573
|
-
of the row.
|
|
1574
|
-
"""
|
|
1575
|
-
|
|
1576
|
-
def __init__(self, model, iter_or_path):
|
|
1577
|
-
if not isinstance(model, Gtk.TreeModel):
|
|
1578
|
-
raise TypeError("expected Gtk.TreeModel, %s found" % type(model).__name__)
|
|
1579
|
-
self.model = model
|
|
1580
|
-
if isinstance(iter_or_path, Gtk.TreePath):
|
|
1581
|
-
self.iter = model.get_iter(iter_or_path)
|
|
1582
|
-
elif isinstance(iter_or_path, Gtk.TreeIter):
|
|
1583
|
-
self.iter = iter_or_path
|
|
1584
|
-
else:
|
|
1585
|
-
raise TypeError("expected Gtk.TreeIter or Gtk.TreePath, \
|
|
1586
|
-
%s found" % type(iter_or_path).__name__)
|
|
1587
|
-
|
|
1588
|
-
iter = None
|
|
1589
|
-
"""A :obj:`Gtk.TreeIter` pointing at the row"""
|
|
1590
|
-
|
|
1591
|
-
model = None
|
|
1592
|
-
""" The :obj:`Gtk.TreeModel` that the row is part of"""
|
|
1593
|
-
|
|
1594
|
-
@property
|
|
1595
|
-
def path(self):
|
|
1596
|
-
"""The tree path of the row"""
|
|
1597
|
-
|
|
1598
|
-
return self.model.get_path(self.iter)
|
|
1599
|
-
|
|
1600
|
-
@property
|
|
1601
|
-
def next(self):
|
|
1602
|
-
""" The next :obj:`Gtk.TreeModelRow` or None"""
|
|
1603
|
-
|
|
1604
|
-
return self.get_next()
|
|
1605
|
-
|
|
1606
|
-
@property
|
|
1607
|
-
def previous(self):
|
|
1608
|
-
""" The previous :obj:`Gtk.TreeModelRow` or None"""
|
|
1609
|
-
|
|
1610
|
-
return self.get_previous()
|
|
1611
|
-
|
|
1612
|
-
@property
|
|
1613
|
-
def parent(self):
|
|
1614
|
-
"""The parent :obj:`Gtk.TreeModelRow` or htis row or None"""
|
|
1615
|
-
|
|
1616
|
-
return self.get_parent()
|
|
1617
|
-
|
|
1618
|
-
def get_next(self):
|
|
1619
|
-
"""Returns the next :obj:`Gtk.TreeModelRow` or None"""
|
|
1620
|
-
|
|
1621
|
-
next_iter = self.model.iter_next(self.iter)
|
|
1622
|
-
if next_iter:
|
|
1623
|
-
return TreeModelRow(self.model, next_iter)
|
|
1624
|
-
|
|
1625
|
-
def get_previous(self):
|
|
1626
|
-
"""Returns the previous :obj:`Gtk.TreeModelRow` or None"""
|
|
1627
|
-
|
|
1628
|
-
prev_iter = self.model.iter_previous(self.iter)
|
|
1629
|
-
if prev_iter:
|
|
1630
|
-
return TreeModelRow(self.model, prev_iter)
|
|
1631
|
-
|
|
1632
|
-
def get_parent(self):
|
|
1633
|
-
"""Returns the parent :obj:`Gtk.TreeModelRow` or htis row or None"""
|
|
1634
|
-
|
|
1635
|
-
parent_iter = self.model.iter_parent(self.iter)
|
|
1636
|
-
if parent_iter:
|
|
1637
|
-
return TreeModelRow(self.model, parent_iter)
|
|
1638
|
-
|
|
1639
|
-
def __getitem__(self, key):
|
|
1640
|
-
if isinstance(key, int):
|
|
1641
|
-
if key >= self.model.get_n_columns():
|
|
1642
|
-
raise IndexError("column index is out of bounds: %d" % key)
|
|
1643
|
-
elif key < 0:
|
|
1644
|
-
key = self._convert_negative_index(key)
|
|
1645
|
-
return self.model.get_value(self.iter, key)
|
|
1646
|
-
elif isinstance(key, slice):
|
|
1647
|
-
start, stop, step = key.indices(self.model.get_n_columns())
|
|
1648
|
-
alist = []
|
|
1649
|
-
for i in range(start, stop, step):
|
|
1650
|
-
alist.append(self.model.get_value(self.iter, i))
|
|
1651
|
-
return alist
|
|
1652
|
-
else:
|
|
1653
|
-
raise TypeError("indices must be integers, not %s" % type(key).__name__)
|
|
1654
|
-
|
|
1655
|
-
def __setitem__(self, key, value):
|
|
1656
|
-
if isinstance(key, int):
|
|
1657
|
-
if key >= self.model.get_n_columns():
|
|
1658
|
-
raise IndexError("column index is out of bounds: %d" % key)
|
|
1659
|
-
elif key < 0:
|
|
1660
|
-
key = self._convert_negative_index(key)
|
|
1661
|
-
self.model.set_value(self.iter, key, value)
|
|
1662
|
-
elif isinstance(key, slice):
|
|
1663
|
-
start, stop, step = key.indices(self.model.get_n_columns())
|
|
1664
|
-
indexList = range(start, stop, step)
|
|
1665
|
-
if len(indexList) != len(value):
|
|
1666
|
-
raise ValueError(
|
|
1667
|
-
"attempt to assign sequence of size %d to slice of size %d"
|
|
1668
|
-
% (len(value), len(indexList)))
|
|
1669
|
-
|
|
1670
|
-
for i, v in enumerate(indexList):
|
|
1671
|
-
self.model.set_value(self.iter, v, value[i])
|
|
1672
|
-
else:
|
|
1673
|
-
raise TypeError("index must be an integer or slice, not %s" % type(key).__name__)
|
|
1674
|
-
|
|
1675
|
-
def _convert_negative_index(self, index):
|
|
1676
|
-
new_index = self.model.get_n_columns() + index
|
|
1677
|
-
if new_index < 0:
|
|
1678
|
-
raise IndexError("column index is out of bounds: %d" % index)
|
|
1679
|
-
return new_index
|
|
1680
|
-
|
|
1681
|
-
def iterchildren(self):
|
|
1682
|
-
"""Returns a :obj:`Gtk.TreeModelRowIter` for the row's children"""
|
|
1683
|
-
|
|
1684
|
-
child_iter = self.model.iter_children(self.iter)
|
|
1685
|
-
return TreeModelRowIter(self.model, child_iter)
|
|
1686
|
-
|
|
1687
|
-
__all__.append('TreeModelRow')
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
class TreeModelRowIter(object):
|
|
1691
|
-
"""A :obj:`Gtk.TreeModelRowIter` is an object that implements the Python
|
|
1692
|
-
Iterator protocol. It provides the means to iterate over a set of
|
|
1693
|
-
:obj:`Gtk.TreeModelRow` objects in a :obj:`Gtk.TreeModel`. A
|
|
1694
|
-
:obj:`Gtk.TreeModelRowIter` is created by calling the Python iter()
|
|
1695
|
-
function on a :obj:`Gtk.TreeModel` object::
|
|
1696
|
-
|
|
1697
|
-
treemodelrowiter = iter(treestore)
|
|
1698
|
-
|
|
1699
|
-
or, calling the :obj:`Gtk.TreeModelRow.iterchildren`\() method to iterate
|
|
1700
|
-
over its child rows.
|
|
1701
|
-
|
|
1702
|
-
Each time you call the next() method it returns the next sibling
|
|
1703
|
-
:obj:`Gtk.TreeModelRow`. When there are no rows left the StopIteration
|
|
1704
|
-
exception is raised. Note that a :obj:`Gtk.TreeModelRowIter` does not
|
|
1705
|
-
iterate over the child rows of the rows it is iterating over. You'll have
|
|
1706
|
-
to use the :obj:`Gtk.TreeModelRow.iterchildren`\() method to retrieve an
|
|
1707
|
-
iterator for the child rows.
|
|
1708
|
-
"""
|
|
1709
|
-
|
|
1710
|
-
def __init__(self, model, aiter):
|
|
1711
|
-
self.model = model
|
|
1712
|
-
self.iter = aiter
|
|
1713
|
-
|
|
1714
|
-
def __next__(self):
|
|
1715
|
-
if not self.iter:
|
|
1716
|
-
raise StopIteration
|
|
1717
|
-
row = TreeModelRow(self.model, self.iter)
|
|
1718
|
-
self.iter = self.model.iter_next(self.iter)
|
|
1719
|
-
return row
|
|
1720
|
-
|
|
1721
|
-
# alias for Python 2.x object protocol
|
|
1722
|
-
next = __next__
|
|
1723
|
-
"""Returns the next :obj:`Gtk.TreeModelRow`"""
|
|
1724
|
-
|
|
1725
|
-
def __iter__(self):
|
|
1726
|
-
return self
|
|
1727
|
-
|
|
1728
|
-
__all__.append('TreeModelRowIter')
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
class TreePath(Gtk.TreePath):
|
|
1732
|
-
|
|
1733
|
-
def __new__(cls, path=0):
|
|
1734
|
-
if isinstance(path, int):
|
|
1735
|
-
path = str(path)
|
|
1736
|
-
elif not isinstance(path, _basestring):
|
|
1737
|
-
path = ":".join(str(val) for val in path)
|
|
1738
|
-
|
|
1739
|
-
if len(path) == 0:
|
|
1740
|
-
raise TypeError("could not parse subscript '%s' as a tree path" % path)
|
|
1741
|
-
try:
|
|
1742
|
-
return TreePath.new_from_string(path)
|
|
1743
|
-
except TypeError:
|
|
1744
|
-
raise TypeError("could not parse subscript '%s' as a tree path" % path)
|
|
1745
|
-
|
|
1746
|
-
def __init__(self, *args, **kwargs):
|
|
1747
|
-
super(TreePath, self).__init__()
|
|
1748
|
-
|
|
1749
|
-
def __str__(self):
|
|
1750
|
-
return self.to_string()
|
|
1751
|
-
|
|
1752
|
-
def __lt__(self, other):
|
|
1753
|
-
return other is not None and self.compare(other) < 0
|
|
1754
|
-
|
|
1755
|
-
def __le__(self, other):
|
|
1756
|
-
return other is not None and self.compare(other) <= 0
|
|
1757
|
-
|
|
1758
|
-
def __eq__(self, other):
|
|
1759
|
-
return other is not None and self.compare(other) == 0
|
|
1760
|
-
|
|
1761
|
-
def __ne__(self, other):
|
|
1762
|
-
return other is None or self.compare(other) != 0
|
|
1763
|
-
|
|
1764
|
-
def __gt__(self, other):
|
|
1765
|
-
return other is None or self.compare(other) > 0
|
|
1766
|
-
|
|
1767
|
-
def __ge__(self, other):
|
|
1768
|
-
return other is None or self.compare(other) >= 0
|
|
1769
|
-
|
|
1770
|
-
def __iter__(self):
|
|
1771
|
-
return iter(self.get_indices())
|
|
1772
|
-
|
|
1773
|
-
def __len__(self):
|
|
1774
|
-
return self.get_depth()
|
|
1775
|
-
|
|
1776
|
-
def __getitem__(self, index):
|
|
1777
|
-
return self.get_indices()[index]
|
|
1778
|
-
|
|
1779
|
-
TreePath = override(TreePath)
|
|
1780
|
-
__all__.append('TreePath')
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
class TreeStore(Gtk.TreeStore, TreeModel, TreeSortable):
|
|
1784
|
-
def __init__(self, *column_types):
|
|
1785
|
-
Gtk.TreeStore.__init__(self)
|
|
1786
|
-
self.set_column_types(column_types)
|
|
1787
|
-
|
|
1788
|
-
def _do_insert(self, parent, position, row):
|
|
1789
|
-
if row is not None:
|
|
1790
|
-
row, columns = self._convert_row(row)
|
|
1791
|
-
treeiter = self.insert_with_values(parent, position, columns, row)
|
|
1792
|
-
else:
|
|
1793
|
-
treeiter = Gtk.TreeStore.insert(self, parent, position)
|
|
1794
|
-
|
|
1795
|
-
return treeiter
|
|
1796
|
-
|
|
1797
|
-
def append(self, parent, row=None):
|
|
1798
|
-
"""append(parent, row=None)
|
|
1799
|
-
|
|
1800
|
-
:param parent: A valid :obj:`Gtk.TreeIter`, or :obj:`None`
|
|
1801
|
-
:type parent: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1802
|
-
|
|
1803
|
-
:param row: a list of values to apply to the newly inserted row or :obj:`None`
|
|
1804
|
-
:type row: [:obj:`object`] or :obj:`None`
|
|
1805
|
-
|
|
1806
|
-
:returns: obj:`Gtk.TreeIter` pointing to the inserted row
|
|
1807
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1808
|
-
|
|
1809
|
-
Appends a new row to `self`. If `parent` is not :obj:`None`, then it
|
|
1810
|
-
will append the new row after the last child of `parent`, otherwise it
|
|
1811
|
-
will append a row to the top level.
|
|
1812
|
-
|
|
1813
|
-
The returned `iterator will point to the new row. The row will be
|
|
1814
|
-
empty after this function is called if `row` is :obj:`None`. To fill
|
|
1815
|
-
in values, you need to call :obj:`Gtk.TreeStore.set`\() or
|
|
1816
|
-
:obj:`Gtk.TreeStore.set_value`\().
|
|
1817
|
-
|
|
1818
|
-
If `row` isn't :obj:`None` it has to be a list of values which will be
|
|
1819
|
-
used to fill the row.
|
|
1820
|
-
"""
|
|
1821
|
-
|
|
1822
|
-
return self._do_insert(parent, -1, row)
|
|
1823
|
-
|
|
1824
|
-
def prepend(self, parent, row=None):
|
|
1825
|
-
"""prepend(parent, row=None)
|
|
1826
|
-
|
|
1827
|
-
:param parent: A valid :obj:`Gtk.TreeIter`, or :obj:`None`
|
|
1828
|
-
:type parent: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1829
|
-
|
|
1830
|
-
:param row: a list of values to apply to the newly inserted row or :obj:`None`
|
|
1831
|
-
:type row: [:obj:`object`] or :obj:`None`
|
|
1832
|
-
|
|
1833
|
-
:returns: obj:`Gtk.TreeIter` pointing to the inserted row
|
|
1834
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1835
|
-
|
|
1836
|
-
Prepends a new row to `self`. If `parent` is not :obj:`None`, then it
|
|
1837
|
-
will prepend the new row before the first child of `parent`, otherwise
|
|
1838
|
-
it will prepend a row to the top level.
|
|
1839
|
-
|
|
1840
|
-
The returned `iterator will point to the new row. The row will be
|
|
1841
|
-
empty after this function is called if `row` is :obj:`None`. To fill
|
|
1842
|
-
in values, you need to call :obj:`Gtk.TreeStore.set`\() or
|
|
1843
|
-
:obj:`Gtk.TreeStore.set_value`\().
|
|
1844
|
-
|
|
1845
|
-
If `row` isn't :obj:`None` it has to be a list of values which will be
|
|
1846
|
-
used to fill the row.
|
|
1847
|
-
"""
|
|
1848
|
-
|
|
1849
|
-
return self._do_insert(parent, 0, row)
|
|
1850
|
-
|
|
1851
|
-
def insert(self, parent, position, row=None):
|
|
1852
|
-
"""insert(parent, position, row=None)
|
|
1853
|
-
|
|
1854
|
-
:param parent:
|
|
1855
|
-
A valid :obj:`Gtk.TreeIter`, or :obj:`None`
|
|
1856
|
-
:type parent: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1857
|
-
|
|
1858
|
-
:param position:
|
|
1859
|
-
position to insert the new row, or -1 for last
|
|
1860
|
-
:type position: :obj:`int`
|
|
1861
|
-
|
|
1862
|
-
:param row: a list of values to apply to the newly inserted row or :obj:`None`
|
|
1863
|
-
:type row: [:obj:`object`] or :obj:`None`
|
|
1864
|
-
|
|
1865
|
-
:returns: a :obj:`Gtk.TreeIter` pointing to the new row
|
|
1866
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1867
|
-
|
|
1868
|
-
Creates a new row at `position`. If parent is not :obj:`None`, then
|
|
1869
|
-
the row will be made a child of `parent`. Otherwise, the row will be
|
|
1870
|
-
created at the toplevel. If `position` is -1 or is larger than the
|
|
1871
|
-
number of rows at that level, then the new row will be inserted to the
|
|
1872
|
-
end of the list.
|
|
1873
|
-
|
|
1874
|
-
The returned iterator will point to the newly inserted row. The row
|
|
1875
|
-
will be empty after this function is called if `row` is :obj:`None`.
|
|
1876
|
-
To fill in values, you need to call :obj:`Gtk.TreeStore.set`\() or
|
|
1877
|
-
:obj:`Gtk.TreeStore.set_value`\().
|
|
1878
|
-
|
|
1879
|
-
If `row` isn't :obj:`None` it has to be a list of values which will be
|
|
1880
|
-
used to fill the row.
|
|
1881
|
-
"""
|
|
1882
|
-
|
|
1883
|
-
return self._do_insert(parent, position, row)
|
|
1884
|
-
|
|
1885
|
-
# FIXME: sends two signals; check if this can use an atomic
|
|
1886
|
-
# insert_with_valuesv()
|
|
1887
|
-
|
|
1888
|
-
def insert_before(self, parent, sibling, row=None):
|
|
1889
|
-
"""insert_before(parent, sibling, row=None)
|
|
1890
|
-
|
|
1891
|
-
:param parent: A valid :obj:`Gtk.TreeIter`, or :obj:`None`
|
|
1892
|
-
:type parent: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1893
|
-
|
|
1894
|
-
:param sibling: A valid :obj:`Gtk.TreeIter`, or :obj:`None`
|
|
1895
|
-
:type sibling: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1896
|
-
|
|
1897
|
-
:param row: a list of values to apply to the newly inserted row or :obj:`None`
|
|
1898
|
-
:type row: [:obj:`object`] or :obj:`None`
|
|
1899
|
-
|
|
1900
|
-
:returns: a :obj:`Gtk.TreeIter` pointing to the new row
|
|
1901
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1902
|
-
|
|
1903
|
-
Inserts a new row before `sibling`. If `sibling` is :obj:`None`, then
|
|
1904
|
-
the row will be appended to `parent` 's children. If `parent` and
|
|
1905
|
-
`sibling` are :obj:`None`, then the row will be appended to the
|
|
1906
|
-
toplevel. If both `sibling` and `parent` are set, then `parent` must
|
|
1907
|
-
be the parent of `sibling`. When `sibling` is set, `parent` is
|
|
1908
|
-
optional.
|
|
1909
|
-
|
|
1910
|
-
The returned iterator will point to this new row. The row will be
|
|
1911
|
-
empty after this function is called if `row` is :obj:`None`. To fill
|
|
1912
|
-
in values, you need to call :obj:`Gtk.TreeStore.set`\() or
|
|
1913
|
-
:obj:`Gtk.TreeStore.set_value`\().
|
|
1914
|
-
|
|
1915
|
-
If `row` isn't :obj:`None` it has to be a list of values which will be
|
|
1916
|
-
used to fill the row.
|
|
1917
|
-
"""
|
|
1918
|
-
|
|
1919
|
-
treeiter = Gtk.TreeStore.insert_before(self, parent, sibling)
|
|
1920
|
-
|
|
1921
|
-
if row is not None:
|
|
1922
|
-
self.set_row(treeiter, row)
|
|
1923
|
-
|
|
1924
|
-
return treeiter
|
|
1925
|
-
|
|
1926
|
-
# FIXME: sends two signals; check if this can use an atomic
|
|
1927
|
-
# insert_with_valuesv()
|
|
1928
|
-
|
|
1929
|
-
def insert_after(self, parent, sibling, row=None):
|
|
1930
|
-
"""
|
|
1931
|
-
:param parent: A valid :obj:`Gtk.TreeIter`, or :obj:`None`
|
|
1932
|
-
:type parent: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1933
|
-
|
|
1934
|
-
:param sibling: A valid :obj:`Gtk.TreeIter`, or :obj:`None`
|
|
1935
|
-
:type sibling: :obj:`Gtk.TreeIter` or :obj:`None`
|
|
1936
|
-
|
|
1937
|
-
:param row: a list of values to apply to the newly inserted row or :obj:`None`
|
|
1938
|
-
:type row: [:obj:`object`] or :obj:`None`
|
|
1939
|
-
|
|
1940
|
-
:returns: a :obj:`Gtk.TreeIter` pointing to the new row
|
|
1941
|
-
:rtype: :obj:`Gtk.TreeIter`
|
|
1942
|
-
|
|
1943
|
-
Inserts a new row after `sibling`. If `sibling` is :obj:`None`, then
|
|
1944
|
-
the row will be prepended to `parent` 's children. If `parent` and
|
|
1945
|
-
`sibling` are :obj:`None`, then the row will be prepended to the
|
|
1946
|
-
toplevel. If both `sibling` and `parent` are set, then `parent` must
|
|
1947
|
-
be the parent of `sibling`. When `sibling` is set, `parent` is
|
|
1948
|
-
optional.
|
|
1949
|
-
|
|
1950
|
-
The returned iterator will point to this new row. The row will be
|
|
1951
|
-
empty after this function is called if `row` is :obj:`None`. To fill
|
|
1952
|
-
in values, you need to call :obj:`Gtk.TreeStore.set`\() or
|
|
1953
|
-
:obj:`Gtk.TreeStore.set_value`\().
|
|
1954
|
-
|
|
1955
|
-
If `row` isn't :obj:`None` it has to be a list of values which will be
|
|
1956
|
-
used to fill the row.
|
|
1957
|
-
"""
|
|
1958
|
-
|
|
1959
|
-
treeiter = Gtk.TreeStore.insert_after(self, parent, sibling)
|
|
1960
|
-
|
|
1961
|
-
if row is not None:
|
|
1962
|
-
self.set_row(treeiter, row)
|
|
1963
|
-
|
|
1964
|
-
return treeiter
|
|
1965
|
-
|
|
1966
|
-
def set_value(self, treeiter, column, value):
|
|
1967
|
-
"""
|
|
1968
|
-
{{ all }}
|
|
1969
|
-
|
|
1970
|
-
`value` can also be a Python value and will be converted to a
|
|
1971
|
-
:obj:`GObject.Value` using the corresponding column type (See
|
|
1972
|
-
:obj:`Gtk.ListStore.set_column_types`\()).
|
|
1973
|
-
"""
|
|
1974
|
-
|
|
1975
|
-
value = self._convert_value(column, value)
|
|
1976
|
-
Gtk.TreeStore.set_value(self, treeiter, column, value)
|
|
1977
|
-
|
|
1978
|
-
def set(self, treeiter, *args):
|
|
1979
|
-
|
|
1980
|
-
def _set_lists(columns, values):
|
|
1981
|
-
if len(columns) != len(values):
|
|
1982
|
-
raise TypeError('The number of columns do not match the number of values')
|
|
1983
|
-
for col_num, val in zip(columns, values):
|
|
1984
|
-
if not isinstance(col_num, int):
|
|
1985
|
-
raise TypeError('TypeError: Expected integer argument for column.')
|
|
1986
|
-
self.set_value(treeiter, col_num, val)
|
|
1987
|
-
|
|
1988
|
-
if args:
|
|
1989
|
-
if isinstance(args[0], int):
|
|
1990
|
-
columns = args[::2]
|
|
1991
|
-
values = args[1::2]
|
|
1992
|
-
_set_lists(columns, values)
|
|
1993
|
-
elif isinstance(args[0], (tuple, list)):
|
|
1994
|
-
if len(args) != 2:
|
|
1995
|
-
raise TypeError('Too many arguments')
|
|
1996
|
-
_set_lists(args[0], args[1])
|
|
1997
|
-
elif isinstance(args[0], dict):
|
|
1998
|
-
columns = args[0].keys()
|
|
1999
|
-
values = args[0].values()
|
|
2000
|
-
_set_lists(columns, values)
|
|
2001
|
-
else:
|
|
2002
|
-
raise TypeError('Argument list must be in the form of (column, value, ...), ((columns,...), (values, ...)) or {column: value}. No -1 termination is needed.')
|
|
2003
|
-
|
|
2004
|
-
TreeStore = override(TreeStore)
|
|
2005
|
-
__all__.append('TreeStore')
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
class TreeView(Gtk.TreeView, Container):
|
|
2009
|
-
__init__ = deprecated_init(Gtk.TreeView.__init__,
|
|
2010
|
-
arg_names=('model',),
|
|
2011
|
-
category=PyGTKDeprecationWarning)
|
|
2012
|
-
|
|
2013
|
-
get_path_at_pos = strip_boolean_result(Gtk.TreeView.get_path_at_pos)
|
|
2014
|
-
"""
|
|
2015
|
-
:param x: The x position to be identified (relative to bin\_window).
|
|
2016
|
-
:type x: :obj:`int`
|
|
2017
|
-
|
|
2018
|
-
:param y: The y position to be identified (relative to bin\_window).
|
|
2019
|
-
:type y: :obj:`int`
|
|
2020
|
-
|
|
2021
|
-
:returns:
|
|
2022
|
-
:obj:`None` if the row doesn't exist at that coordinates or
|
|
2023
|
-
a tuple containing:
|
|
2024
|
-
|
|
2025
|
-
:path: a :obj:`Gtk.TreePath`
|
|
2026
|
-
:column: a :obj:`Gtk.TreeViewColumn`
|
|
2027
|
-
:cell_x: the X coordinate relative to the cell
|
|
2028
|
-
:cell_y: the Y coordinate relative to the cell
|
|
2029
|
-
|
|
2030
|
-
:rtype: (**path**: :obj:`Gtk.TreePath` or :obj:`None`, **column**: :obj:`Gtk.TreeViewColumn` or :obj:`None`, **cell_x**: :obj:`int`, **cell_y**: :obj:`int`) or :obj:`None`
|
|
2031
|
-
|
|
2032
|
-
{{ docs }}
|
|
2033
|
-
"""
|
|
2034
|
-
|
|
2035
|
-
get_visible_range = strip_boolean_result(Gtk.TreeView.get_visible_range)
|
|
2036
|
-
"""
|
|
2037
|
-
:returns:
|
|
2038
|
-
Either :obj:`None` if there is no visible range or a tuple containing:
|
|
2039
|
-
|
|
2040
|
-
:start_path: start of region
|
|
2041
|
-
:end_path: end of region
|
|
2042
|
-
|
|
2043
|
-
:rtype: (**start_path**: :obj:`Gtk.TreePath`, **end_path**: :obj:`Gtk.TreePath`) or :obj:`None`
|
|
2044
|
-
|
|
2045
|
-
Returns the first and last visible path. Note that there may be invisible
|
|
2046
|
-
paths in between.
|
|
2047
|
-
"""
|
|
2048
|
-
|
|
2049
|
-
get_dest_row_at_pos = strip_boolean_result(Gtk.TreeView.get_dest_row_at_pos)
|
|
2050
|
-
"""
|
|
2051
|
-
:param drag_x: the position to determine the destination row for
|
|
2052
|
-
:type drag_x: :obj:`int`
|
|
2053
|
-
|
|
2054
|
-
:param drag_y: the position to determine the destination row for
|
|
2055
|
-
:type drag_y: :obj:`int`
|
|
2056
|
-
|
|
2057
|
-
:returns:
|
|
2058
|
-
:obj:`None` if there is no row at the given position or a tuple
|
|
2059
|
-
containing:
|
|
2060
|
-
|
|
2061
|
-
:path: the path of the highlighted row
|
|
2062
|
-
:pos: the drop position
|
|
2063
|
-
|
|
2064
|
-
:rtype: (**path**: :obj:`Gtk.TreePath` or :obj:`None`, **pos**: :obj:`Gtk.TreeViewDropPosition`) or :obj:`None`
|
|
2065
|
-
|
|
2066
|
-
Determines the destination row for a given position. `drag_x` and
|
|
2067
|
-
`drag_y` are expected to be in widget coordinates. This function is only
|
|
2068
|
-
meaningful if `self` is realized. Therefore this function will always
|
|
2069
|
-
return :obj:`None` if `self` is not realized or does not have a model.
|
|
2070
|
-
"""
|
|
2071
|
-
|
|
2072
|
-
def enable_model_drag_source(self, start_button_mask, targets, actions):
|
|
2073
|
-
target_entries = _construct_target_list(targets)
|
|
2074
|
-
super(TreeView, self).enable_model_drag_source(start_button_mask,
|
|
2075
|
-
target_entries,
|
|
2076
|
-
actions)
|
|
2077
|
-
|
|
2078
|
-
def enable_model_drag_dest(self, targets, actions):
|
|
2079
|
-
target_entries = _construct_target_list(targets)
|
|
2080
|
-
super(TreeView, self).enable_model_drag_dest(target_entries,
|
|
2081
|
-
actions)
|
|
2082
|
-
|
|
2083
|
-
def scroll_to_cell(self, path, column=None, use_align=False, row_align=0.0, col_align=0.0):
|
|
2084
|
-
if not isinstance(path, Gtk.TreePath):
|
|
2085
|
-
path = TreePath(path)
|
|
2086
|
-
super(TreeView, self).scroll_to_cell(path, column, use_align, row_align, col_align)
|
|
2087
|
-
|
|
2088
|
-
def set_cursor(self, path, column=None, start_editing=False):
|
|
2089
|
-
if not isinstance(path, Gtk.TreePath):
|
|
2090
|
-
path = TreePath(path)
|
|
2091
|
-
super(TreeView, self).set_cursor(path, column, start_editing)
|
|
2092
|
-
|
|
2093
|
-
def get_cell_area(self, path, column=None):
|
|
2094
|
-
if not isinstance(path, Gtk.TreePath):
|
|
2095
|
-
path = TreePath(path)
|
|
2096
|
-
return super(TreeView, self).get_cell_area(path, column)
|
|
2097
|
-
|
|
2098
|
-
def insert_column_with_attributes(self, position, title, cell, **kwargs):
|
|
2099
|
-
"""
|
|
2100
|
-
:param position: The position to insert the new column in
|
|
2101
|
-
:type position: :obj:`int`
|
|
2102
|
-
|
|
2103
|
-
:param title: The title to set the header to
|
|
2104
|
-
:type title: :obj:`str`
|
|
2105
|
-
|
|
2106
|
-
:param cell: The :obj:`Gtk.CellRenderer`
|
|
2107
|
-
:type cell: :obj:`Gtk.CellRenderer`
|
|
2108
|
-
|
|
2109
|
-
{{ docs }}
|
|
2110
|
-
"""
|
|
2111
|
-
|
|
2112
|
-
column = TreeViewColumn()
|
|
2113
|
-
column.set_title(title)
|
|
2114
|
-
column.pack_start(cell, False)
|
|
2115
|
-
self.insert_column(column, position)
|
|
2116
|
-
column.set_attributes(cell, **kwargs)
|
|
2117
|
-
|
|
2118
|
-
TreeView = override(TreeView)
|
|
2119
|
-
__all__.append('TreeView')
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
class TreeViewColumn(Gtk.TreeViewColumn):
|
|
2123
|
-
def __init__(self, title='',
|
|
2124
|
-
cell_renderer=None,
|
|
2125
|
-
**attributes):
|
|
2126
|
-
Gtk.TreeViewColumn.__init__(self, title=title)
|
|
2127
|
-
if cell_renderer:
|
|
2128
|
-
self.pack_start(cell_renderer, True)
|
|
2129
|
-
|
|
2130
|
-
for (name, value) in attributes.items():
|
|
2131
|
-
self.add_attribute(cell_renderer, name, value)
|
|
2132
|
-
|
|
2133
|
-
cell_get_position = strip_boolean_result(Gtk.TreeViewColumn.cell_get_position)
|
|
2134
|
-
"""
|
|
2135
|
-
:param cell_renderer: a :obj:`Gtk.CellRenderer`
|
|
2136
|
-
:type cell_renderer: :obj:`Gtk.CellRenderer`
|
|
2137
|
-
|
|
2138
|
-
:returns:
|
|
2139
|
-
:obj:`None` if `cell` does not belong to `self` or a tuple containing:
|
|
2140
|
-
|
|
2141
|
-
:x_offset: the horizontal position of `cell` within `self`
|
|
2142
|
-
:width: the width of `cell`
|
|
2143
|
-
|
|
2144
|
-
:rtype: (**x_offset**: :obj:`int`, **width**: :obj:`int`) or :obj:`None`
|
|
2145
|
-
|
|
2146
|
-
Obtains the horizontal position and size of a cell in a column. If the
|
|
2147
|
-
cell is not found in the column :obj:`None` is returned.
|
|
2148
|
-
"""
|
|
2149
|
-
|
|
2150
|
-
def set_cell_data_func(self, cell_renderer, func, func_data=None):
|
|
2151
|
-
super(TreeViewColumn, self).set_cell_data_func(cell_renderer, func, func_data)
|
|
2152
|
-
|
|
2153
|
-
def set_attributes(self, cell_renderer, **attributes):
|
|
2154
|
-
"""
|
|
2155
|
-
:param cell_renderer: the :obj:`Gtk.CellRenderer` we're setting the attributes of
|
|
2156
|
-
:type cell_renderer: :obj:`Gtk.CellRenderer`
|
|
2157
|
-
|
|
2158
|
-
{{ docs }}
|
|
2159
|
-
"""
|
|
2160
|
-
|
|
2161
|
-
Gtk.CellLayout.clear_attributes(self, cell_renderer)
|
|
2162
|
-
|
|
2163
|
-
for (name, value) in attributes.items():
|
|
2164
|
-
Gtk.CellLayout.add_attribute(self, cell_renderer, name, value)
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
TreeViewColumn = override(TreeViewColumn)
|
|
2168
|
-
__all__.append('TreeViewColumn')
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
class TreeSelection(Gtk.TreeSelection):
|
|
2172
|
-
|
|
2173
|
-
def select_path(self, path):
|
|
2174
|
-
if not isinstance(path, Gtk.TreePath):
|
|
2175
|
-
path = TreePath(path)
|
|
2176
|
-
super(TreeSelection, self).select_path(path)
|
|
2177
|
-
|
|
2178
|
-
def get_selected(self):
|
|
2179
|
-
"""
|
|
2180
|
-
:returns:
|
|
2181
|
-
:model: the :obj:`Gtk.TreeModel`
|
|
2182
|
-
:iter: The :obj:`Gtk.TreeIter` or :obj:`None`
|
|
2183
|
-
|
|
2184
|
-
:rtype: (**model**: :obj:`Gtk.TreeModel`, **iter**: :obj:`Gtk.TreeIter` or :obj:`None`)
|
|
2185
|
-
|
|
2186
|
-
{{ docs }}
|
|
2187
|
-
"""
|
|
2188
|
-
|
|
2189
|
-
success, model, aiter = super(TreeSelection, self).get_selected()
|
|
2190
|
-
if success:
|
|
2191
|
-
return (model, aiter)
|
|
2192
|
-
else:
|
|
2193
|
-
return (model, None)
|
|
2194
|
-
|
|
2195
|
-
# for compatibility with PyGtk
|
|
2196
|
-
|
|
2197
|
-
def get_selected_rows(self):
|
|
2198
|
-
"""
|
|
2199
|
-
:returns:
|
|
2200
|
-
A list containing a :obj:`Gtk.TreePath` for each selected row
|
|
2201
|
-
and a :obj:`Gtk.TreeModel` or :obj:`None`.
|
|
2202
|
-
|
|
2203
|
-
:rtype: (:obj:`Gtk.TreeModel`, [:obj:`Gtk.TreePath`])
|
|
2204
|
-
|
|
2205
|
-
{{ docs }}
|
|
2206
|
-
"""
|
|
2207
|
-
|
|
2208
|
-
rows, model = super(TreeSelection, self).get_selected_rows()
|
|
2209
|
-
return (model, rows)
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
TreeSelection = override(TreeSelection)
|
|
2213
|
-
__all__.append('TreeSelection')
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
class Button(Gtk.Button, Container):
|
|
2217
|
-
_init = deprecated_init(Gtk.Button.__init__,
|
|
2218
|
-
arg_names=('label', 'stock', 'use_stock', 'use_underline'),
|
|
2219
|
-
ignore=('stock',),
|
|
2220
|
-
category=PyGTKDeprecationWarning,
|
|
2221
|
-
stacklevel=3)
|
|
2222
|
-
|
|
2223
|
-
def __init__(self, *args, **kwargs):
|
|
2224
|
-
# Doubly deprecated initializer, the stock keyword is non-standard.
|
|
2225
|
-
# Simply give a warning that stock items are deprecated even though
|
|
2226
|
-
# we want to deprecate the non-standard keyword as well here from
|
|
2227
|
-
# the overrides.
|
|
2228
|
-
if 'stock' in kwargs and kwargs['stock']:
|
|
2229
|
-
warnings.warn('Stock items are deprecated. '
|
|
2230
|
-
'Please use: Gtk.Button.new_with_mnemonic(label)',
|
|
2231
|
-
PyGTKDeprecationWarning, stacklevel=2)
|
|
2232
|
-
new_kwargs = kwargs.copy()
|
|
2233
|
-
new_kwargs['label'] = new_kwargs['stock']
|
|
2234
|
-
new_kwargs['use_stock'] = True
|
|
2235
|
-
new_kwargs['use_underline'] = True
|
|
2236
|
-
del new_kwargs['stock']
|
|
2237
|
-
Gtk.Button.__init__(self, **new_kwargs)
|
|
2238
|
-
else:
|
|
2239
|
-
self._init(*args, **kwargs)
|
|
2240
|
-
|
|
2241
|
-
Button = override(Button)
|
|
2242
|
-
__all__.append('Button')
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
class LinkButton(Gtk.LinkButton):
|
|
2246
|
-
__init__ = deprecated_init(Gtk.LinkButton.__init__,
|
|
2247
|
-
arg_names=('uri', 'label'),
|
|
2248
|
-
category=PyGTKDeprecationWarning)
|
|
2249
|
-
|
|
2250
|
-
LinkButton = override(LinkButton)
|
|
2251
|
-
__all__.append('LinkButton')
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
class Label(Gtk.Label):
|
|
2255
|
-
__init__ = deprecated_init(Gtk.Label.__init__,
|
|
2256
|
-
arg_names=('label',),
|
|
2257
|
-
category=PyGTKDeprecationWarning)
|
|
2258
|
-
|
|
2259
|
-
Label = override(Label)
|
|
2260
|
-
__all__.append('Label')
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
class Adjustment(Gtk.Adjustment):
|
|
2264
|
-
_init = deprecated_init(Gtk.Adjustment.__init__,
|
|
2265
|
-
arg_names=('value', 'lower', 'upper',
|
|
2266
|
-
'step_increment', 'page_increment', 'page_size'),
|
|
2267
|
-
deprecated_aliases={'page_increment': 'page_incr',
|
|
2268
|
-
'step_increment': 'step_incr'},
|
|
2269
|
-
category=PyGTKDeprecationWarning,
|
|
2270
|
-
stacklevel=3)
|
|
2271
|
-
|
|
2272
|
-
def __init__(self, *args, **kwargs):
|
|
2273
|
-
self._init(*args, **kwargs)
|
|
2274
|
-
|
|
2275
|
-
# The value property is set between lower and (upper - page_size).
|
|
2276
|
-
# Just in case lower, upper or page_size was still 0 when value
|
|
2277
|
-
# was set, we set it again here.
|
|
2278
|
-
if 'value' in kwargs:
|
|
2279
|
-
self.set_value(kwargs['value'])
|
|
2280
|
-
|
|
2281
|
-
Adjustment = override(Adjustment)
|
|
2282
|
-
__all__.append('Adjustment')
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
class Table(Gtk.Table, Container):
|
|
2286
|
-
__init__ = deprecated_init(Gtk.Table.__init__,
|
|
2287
|
-
arg_names=('n_rows', 'n_columns', 'homogeneous'),
|
|
2288
|
-
deprecated_aliases={'n_rows': 'rows', 'n_columns': 'columns'},
|
|
2289
|
-
category=PyGTKDeprecationWarning)
|
|
2290
|
-
|
|
2291
|
-
def attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions=Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, yoptions=Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, xpadding=0, ypadding=0):
|
|
2292
|
-
Gtk.Table.attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions, yoptions, xpadding, ypadding)
|
|
2293
|
-
|
|
2294
|
-
Table = override(Table)
|
|
2295
|
-
__all__.append('Table')
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
class ScrolledWindow(Gtk.ScrolledWindow):
|
|
2299
|
-
__init__ = deprecated_init(Gtk.ScrolledWindow.__init__,
|
|
2300
|
-
arg_names=('hadjustment', 'vadjustment'),
|
|
2301
|
-
category=PyGTKDeprecationWarning)
|
|
2302
|
-
|
|
2303
|
-
ScrolledWindow = override(ScrolledWindow)
|
|
2304
|
-
__all__.append('ScrolledWindow')
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
class HScrollbar(Gtk.HScrollbar):
|
|
2308
|
-
__init__ = deprecated_init(Gtk.HScrollbar.__init__,
|
|
2309
|
-
arg_names=('adjustment',),
|
|
2310
|
-
category=PyGTKDeprecationWarning)
|
|
2311
|
-
|
|
2312
|
-
HScrollbar = override(HScrollbar)
|
|
2313
|
-
__all__.append('HScrollbar')
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
class VScrollbar(Gtk.VScrollbar):
|
|
2317
|
-
__init__ = deprecated_init(Gtk.VScrollbar.__init__,
|
|
2318
|
-
arg_names=('adjustment',),
|
|
2319
|
-
category=PyGTKDeprecationWarning)
|
|
2320
|
-
|
|
2321
|
-
VScrollbar = override(VScrollbar)
|
|
2322
|
-
__all__.append('VScrollbar')
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
class Paned(Gtk.Paned):
|
|
2326
|
-
def pack1(self, child, resize=False, shrink=True):
|
|
2327
|
-
super(Paned, self).pack1(child, resize, shrink)
|
|
2328
|
-
|
|
2329
|
-
def pack2(self, child, resize=True, shrink=True):
|
|
2330
|
-
super(Paned, self).pack2(child, resize, shrink)
|
|
2331
|
-
|
|
2332
|
-
Paned = override(Paned)
|
|
2333
|
-
__all__.append('Paned')
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
class Arrow(Gtk.Arrow):
|
|
2337
|
-
__init__ = deprecated_init(Gtk.Arrow.__init__,
|
|
2338
|
-
arg_names=('arrow_type', 'shadow_type'),
|
|
2339
|
-
category=PyGTKDeprecationWarning)
|
|
2340
|
-
|
|
2341
|
-
Arrow = override(Arrow)
|
|
2342
|
-
__all__.append('Arrow')
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
class IconSet(Gtk.IconSet):
|
|
2346
|
-
def __new__(cls, pixbuf=None):
|
|
2347
|
-
if pixbuf is not None:
|
|
2348
|
-
warnings.warn('Gtk.IconSet(pixbuf) has been deprecated. Please use: '
|
|
2349
|
-
'Gtk.IconSet.new_from_pixbuf(pixbuf)',
|
|
2350
|
-
PyGTKDeprecationWarning, stacklevel=2)
|
|
2351
|
-
iconset = Gtk.IconSet.new_from_pixbuf(pixbuf)
|
|
2352
|
-
else:
|
|
2353
|
-
iconset = Gtk.IconSet.__new__(cls)
|
|
2354
|
-
return iconset
|
|
2355
|
-
|
|
2356
|
-
def __init__(self, *args, **kwargs):
|
|
2357
|
-
return super(IconSet, self).__init__()
|
|
2358
|
-
|
|
2359
|
-
IconSet = override(IconSet)
|
|
2360
|
-
__all__.append('IconSet')
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
class Viewport(Gtk.Viewport):
|
|
2364
|
-
__init__ = deprecated_init(Gtk.Viewport.__init__,
|
|
2365
|
-
arg_names=('hadjustment', 'vadjustment'),
|
|
2366
|
-
category=PyGTKDeprecationWarning)
|
|
2367
|
-
|
|
2368
|
-
Viewport = override(Viewport)
|
|
2369
|
-
__all__.append('Viewport')
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
class TreeModelFilter(Gtk.TreeModelFilter):
|
|
2373
|
-
def set_visible_func(self, func, data=None):
|
|
2374
|
-
super(TreeModelFilter, self).set_visible_func(func, data)
|
|
2375
|
-
|
|
2376
|
-
def set_value(self, iter, column, value):
|
|
2377
|
-
"""Set the value of the child model"""
|
|
2378
|
-
|
|
2379
|
-
# Delegate to child model
|
|
2380
|
-
iter = self.convert_iter_to_child_iter(iter)
|
|
2381
|
-
self.get_model().set_value(iter, column, value)
|
|
2382
|
-
|
|
2383
|
-
TreeModelFilter = override(TreeModelFilter)
|
|
2384
|
-
__all__.append('TreeModelFilter')
|
|
2385
|
-
|
|
2386
|
-
if Gtk._version != '2.0':
|
|
2387
|
-
class Menu(Gtk.Menu):
|
|
2388
|
-
def popup(self, parent_menu_shell, parent_menu_item, func, data, button, activate_time):
|
|
2389
|
-
self.popup_for_device(None, parent_menu_shell, parent_menu_item, func, data, button, activate_time)
|
|
2390
|
-
Menu = override(Menu)
|
|
2391
|
-
__all__.append('Menu')
|
|
2392
|
-
|
|
2393
|
-
_Gtk_main_quit = Gtk.main_quit
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
@override(Gtk.main_quit)
|
|
2397
|
-
def main_quit(*args):
|
|
2398
|
-
_Gtk_main_quit()
|
|
2399
|
-
|
|
2400
|
-
stock_lookup = strip_boolean_result(Gtk.stock_lookup)
|
|
2401
|
-
"""
|
|
2402
|
-
:param stock_id: a stock item name
|
|
2403
|
-
:type stock_id: :obj:`str`
|
|
2404
|
-
|
|
2405
|
-
:returns: a stock item or :obj:`None` if the stock icon isn't known.
|
|
2406
|
-
:rtype: :obj:`Gtk.StockItem` or :obj:`None`
|
|
2407
|
-
"""
|
|
2408
|
-
|
|
2409
|
-
__all__.append('stock_lookup')
|
|
2410
|
-
|
|
2411
|
-
initialized, argv = Gtk.init_check(sys.argv)
|
|
2412
|
-
sys.argv = list(argv)
|