wxPython 4.3.2__cp315-cp315-win_amd64.whl
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.
- wx/WebView2Loader.dll +0 -0
- wx/__init__.py +22 -0
- wx/__init__.pyi +10 -0
- wx/__version__.py +9 -0
- wx/__version__.pyi +15 -0
- wx/_adv.cp315-win_amd64.pyd +0 -0
- wx/_aui.cp315-win_amd64.pyd +0 -0
- wx/_core.cp315-win_amd64.pyd +0 -0
- wx/_dataview.cp315-win_amd64.pyd +0 -0
- wx/_glcanvas.cp315-win_amd64.pyd +0 -0
- wx/_grid.cp315-win_amd64.pyd +0 -0
- wx/_html.cp315-win_amd64.pyd +0 -0
- wx/_html2.cp315-win_amd64.pyd +0 -0
- wx/_media.cp315-win_amd64.pyd +0 -0
- wx/_msw.cp315-win_amd64.pyd +0 -0
- wx/_propgrid.cp315-win_amd64.pyd +0 -0
- wx/_ribbon.cp315-win_amd64.pyd +0 -0
- wx/_richtext.cp315-win_amd64.pyd +0 -0
- wx/_stc.cp315-win_amd64.pyd +0 -0
- wx/_xml.cp315-win_amd64.pyd +0 -0
- wx/_xrc.cp315-win_amd64.pyd +0 -0
- wx/adv.py +127 -0
- wx/adv.pyi +5931 -0
- wx/aui.py +70 -0
- wx/aui.pyi +4805 -0
- wx/core.py +3417 -0
- wx/core.pyi +62949 -0
- wx/dataview.py +176 -0
- wx/dataview.pyi +3828 -0
- wx/gizmos.py +18 -0
- wx/glcanvas.py +13 -0
- wx/glcanvas.pyi +544 -0
- wx/grid.py +237 -0
- wx/grid.pyi +5678 -0
- wx/html.py +38 -0
- wx/html.pyi +3283 -0
- wx/html2.py +46 -0
- wx/html2.pyi +1301 -0
- wx/include/wxPython/sip.h +1938 -0
- wx/include/wxPython/wxpy_api.h +418 -0
- wx/lib/CDate.py +201 -0
- wx/lib/ClickableHtmlWindow.py +57 -0
- wx/lib/__init__.py +0 -0
- wx/lib/activex.py +178 -0
- wx/lib/activexwrapper.py +153 -0
- wx/lib/agw/__init__.py +128 -0
- wx/lib/agw/advancedsplash.py +563 -0
- wx/lib/agw/aquabutton.py +1127 -0
- wx/lib/agw/artmanager.py +2110 -0
- wx/lib/agw/aui/__init__.py +295 -0
- wx/lib/agw/aui/aui_constants.py +2616 -0
- wx/lib/agw/aui/aui_switcherdialog.py +1232 -0
- wx/lib/agw/aui/aui_utilities.py +648 -0
- wx/lib/agw/aui/auibar.py +4045 -0
- wx/lib/agw/aui/auibook.py +6288 -0
- wx/lib/agw/aui/dockart.py +1198 -0
- wx/lib/agw/aui/framemanager.py +10485 -0
- wx/lib/agw/aui/tabart.py +2749 -0
- wx/lib/agw/aui/tabmdi.py +679 -0
- wx/lib/agw/balloontip.py +1157 -0
- wx/lib/agw/buttonpanel.py +2787 -0
- wx/lib/agw/cubecolourdialog.py +3529 -0
- wx/lib/agw/customtreectrl.py +9908 -0
- wx/lib/agw/data/ShortcutEditor_1.png +0 -0
- wx/lib/agw/data/ShortcutEditor_1_thumb.png +0 -0
- wx/lib/agw/data/ShortcutEditor_2.png +0 -0
- wx/lib/agw/data/ShortcutEditor_2_thumb.png +0 -0
- wx/lib/agw/data/ShortcutEditor_3.png +0 -0
- wx/lib/agw/data/ShortcutEditor_3_thumb.png +0 -0
- wx/lib/agw/data/ShortcutEditor_4.png +0 -0
- wx/lib/agw/data/ShortcutEditor_4_thumb.png +0 -0
- wx/lib/agw/data/default_help_text.html +105 -0
- wx/lib/agw/flatmenu.py +7392 -0
- wx/lib/agw/flatnotebook.py +6669 -0
- wx/lib/agw/floatspin.py +1820 -0
- wx/lib/agw/fmcustomizedlg.py +535 -0
- wx/lib/agw/fmresources.py +407 -0
- wx/lib/agw/foldpanelbar.py +2282 -0
- wx/lib/agw/fourwaysplitter.py +1130 -0
- wx/lib/agw/genericmessagedialog.py +1549 -0
- wx/lib/agw/gradientbutton.py +731 -0
- wx/lib/agw/hyperlink.py +664 -0
- wx/lib/agw/hypertreelist.py +5756 -0
- wx/lib/agw/infobar.py +885 -0
- wx/lib/agw/knobctrl.py +944 -0
- wx/lib/agw/labelbook.py +3028 -0
- wx/lib/agw/multidirdialog.py +581 -0
- wx/lib/agw/peakmeter.py +1028 -0
- wx/lib/agw/persist/__init__.py +188 -0
- wx/lib/agw/persist/persist_constants.py +283 -0
- wx/lib/agw/persist/persist_handlers.py +2614 -0
- wx/lib/agw/persist/persistencemanager.py +863 -0
- wx/lib/agw/piectrl.py +1082 -0
- wx/lib/agw/pybusyinfo.py +399 -0
- wx/lib/agw/pycollapsiblepane.py +940 -0
- wx/lib/agw/pygauge.py +570 -0
- wx/lib/agw/pyprogress.py +916 -0
- wx/lib/agw/ribbon/__init__.py +198 -0
- wx/lib/agw/ribbon/art.py +219 -0
- wx/lib/agw/ribbon/art_aui.py +1283 -0
- wx/lib/agw/ribbon/art_default.py +81 -0
- wx/lib/agw/ribbon/art_internal.py +248 -0
- wx/lib/agw/ribbon/art_msw.py +2735 -0
- wx/lib/agw/ribbon/art_osx.py +52 -0
- wx/lib/agw/ribbon/bar.py +1259 -0
- wx/lib/agw/ribbon/buttonbar.py +1317 -0
- wx/lib/agw/ribbon/control.py +205 -0
- wx/lib/agw/ribbon/gallery.py +973 -0
- wx/lib/agw/ribbon/page.py +946 -0
- wx/lib/agw/ribbon/panel.py +1170 -0
- wx/lib/agw/ribbon/toolbar.py +1441 -0
- wx/lib/agw/rulerctrl.py +1885 -0
- wx/lib/agw/scrolledthumbnail.py +2116 -0
- wx/lib/agw/shapedbutton.py +1809 -0
- wx/lib/agw/shortcuteditor.py +2642 -0
- wx/lib/agw/speedmeter.py +1800 -0
- wx/lib/agw/supertooltip.py +1443 -0
- wx/lib/agw/thumbnailctrl.py +529 -0
- wx/lib/agw/toasterbox.py +1327 -0
- wx/lib/agw/ultimatelistctrl.py +13671 -0
- wx/lib/agw/xlsgrid.py +2111 -0
- wx/lib/agw/zoombar.py +1336 -0
- wx/lib/analogclock/__init__.py +140 -0
- wx/lib/analogclock/analogclock.py +630 -0
- wx/lib/analogclock/helpers.py +986 -0
- wx/lib/analogclock/lib_setup/__init__.py +0 -0
- wx/lib/analogclock/lib_setup/buttontreectrlpanel.py +297 -0
- wx/lib/analogclock/lib_setup/fontselect.py +57 -0
- wx/lib/analogclock/setup.py +490 -0
- wx/lib/analogclock/styles.py +47 -0
- wx/lib/anchors.py +103 -0
- wx/lib/art/__init__.py +4 -0
- wx/lib/art/flagart.py +1583 -0
- wx/lib/art/img2pyartprov.py +56 -0
- wx/lib/busy.py +152 -0
- wx/lib/buttons.py +1140 -0
- wx/lib/calendar.py +1596 -0
- wx/lib/checkbox.py +837 -0
- wx/lib/colourchooser/__init__.py +36 -0
- wx/lib/colourchooser/canvas.py +145 -0
- wx/lib/colourchooser/intl.py +24 -0
- wx/lib/colourchooser/pycolourbox.py +89 -0
- wx/lib/colourchooser/pycolourchooser.py +626 -0
- wx/lib/colourchooser/pycolourslider.py +98 -0
- wx/lib/colourchooser/pypalette.py +208 -0
- wx/lib/colourdb.py +740 -0
- wx/lib/colourselect.py +385 -0
- wx/lib/colourutils.py +118 -0
- wx/lib/combotreebox.py +944 -0
- wx/lib/delayedresult.py +420 -0
- wx/lib/dialogs.py +510 -0
- wx/lib/docview.py +3210 -0
- wx/lib/dragscroller.py +79 -0
- wx/lib/editor/README.txt +77 -0
- wx/lib/editor/__init__.py +24 -0
- wx/lib/editor/editor.py +974 -0
- wx/lib/editor/images.py +15 -0
- wx/lib/editor/selection.py +44 -0
- wx/lib/embeddedimage.py +76 -0
- wx/lib/eventStack.py +136 -0
- wx/lib/eventwatcher.py +440 -0
- wx/lib/evtmgr.py +521 -0
- wx/lib/expando.py +393 -0
- wx/lib/fancytext.py +494 -0
- wx/lib/filebrowsebutton.py +461 -0
- wx/lib/flashwin.py +262 -0
- wx/lib/flashwin_old.py +651 -0
- wx/lib/floatcanvas/FCEvents.py +53 -0
- wx/lib/floatcanvas/FCObjects.py +2910 -0
- wx/lib/floatcanvas/FloatCanvas.py +1025 -0
- wx/lib/floatcanvas/GUIMode.py +396 -0
- wx/lib/floatcanvas/NavCanvas.py +162 -0
- wx/lib/floatcanvas/Resources.py +319 -0
- wx/lib/floatcanvas/ScreenShot.py +1788 -0
- wx/lib/floatcanvas/Utilities/BBox.py +313 -0
- wx/lib/floatcanvas/Utilities/Colors.py +137 -0
- wx/lib/floatcanvas/Utilities/GUI.py +91 -0
- wx/lib/floatcanvas/Utilities/__init__.py +7 -0
- wx/lib/floatcanvas/__init__.py +124 -0
- wx/lib/foldmenu.py +89 -0
- wx/lib/gestures.py +310 -0
- wx/lib/gizmos/__init__.py +18 -0
- wx/lib/gizmos/dynamicsash.py +1202 -0
- wx/lib/gizmos/ledctrl.py +299 -0
- wx/lib/gizmos/treelistctrl.py +87 -0
- wx/lib/graphics.py +1942 -0
- wx/lib/gridmovers.py +516 -0
- wx/lib/iewin.py +249 -0
- wx/lib/iewin_old.py +894 -0
- wx/lib/imagebrowser.py +853 -0
- wx/lib/imageutils.py +163 -0
- wx/lib/infoframe.py +490 -0
- wx/lib/inspection.py +1254 -0
- wx/lib/intctrl.py +990 -0
- wx/lib/itemspicker.py +256 -0
- wx/lib/langlistctrl.py +480 -0
- wx/lib/layoutf.py +271 -0
- wx/lib/masked/__init__.py +27 -0
- wx/lib/masked/combobox.py +839 -0
- wx/lib/masked/ctrl.py +108 -0
- wx/lib/masked/ipaddrctrl.py +241 -0
- wx/lib/masked/maskededit.py +7262 -0
- wx/lib/masked/numctrl.py +2000 -0
- wx/lib/masked/textctrl.py +465 -0
- wx/lib/masked/timectrl.py +1465 -0
- wx/lib/mixins/__init__.py +17 -0
- wx/lib/mixins/grid.py +47 -0
- wx/lib/mixins/gridlabelrenderer.py +277 -0
- wx/lib/mixins/imagelist.py +77 -0
- wx/lib/mixins/inspection.py +184 -0
- wx/lib/mixins/listctrl.py +893 -0
- wx/lib/mixins/rubberband.py +403 -0
- wx/lib/mixins/treemixin.py +678 -0
- wx/lib/msgpanel.py +95 -0
- wx/lib/multisash.py +746 -0
- wx/lib/myole4ax.idl +178 -0
- wx/lib/myole4ax.tlb +0 -0
- wx/lib/newevent.py +229 -0
- wx/lib/newevent.pyi +25 -0
- wx/lib/nvdlg.py +156 -0
- wx/lib/ogl/__init__.py +13 -0
- wx/lib/ogl/basic.py +3989 -0
- wx/lib/ogl/bmpshape.py +86 -0
- wx/lib/ogl/canvas.py +467 -0
- wx/lib/ogl/composit.py +1576 -0
- wx/lib/ogl/diagram.py +230 -0
- wx/lib/ogl/divided.py +482 -0
- wx/lib/ogl/drawn.py +898 -0
- wx/lib/ogl/lines.py +1809 -0
- wx/lib/ogl/oglmisc.py +607 -0
- wx/lib/pdfviewer/__init__.py +113 -0
- wx/lib/pdfviewer/bitmaps/ArrowLeft.png +0 -0
- wx/lib/pdfviewer/bitmaps/ArrowRight.png +0 -0
- wx/lib/pdfviewer/bitmaps/DirectionH.png +0 -0
- wx/lib/pdfviewer/bitmaps/DirectionV.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerFirst.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerLast.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerNext.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerPrev.png +0 -0
- wx/lib/pdfviewer/bitmaps/Printer.png +0 -0
- wx/lib/pdfviewer/bitmaps/ReadMe.txt +28 -0
- wx/lib/pdfviewer/bitmaps/Save.png +0 -0
- wx/lib/pdfviewer/bitmaps/ZoomIn.png +0 -0
- wx/lib/pdfviewer/bitmaps/ZoomOut.png +0 -0
- wx/lib/pdfviewer/bitmaps/encode_bitmaps.py +37 -0
- wx/lib/pdfviewer/buttonpanel.py +285 -0
- wx/lib/pdfviewer/images.py +240 -0
- wx/lib/pdfviewer/viewer.py +1118 -0
- wx/lib/pdfwin.py +295 -0
- wx/lib/pdfwin_old.py +789 -0
- wx/lib/platebtn.py +789 -0
- wx/lib/plot/CHANGELOG.md +150 -0
- wx/lib/plot/README.md +16 -0
- wx/lib/plot/__init__.py +46 -0
- wx/lib/plot/__main__.py +5 -0
- wx/lib/plot/examples/__init__.py +0 -0
- wx/lib/plot/examples/demo.py +1010 -0
- wx/lib/plot/examples/simple_example.py +56 -0
- wx/lib/plot/plotcanvas.py +2985 -0
- wx/lib/plot/polyobjects.py +1524 -0
- wx/lib/plot/utils.py +334 -0
- wx/lib/popupctl.py +251 -0
- wx/lib/printout.py +1155 -0
- wx/lib/progressindicator.py +151 -0
- wx/lib/pubsub/LICENSE_BSD_Simple.txt +23 -0
- wx/lib/pubsub/README_WxPython.txt +22 -0
- wx/lib/pubsub/RELEASE_NOTES.txt +71 -0
- wx/lib/pubsub/__init__.py +25 -0
- wx/lib/pubsub/core/__init__.py +92 -0
- wx/lib/pubsub/core/arg1/__init__.py +16 -0
- wx/lib/pubsub/core/arg1/listenerimpl.py +97 -0
- wx/lib/pubsub/core/arg1/publisher.py +40 -0
- wx/lib/pubsub/core/arg1/publishermixin.py +34 -0
- wx/lib/pubsub/core/arg1/topicargspecimpl.py +66 -0
- wx/lib/pubsub/core/arg1/topicmgrimpl.py +19 -0
- wx/lib/pubsub/core/callables.py +198 -0
- wx/lib/pubsub/core/imp2.py +62 -0
- wx/lib/pubsub/core/itopicdefnprovider.py +0 -0
- wx/lib/pubsub/core/kwargs/__init__.py +16 -0
- wx/lib/pubsub/core/kwargs/datamsg.py +27 -0
- wx/lib/pubsub/core/kwargs/listenerimpl.py +93 -0
- wx/lib/pubsub/core/kwargs/publisher.py +77 -0
- wx/lib/pubsub/core/kwargs/publishermixin.py +65 -0
- wx/lib/pubsub/core/kwargs/topicargspecimpl.py +216 -0
- wx/lib/pubsub/core/kwargs/topicmgrimpl.py +13 -0
- wx/lib/pubsub/core/listener.py +40 -0
- wx/lib/pubsub/core/listenerbase.py +185 -0
- wx/lib/pubsub/core/notificationmgr.py +185 -0
- wx/lib/pubsub/core/publisherbase.py +189 -0
- wx/lib/pubsub/core/topicargspec.py +77 -0
- wx/lib/pubsub/core/topicdefnprovider.py +631 -0
- wx/lib/pubsub/core/topicexc.py +72 -0
- wx/lib/pubsub/core/topicmgr.py +454 -0
- wx/lib/pubsub/core/topicobj.py +472 -0
- wx/lib/pubsub/core/topictreetraverser.py +143 -0
- wx/lib/pubsub/core/topicutils.py +119 -0
- wx/lib/pubsub/core/treeconfig.py +21 -0
- wx/lib/pubsub/core/validatedefnargs.py +29 -0
- wx/lib/pubsub/core/weakmethod.py +102 -0
- wx/lib/pubsub/policies.py +24 -0
- wx/lib/pubsub/pub.py +199 -0
- wx/lib/pubsub/setuparg1.py +47 -0
- wx/lib/pubsub/setupkwargs.py +29 -0
- wx/lib/pubsub/utils/__init__.py +27 -0
- wx/lib/pubsub/utils/exchandling.py +100 -0
- wx/lib/pubsub/utils/misc.py +99 -0
- wx/lib/pubsub/utils/notification.py +331 -0
- wx/lib/pubsub/utils/topictreeprinter.py +195 -0
- wx/lib/pubsub/utils/xmltopicdefnprovider.py +286 -0
- wx/lib/pydocview.py +3300 -0
- wx/lib/rcsizer.py +227 -0
- wx/lib/resizewidget.py +357 -0
- wx/lib/scrolledpanel.py +243 -0
- wx/lib/sheet.py +350 -0
- wx/lib/sized_controls.py +691 -0
- wx/lib/softwareupdate.py +355 -0
- wx/lib/splitter.py +925 -0
- wx/lib/statbmp.py +199 -0
- wx/lib/stattext.py +321 -0
- wx/lib/throbber.py +424 -0
- wx/lib/ticker.py +306 -0
- wx/lib/ticker_xrc.py +48 -0
- wx/lib/utils.py +89 -0
- wx/lib/wordwrap.py +97 -0
- wx/lib/wxcairo/__init__.py +139 -0
- wx/lib/wxcairo/wx_cairocffi.py +200 -0
- wx/lib/wxcairo/wx_pycairo.py +455 -0
- wx/lib/wxpTag.py +274 -0
- wx/libcairo-2.dll +0 -0
- wx/locale/af/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/an/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ar/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ca/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ca@valencia/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/co/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/cs/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/da/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/de/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/el/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/es/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/eu/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/fa_IR/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/fi/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/fr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/gl_ES/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/hi/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/hr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/hu/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/id/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/it/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ja/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ka/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ko_KR/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/lt/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/lv/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ms/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/nb/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ne/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/nl/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/pl/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/pt/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/pt_BR/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ro/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ru/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sk/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sl/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sq/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sv/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ta/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/tr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/uk/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/vi/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/zh_CN/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/zh_TW/LC_MESSAGES/wxstd.mo +0 -0
- wx/media.py +30 -0
- wx/media.pyi +272 -0
- wx/msw.py +16 -0
- wx/msw.pyi +91 -0
- wx/propgrid.py +498 -0
- wx/propgrid.pyi +7427 -0
- wx/py/CHANGES.txt +796 -0
- wx/py/Py.ico +0 -0
- wx/py/PyAlaCarte.py +34 -0
- wx/py/PyAlaMode.py +34 -0
- wx/py/PyAlaModeTest.py +33 -0
- wx/py/PyCrust.ico +0 -0
- wx/py/PyCrust.py +78 -0
- wx/py/PyCrust_16.png +0 -0
- wx/py/PyCrust_32.png +0 -0
- wx/py/PyFilling.py +35 -0
- wx/py/PyShell.py +78 -0
- wx/py/PySlices.ico +0 -0
- wx/py/PySlices.py +98 -0
- wx/py/PySlicesShell.py +94 -0
- wx/py/PySlices_16.png +0 -0
- wx/py/PySlices_32.png +0 -0
- wx/py/PyWrap.py +52 -0
- wx/py/README.txt +77 -0
- wx/py/__init__.py +20 -0
- wx/py/buffer.py +136 -0
- wx/py/crust.py +403 -0
- wx/py/crustslices.py +403 -0
- wx/py/dispatcher.py +259 -0
- wx/py/document.py +37 -0
- wx/py/editor.py +844 -0
- wx/py/editwindow.py +316 -0
- wx/py/filling.py +358 -0
- wx/py/frame.py +976 -0
- wx/py/images.py +212 -0
- wx/py/interpreter.py +161 -0
- wx/py/introspect.py +402 -0
- wx/py/magic.py +98 -0
- wx/py/parse.py +134 -0
- wx/py/path.py +36 -0
- wx/py/pseudo.py +99 -0
- wx/py/shell.py +1579 -0
- wx/py/sliceshell.py +3805 -0
- wx/py/tests/test_interpreter.py +71 -0
- wx/py/tests/test_introspect.py +810 -0
- wx/py/tests/test_pseudo.py +70 -0
- wx/py/tests/test_version.py +36 -0
- wx/py/tests/testall.py +22 -0
- wx/py/version.py +7 -0
- wx/py.typed +0 -0
- wx/ribbon.py +48 -0
- wx/ribbon.pyi +3099 -0
- wx/richtext.py +141 -0
- wx/richtext.pyi +13581 -0
- wx/siplib.cp315-win_amd64.pyd +0 -0
- wx/siplib.pyi +19 -0
- wx/stc.py +59 -0
- wx/stc.pyi +9918 -0
- wx/svg/__init__.py +363 -0
- wx/svg/_nanosvg.cp315-win_amd64.pyd +0 -0
- wx/tools/__init__.py +18 -0
- wx/tools/dbg.py +268 -0
- wx/tools/genaxmodule.py +50 -0
- wx/tools/helpviewer.py +92 -0
- wx/tools/img2img.py +85 -0
- wx/tools/img2png.py +54 -0
- wx/tools/img2py.py +306 -0
- wx/tools/img2xpm.py +54 -0
- wx/tools/pywxrc.py +951 -0
- wx/tools/wxget.py +254 -0
- wx/tools/wxget_docs_demo.py +183 -0
- wx/wxbase334u_net_vc140_x64.dll +0 -0
- wx/wxbase334u_vc140_x64.dll +0 -0
- wx/wxbase334u_xml_vc140_x64.dll +0 -0
- wx/wxmsw334u_adv_vc140_x64.dll +0 -0
- wx/wxmsw334u_aui_vc140_x64.dll +0 -0
- wx/wxmsw334u_core_vc140_x64.dll +0 -0
- wx/wxmsw334u_gl_vc140_x64.dll +0 -0
- wx/wxmsw334u_html_vc140_x64.dll +0 -0
- wx/wxmsw334u_media_vc140_x64.dll +0 -0
- wx/wxmsw334u_propgrid_vc140_x64.dll +0 -0
- wx/wxmsw334u_qa_vc140_x64.dll +0 -0
- wx/wxmsw334u_ribbon_vc140_x64.dll +0 -0
- wx/wxmsw334u_richtext_vc140_x64.dll +0 -0
- wx/wxmsw334u_stc_vc140_x64.dll +0 -0
- wx/wxmsw334u_webview_vc140_x64.dll +0 -0
- wx/wxmsw334u_xrc_vc140_x64.dll +0 -0
- wx/xml.py +18 -0
- wx/xml.pyi +728 -0
- wx/xrc.py +68 -0
- wx/xrc.pyi +896 -0
- wxpython-4.3.2.dist-info/METADATA +71 -0
- wxpython-4.3.2.dist-info/RECORD +472 -0
- wxpython-4.3.2.dist-info/WHEEL +5 -0
- wxpython-4.3.2.dist-info/entry_points.txt +13 -0
- wxpython-4.3.2.dist-info/licenses/LICENSE.txt +610 -0
- wxpython-4.3.2.dist-info/top_level.txt +1 -0
wx/py/crustslices.py
ADDED
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
"""PySlices combines the slices and filling into one control."""
|
|
2
|
+
|
|
3
|
+
__author__ = "David N. Mashburn <david.n.mashburn@gmail.com> / "
|
|
4
|
+
__author__ += "Patrick K. O'Brien <pobrien@orbtech.com>"
|
|
5
|
+
|
|
6
|
+
import wx
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
import pprint
|
|
10
|
+
import re
|
|
11
|
+
import sys
|
|
12
|
+
|
|
13
|
+
from . import dispatcher
|
|
14
|
+
from . import crust
|
|
15
|
+
from . import document
|
|
16
|
+
from . import editwindow
|
|
17
|
+
from . import editor
|
|
18
|
+
from .filling import Filling
|
|
19
|
+
from . import frame
|
|
20
|
+
from .sliceshell import SlicesShell
|
|
21
|
+
from .version import VERSION
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class CrustSlices(crust.Crust):
|
|
25
|
+
"""Slices based on SplitterWindow."""
|
|
26
|
+
|
|
27
|
+
name = 'Slices'
|
|
28
|
+
sashoffset = 300
|
|
29
|
+
|
|
30
|
+
def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
|
|
31
|
+
size=wx.DefaultSize, style=wx.SP_3D|wx.SP_LIVE_UPDATE,
|
|
32
|
+
name='Slices Window', rootObject=None, rootLabel=None,
|
|
33
|
+
rootIsNamespace=True, intro='', locals=None,
|
|
34
|
+
InterpClass=None,
|
|
35
|
+
startupScript=None, execStartupScript=True,
|
|
36
|
+
showPySlicesTutorial=True,
|
|
37
|
+
enableShellMode=False, hideFoldingMargin=False,
|
|
38
|
+
*args, **kwds):
|
|
39
|
+
"""Create CrustSlices instance."""
|
|
40
|
+
wx.SplitterWindow.__init__(self, parent, id, pos, size, style, name)
|
|
41
|
+
|
|
42
|
+
# Turn off the tab-traversal style that is automatically
|
|
43
|
+
# turned on by wx.SplitterWindow. We do this because on
|
|
44
|
+
# Windows the event for Ctrl-Enter is stolen and used as a
|
|
45
|
+
# navigation key, but the SlicesShell window uses it to insert lines.
|
|
46
|
+
style = self.GetWindowStyle()
|
|
47
|
+
self.SetWindowStyle(style & ~wx.TAB_TRAVERSAL)
|
|
48
|
+
|
|
49
|
+
self.sliceshell = SlicesShell(parent=self, introText=intro,
|
|
50
|
+
locals=locals, InterpClass=InterpClass,
|
|
51
|
+
startupScript=startupScript,
|
|
52
|
+
execStartupScript=execStartupScript,
|
|
53
|
+
showPySlicesTutorial=showPySlicesTutorial,
|
|
54
|
+
enableShellMode=enableShellMode,
|
|
55
|
+
hideFoldingMargin=hideFoldingMargin,
|
|
56
|
+
*args, **kwds)
|
|
57
|
+
|
|
58
|
+
self.editor = self.sliceshell
|
|
59
|
+
self.shell = self.sliceshell
|
|
60
|
+
if rootObject is None:
|
|
61
|
+
rootObject = self.sliceshell.interp.locals
|
|
62
|
+
self.notebook = wx.Notebook(parent=self, id=-1)
|
|
63
|
+
self.sliceshell.interp.locals['notebook'] = self.notebook
|
|
64
|
+
self.filling = Filling(parent=self.notebook,
|
|
65
|
+
rootObject=rootObject,
|
|
66
|
+
rootLabel=rootLabel,
|
|
67
|
+
rootIsNamespace=rootIsNamespace)
|
|
68
|
+
# Add 'filling' to the interpreter's locals.
|
|
69
|
+
self.sliceshell.interp.locals['filling'] = self.filling
|
|
70
|
+
self.notebook.AddPage(page=self.filling, text='Namespace', select=True)
|
|
71
|
+
|
|
72
|
+
self.display = crust.Display(parent=self.notebook)
|
|
73
|
+
self.notebook.AddPage(page=self.display, text='Display')
|
|
74
|
+
# Add 'pp' (pretty print) to the interpreter's locals.
|
|
75
|
+
self.sliceshell.interp.locals['pp'] = self.display.setItem
|
|
76
|
+
self.display.nbTab = self.notebook.GetPageCount()-1
|
|
77
|
+
|
|
78
|
+
self.calltip = crust.Calltip(parent=self.notebook,ShellClassName='SlicesShell')
|
|
79
|
+
self.notebook.AddPage(page=self.calltip, text='Calltip')
|
|
80
|
+
|
|
81
|
+
self.sessionlisting = crust.SessionListing(parent=self.notebook,ShellClassName='SlicesShell')
|
|
82
|
+
self.notebook.AddPage(page=self.sessionlisting, text='History')
|
|
83
|
+
|
|
84
|
+
self.dispatcherlisting = crust.DispatcherListing(parent=self.notebook)
|
|
85
|
+
self.notebook.AddPage(page=self.dispatcherlisting, text='Dispatcher')
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
# Initialize in an unsplit mode, and check later after loading
|
|
89
|
+
# settings if we should split or not.
|
|
90
|
+
self.sliceshell.Hide()
|
|
91
|
+
self.notebook.Hide()
|
|
92
|
+
self.Initialize(self.sliceshell)
|
|
93
|
+
self._shouldsplit = True
|
|
94
|
+
wx.CallAfter(self._CheckShouldSplit)
|
|
95
|
+
self.SetMinimumPaneSize(100)
|
|
96
|
+
|
|
97
|
+
self.Bind(wx.EVT_SIZE, self.SplitterOnSize)
|
|
98
|
+
self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.OnChanged)
|
|
99
|
+
self.Bind(wx.EVT_SPLITTER_DCLICK, self.OnSashDClick)
|
|
100
|
+
|
|
101
|
+
class CrustSlicesFrame(crust.CrustFrame):
|
|
102
|
+
"""Frame containing all the PySlices components."""
|
|
103
|
+
|
|
104
|
+
name = 'SliceFrame'
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def __init__(self, parent=None, id=-1, title='PySlices',
|
|
108
|
+
pos=wx.DefaultPosition, size=wx.DefaultSize,
|
|
109
|
+
style=wx.DEFAULT_FRAME_STYLE,
|
|
110
|
+
rootObject=None, rootLabel=None, rootIsNamespace=True,
|
|
111
|
+
locals=None, InterpClass=None,
|
|
112
|
+
config=None, dataDir=None, filename=None,
|
|
113
|
+
*args, **kwds):
|
|
114
|
+
"""Create CrustFrame instance."""
|
|
115
|
+
frame.Frame.__init__(self, parent, id, title, pos, size, style,
|
|
116
|
+
shellName='PySlices')
|
|
117
|
+
frame.ShellFrameMixin.__init__(self, config, dataDir)
|
|
118
|
+
|
|
119
|
+
if size == wx.DefaultSize:
|
|
120
|
+
self.SetSize((800, 600))
|
|
121
|
+
|
|
122
|
+
intro = 'PySlices %s - The Flakiest Python Shell... Cut up!' % VERSION
|
|
123
|
+
|
|
124
|
+
self.SetStatusText(intro.replace('\n', ', '))
|
|
125
|
+
self.crust = CrustSlices(parent=self, intro=intro,
|
|
126
|
+
rootObject=rootObject,
|
|
127
|
+
rootLabel=rootLabel,
|
|
128
|
+
rootIsNamespace=rootIsNamespace,
|
|
129
|
+
locals=locals,
|
|
130
|
+
InterpClass=InterpClass,
|
|
131
|
+
startupScript=self.startupScript,
|
|
132
|
+
execStartupScript=self.execStartupScript,
|
|
133
|
+
showPySlicesTutorial=self.showPySlicesTutorial,
|
|
134
|
+
enableShellMode=self.enableShellMode,
|
|
135
|
+
hideFoldingMargin=self.hideFoldingMargin,
|
|
136
|
+
*args, **kwds)
|
|
137
|
+
self.sliceshell = self.crust.sliceshell
|
|
138
|
+
self.shell = self.sliceshell
|
|
139
|
+
self.buffer = self.sliceshell.buffer
|
|
140
|
+
# Override the filling so that status messages go to the status bar.
|
|
141
|
+
self.crust.filling.tree.setStatusText = self.SetStatusText
|
|
142
|
+
|
|
143
|
+
# Override the shell so that status messages go to the status bar.
|
|
144
|
+
self.sliceshell.setStatusText = self.SetStatusText
|
|
145
|
+
|
|
146
|
+
self.sliceshell.SetFocus()
|
|
147
|
+
self.LoadSettings()
|
|
148
|
+
|
|
149
|
+
self.currentDirectory = os.path.expanduser('~')
|
|
150
|
+
|
|
151
|
+
if filename!=None:
|
|
152
|
+
self.bufferOpen(filename)
|
|
153
|
+
|
|
154
|
+
self.Bind(wx.EVT_IDLE, self.OnIdle)
|
|
155
|
+
|
|
156
|
+
def OnClose(self, event):
|
|
157
|
+
"""Event handler for closing."""
|
|
158
|
+
self.bufferClose()
|
|
159
|
+
|
|
160
|
+
def OnAbout(self, event):
|
|
161
|
+
"""Display an About window."""
|
|
162
|
+
title = 'About PySlices'
|
|
163
|
+
text = 'PySlices %s\n\n' % VERSION + \
|
|
164
|
+
'Yet another Python shell, only flakier.\n\n' + \
|
|
165
|
+
'Half-baked by Patrick K. O\'Brien,\n' + \
|
|
166
|
+
'the other half is still in the oven.\n\n' + \
|
|
167
|
+
'Platform: %s\n' % sys.platform + \
|
|
168
|
+
'Python Version: %s\n' % sys.version.split()[0] + \
|
|
169
|
+
'wxPython Version: %s\n' % wx.VERSION_STRING + \
|
|
170
|
+
('\t(%s)\n' % ", ".join(wx.PlatformInfo[1:]))
|
|
171
|
+
dialog = wx.MessageDialog(self, text, title,
|
|
172
|
+
wx.OK | wx.ICON_INFORMATION)
|
|
173
|
+
dialog.ShowModal()
|
|
174
|
+
dialog.Destroy()
|
|
175
|
+
|
|
176
|
+
def OnEnableShellMode(self,event):
|
|
177
|
+
"""Change between Slices Mode and Shell Mode"""
|
|
178
|
+
frame.Frame.OnEnableShellMode(self,event)
|
|
179
|
+
self.sliceshell.ToggleShellMode(self.enableShellMode)
|
|
180
|
+
|
|
181
|
+
def OnHideFoldingMargin(self,event):
|
|
182
|
+
"""Change between Slices Mode and Shell Mode"""
|
|
183
|
+
frame.Frame.OnHideFoldingMargin(self,event)
|
|
184
|
+
self.sliceshell.ToggleFoldingMargin(self.hideFoldingMargin)
|
|
185
|
+
|
|
186
|
+
# Stolen Straight from editor.EditorFrame
|
|
187
|
+
# Modified a little... :)
|
|
188
|
+
# ||
|
|
189
|
+
# \/
|
|
190
|
+
def OnIdle(self, event):
|
|
191
|
+
"""Event handler for idle time."""
|
|
192
|
+
self._updateTitle()
|
|
193
|
+
event.Skip()
|
|
194
|
+
|
|
195
|
+
def _updateTitle(self):
|
|
196
|
+
"""Show current title information."""
|
|
197
|
+
title = self.GetTitle()
|
|
198
|
+
if self.bufferHasChanged():
|
|
199
|
+
if title.startswith('* '):
|
|
200
|
+
pass
|
|
201
|
+
else:
|
|
202
|
+
self.SetTitle('* ' + title)
|
|
203
|
+
else:
|
|
204
|
+
if title.startswith('* '):
|
|
205
|
+
self.SetTitle(title[2:])
|
|
206
|
+
|
|
207
|
+
def hasBuffer(self):
|
|
208
|
+
"""Return True if there is a current buffer."""
|
|
209
|
+
if self.buffer:
|
|
210
|
+
return True
|
|
211
|
+
else:
|
|
212
|
+
return False
|
|
213
|
+
|
|
214
|
+
def bufferClose(self):
|
|
215
|
+
"""Close buffer."""
|
|
216
|
+
if self.buffer.hasChanged():
|
|
217
|
+
cancel = self.bufferSuggestSave()
|
|
218
|
+
if cancel:
|
|
219
|
+
#event.Veto()
|
|
220
|
+
return cancel
|
|
221
|
+
self.SaveSettings()
|
|
222
|
+
self.crust.sliceshell.destroy()
|
|
223
|
+
self.bufferDestroy()
|
|
224
|
+
self.Destroy()
|
|
225
|
+
|
|
226
|
+
return False
|
|
227
|
+
|
|
228
|
+
def bufferCreate(self, filename=None):
|
|
229
|
+
"""Create new buffer."""
|
|
230
|
+
self.bufferDestroy()
|
|
231
|
+
buffer = Buffer()
|
|
232
|
+
self.panel = panel = wx.Panel(parent=self, id=-1)
|
|
233
|
+
panel.Bind (wx.EVT_ERASE_BACKGROUND, lambda x: x)
|
|
234
|
+
editor = Editor(parent=panel)
|
|
235
|
+
panel.editor = editor
|
|
236
|
+
sizer = wx.BoxSizer(wx.VERTICAL)
|
|
237
|
+
sizer.Add(editor.window, 1, wx.EXPAND)
|
|
238
|
+
panel.SetSizer(sizer)
|
|
239
|
+
panel.SetAutoLayout(True)
|
|
240
|
+
sizer.Layout()
|
|
241
|
+
buffer.addEditor(editor)
|
|
242
|
+
buffer.open(filename)
|
|
243
|
+
self.setEditor(editor)
|
|
244
|
+
self.editor.setFocus()
|
|
245
|
+
self.SendSizeEvent()
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def bufferDestroy(self):
|
|
249
|
+
"""Destroy the current buffer."""
|
|
250
|
+
if self.buffer:
|
|
251
|
+
self.editor = None
|
|
252
|
+
self.buffer = None
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def bufferHasChanged(self):
|
|
256
|
+
"""Return True if buffer has changed since last save."""
|
|
257
|
+
if self.buffer:
|
|
258
|
+
return self.buffer.hasChanged()
|
|
259
|
+
else:
|
|
260
|
+
return False
|
|
261
|
+
|
|
262
|
+
def bufferNew(self):
|
|
263
|
+
"""Create new buffer."""
|
|
264
|
+
cancel = self.bufferSuggestSave()
|
|
265
|
+
if cancel:
|
|
266
|
+
return cancel
|
|
267
|
+
self.sliceshell.clear()
|
|
268
|
+
self.SetTitle( 'PySlices')
|
|
269
|
+
self.sliceshell.NeedsCheckForSave=False
|
|
270
|
+
self.sliceshell.SetSavePoint()
|
|
271
|
+
self.buffer.doc = document.Document()
|
|
272
|
+
self.buffer.name = 'This shell'
|
|
273
|
+
self.buffer.modulename = self.buffer.doc.filebase
|
|
274
|
+
#self.bufferCreate()
|
|
275
|
+
cancel = False
|
|
276
|
+
return cancel
|
|
277
|
+
|
|
278
|
+
def bufferOpen(self,file=None):
|
|
279
|
+
"""Open file in buffer."""
|
|
280
|
+
if self.bufferHasChanged():
|
|
281
|
+
cancel = self.bufferSuggestSave()
|
|
282
|
+
if cancel:
|
|
283
|
+
return cancel
|
|
284
|
+
|
|
285
|
+
if file==None:
|
|
286
|
+
file=wx.FileSelector('Open a PySlices File',
|
|
287
|
+
wildcard='*.pyslices',
|
|
288
|
+
default_path=self.currentDirectory)
|
|
289
|
+
if file!=None and file!=u'':
|
|
290
|
+
with open(file,'r') as fid:
|
|
291
|
+
self.sliceshell.LoadPySlicesFile(fid)
|
|
292
|
+
self.currentDirectory = os.path.split(file)[0]
|
|
293
|
+
self.SetTitle( os.path.split(file)[1] + ' - PySlices')
|
|
294
|
+
self.sliceshell.NeedsCheckForSave=False
|
|
295
|
+
self.sliceshell.SetSavePoint()
|
|
296
|
+
self.buffer.doc = document.Document(file)
|
|
297
|
+
self.buffer.name = self.buffer.doc.filename
|
|
298
|
+
self.buffer.modulename = self.buffer.doc.filebase
|
|
299
|
+
self.sliceshell.ScrollToLine(0)
|
|
300
|
+
return
|
|
301
|
+
|
|
302
|
+
## def bufferPrint(self):
|
|
303
|
+
## """Print buffer."""
|
|
304
|
+
## pass
|
|
305
|
+
|
|
306
|
+
## def bufferRevert(self):
|
|
307
|
+
## """Revert buffer to version of file on disk."""
|
|
308
|
+
## pass
|
|
309
|
+
|
|
310
|
+
# was self.buffer.save(self): # """Save buffer."""
|
|
311
|
+
def simpleSave(self,confirmed=False):
|
|
312
|
+
filepath = self.buffer.doc.filepath
|
|
313
|
+
self.buffer.confirmed = confirmed
|
|
314
|
+
if not filepath:
|
|
315
|
+
return # XXX Get filename
|
|
316
|
+
if not os.path.exists(filepath):
|
|
317
|
+
self.buffer.confirmed = True
|
|
318
|
+
if not self.buffer.confirmed:
|
|
319
|
+
self.buffer.confirmed = self.buffer.overwriteConfirm(filepath)
|
|
320
|
+
if self.buffer.confirmed:
|
|
321
|
+
with open(filepath, 'wb') as fid:
|
|
322
|
+
self.sliceshell.SavePySlicesFile(fid)
|
|
323
|
+
|
|
324
|
+
self.sliceshell.SetSavePoint()
|
|
325
|
+
self.SetTitle( os.path.split(filepath)[1] + ' - PySlices')
|
|
326
|
+
self.sliceshell.NeedsCheckForSave=False
|
|
327
|
+
|
|
328
|
+
def bufferSave(self):
|
|
329
|
+
"""Save buffer to its file."""
|
|
330
|
+
if self.buffer.doc.filepath:
|
|
331
|
+
# self.buffer.save()
|
|
332
|
+
self.simpleSave(confirmed=True)
|
|
333
|
+
cancel = False
|
|
334
|
+
else:
|
|
335
|
+
cancel = self.bufferSaveAs()
|
|
336
|
+
return cancel
|
|
337
|
+
|
|
338
|
+
def bufferSaveAs(self):
|
|
339
|
+
"""Save buffer to a new filename."""
|
|
340
|
+
if self.bufferHasChanged() and self.buffer.doc.filepath:
|
|
341
|
+
cancel = self.bufferSuggestSave()
|
|
342
|
+
if cancel:
|
|
343
|
+
return cancel
|
|
344
|
+
filedir = ''
|
|
345
|
+
if self.buffer and self.buffer.doc.filedir:
|
|
346
|
+
filedir = self.buffer.doc.filedir
|
|
347
|
+
result = editor.saveSingle(title='Save PySlices File',directory=filedir,
|
|
348
|
+
wildcard='PySlices Files (*.pyslices)|*.pyslices')
|
|
349
|
+
if result.path not in ['',None]:
|
|
350
|
+
if result.path[-9:]!=".pyslices":
|
|
351
|
+
result.path+=".pyslices"
|
|
352
|
+
|
|
353
|
+
self.buffer.doc = document.Document(result.path)
|
|
354
|
+
self.buffer.name = self.buffer.doc.filename
|
|
355
|
+
self.buffer.modulename = self.buffer.doc.filebase
|
|
356
|
+
self.simpleSave(confirmed=True) # allow overwrite
|
|
357
|
+
cancel = False
|
|
358
|
+
else:
|
|
359
|
+
cancel = True
|
|
360
|
+
return cancel
|
|
361
|
+
|
|
362
|
+
def bufferSaveACopy(self):
|
|
363
|
+
"""Save buffer to a new filename."""
|
|
364
|
+
filedir = ''
|
|
365
|
+
if self.buffer and self.buffer.doc.filedir:
|
|
366
|
+
filedir = self.buffer.doc.filedir
|
|
367
|
+
result = editor.saveSingle(title='Save a Copy of PySlices File',directory=filedir,
|
|
368
|
+
wildcard='PySlices Files (*.pyslices)|*.pyslices')
|
|
369
|
+
|
|
370
|
+
if result.path not in ['',None]:
|
|
371
|
+
if result.path[-9:]!=".pyslices":
|
|
372
|
+
result.path+=".pyslices"
|
|
373
|
+
|
|
374
|
+
# if not os.path.exists(result.path):
|
|
375
|
+
# Allow overwrite...
|
|
376
|
+
with open(result.path, 'wb') as fid:
|
|
377
|
+
self.sliceshell.SavePySlicesFile(fid)
|
|
378
|
+
cancel = False
|
|
379
|
+
else:
|
|
380
|
+
cancel = True
|
|
381
|
+
return cancel
|
|
382
|
+
|
|
383
|
+
def bufferSuggestSave(self):
|
|
384
|
+
"""Suggest saving changes. Return True if user selected Cancel."""
|
|
385
|
+
result = editor.messageDialog(parent=None,
|
|
386
|
+
message='%s has changed.\n'
|
|
387
|
+
'Would you like to save it first'
|
|
388
|
+
'?' % self.buffer.name,
|
|
389
|
+
title='Save current file?',
|
|
390
|
+
style=wx.YES_NO | wx.CANCEL | wx.NO_DEFAULT |
|
|
391
|
+
wx.CENTRE | wx.ICON_QUESTION )
|
|
392
|
+
if result.positive:
|
|
393
|
+
cancel = self.bufferSave()
|
|
394
|
+
else:
|
|
395
|
+
cancel = result.text == 'Cancel'
|
|
396
|
+
return cancel
|
|
397
|
+
|
|
398
|
+
def updateNamespace(self):
|
|
399
|
+
"""Update the buffer namespace for autocompletion and calltips."""
|
|
400
|
+
if self.buffer.updateNamespace():
|
|
401
|
+
self.SetStatusText('Namespace updated')
|
|
402
|
+
else:
|
|
403
|
+
self.SetStatusText('Error executing, unable to update namespace')
|
wx/py/dispatcher.py
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"""Provides global signal dispatching services."""
|
|
2
|
+
|
|
3
|
+
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
|
|
4
|
+
|
|
5
|
+
import types
|
|
6
|
+
import weakref
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DispatcherError(Exception):
|
|
10
|
+
def __init__(self, args=None):
|
|
11
|
+
self.args = args
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Parameter:
|
|
15
|
+
"""Used to represent default parameter values."""
|
|
16
|
+
def __repr__(self):
|
|
17
|
+
return self.__class__.__name__
|
|
18
|
+
|
|
19
|
+
class Any(Parameter): pass
|
|
20
|
+
Any = Any()
|
|
21
|
+
|
|
22
|
+
class Anonymous(Parameter): pass
|
|
23
|
+
Anonymous = Anonymous()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
connections = {}
|
|
27
|
+
senders = {}
|
|
28
|
+
_boundMethods = weakref.WeakKeyDictionary()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def connect(receiver, signal=Any, sender=Any, weak=True):
|
|
32
|
+
"""
|
|
33
|
+
Connect receiver to sender for signal.
|
|
34
|
+
|
|
35
|
+
* If sender is Any, receiver will receive signal from any sender.
|
|
36
|
+
* If signal is Any, receiver will receive any signal from sender.
|
|
37
|
+
* If sender is None, receiver will receive signal from Anonymous.
|
|
38
|
+
* If signal is Any and sender is None, receiver will receive any
|
|
39
|
+
signal from Anonymous.
|
|
40
|
+
* If signal is Any and sender is Any, receiver will receive any
|
|
41
|
+
signal from any sender.
|
|
42
|
+
* If weak is true, weak references will be used.
|
|
43
|
+
"""
|
|
44
|
+
if signal is None:
|
|
45
|
+
raise DispatcherError('signal cannot be None')
|
|
46
|
+
if weak:
|
|
47
|
+
receiver = safeRef(receiver)
|
|
48
|
+
senderkey = id(sender)
|
|
49
|
+
signals = {}
|
|
50
|
+
if senderkey in connections:
|
|
51
|
+
signals = connections[senderkey]
|
|
52
|
+
else:
|
|
53
|
+
connections[senderkey] = signals
|
|
54
|
+
# Keep track of senders for cleanup.
|
|
55
|
+
if sender not in (None, Any):
|
|
56
|
+
def remove(object, senderkey=senderkey):
|
|
57
|
+
_removeSender(senderkey=senderkey)
|
|
58
|
+
# Skip objects that can not be weakly referenced, which means
|
|
59
|
+
# they won't be automatically cleaned up, but that's too bad.
|
|
60
|
+
try:
|
|
61
|
+
weakSender = weakref.ref(sender, remove)
|
|
62
|
+
senders[senderkey] = weakSender
|
|
63
|
+
except:
|
|
64
|
+
pass
|
|
65
|
+
receivers = []
|
|
66
|
+
if signal in signals:
|
|
67
|
+
receivers = signals[signal]
|
|
68
|
+
else:
|
|
69
|
+
signals[signal] = receivers
|
|
70
|
+
try:
|
|
71
|
+
receivers.remove(receiver)
|
|
72
|
+
except ValueError:
|
|
73
|
+
pass
|
|
74
|
+
receivers.append(receiver)
|
|
75
|
+
|
|
76
|
+
def disconnect(receiver, signal=Any, sender=Any, weak=True):
|
|
77
|
+
"""Disconnect receiver from sender for signal.
|
|
78
|
+
|
|
79
|
+
Disconnecting is not required. The use of disconnect is the same as for
|
|
80
|
+
connect, only in reverse. Think of it as undoing a previous connection."""
|
|
81
|
+
if signal is None:
|
|
82
|
+
raise DispatcherError('signal cannot be None')
|
|
83
|
+
if weak:
|
|
84
|
+
receiver = safeRef(receiver)
|
|
85
|
+
senderkey = id(sender)
|
|
86
|
+
try:
|
|
87
|
+
receivers = connections[senderkey][signal]
|
|
88
|
+
except KeyError:
|
|
89
|
+
raise DispatcherError('No receivers for signal %r from sender %s' % (signal, sender))
|
|
90
|
+
try:
|
|
91
|
+
receivers.remove(receiver)
|
|
92
|
+
except ValueError:
|
|
93
|
+
raise DispatcherError('No connection to receiver %s for signal %r from sender %s' % (receiver, signal, sender))
|
|
94
|
+
_cleanupConnections(senderkey, signal)
|
|
95
|
+
|
|
96
|
+
def send(signal, sender=Anonymous, **kwds):
|
|
97
|
+
"""Send signal from sender to all connected receivers.
|
|
98
|
+
|
|
99
|
+
Return a list of tuple pairs [(receiver, response), ... ].
|
|
100
|
+
If sender is not specified, signal is sent anonymously."""
|
|
101
|
+
senderkey = id(sender)
|
|
102
|
+
anykey = id(Any)
|
|
103
|
+
# Get receivers that receive *this* signal from *this* sender.
|
|
104
|
+
receivers = []
|
|
105
|
+
try:
|
|
106
|
+
receivers.extend(connections[senderkey][signal])
|
|
107
|
+
except KeyError:
|
|
108
|
+
pass
|
|
109
|
+
# Add receivers that receive *any* signal from *this* sender.
|
|
110
|
+
anyreceivers = []
|
|
111
|
+
try:
|
|
112
|
+
anyreceivers = connections[senderkey][Any]
|
|
113
|
+
except KeyError:
|
|
114
|
+
pass
|
|
115
|
+
for receiver in anyreceivers:
|
|
116
|
+
if receivers.count(receiver) == 0:
|
|
117
|
+
receivers.append(receiver)
|
|
118
|
+
# Add receivers that receive *this* signal from *any* sender.
|
|
119
|
+
anyreceivers = []
|
|
120
|
+
try:
|
|
121
|
+
anyreceivers = connections[anykey][signal]
|
|
122
|
+
except KeyError:
|
|
123
|
+
pass
|
|
124
|
+
for receiver in anyreceivers:
|
|
125
|
+
if receivers.count(receiver) == 0:
|
|
126
|
+
receivers.append(receiver)
|
|
127
|
+
# Add receivers that receive *any* signal from *any* sender.
|
|
128
|
+
anyreceivers = []
|
|
129
|
+
try:
|
|
130
|
+
anyreceivers = connections[anykey][Any]
|
|
131
|
+
except KeyError:
|
|
132
|
+
pass
|
|
133
|
+
for receiver in anyreceivers:
|
|
134
|
+
if receivers.count(receiver) == 0:
|
|
135
|
+
receivers.append(receiver)
|
|
136
|
+
# Call each receiver with whatever arguments it can accept.
|
|
137
|
+
# Return a list of tuple pairs [(receiver, response), ... ].
|
|
138
|
+
responses = []
|
|
139
|
+
for receiver in receivers:
|
|
140
|
+
if type(receiver) is weakref.ReferenceType \
|
|
141
|
+
or isinstance(receiver, BoundMethodWeakref):
|
|
142
|
+
# Dereference the weak reference.
|
|
143
|
+
receiver = receiver()
|
|
144
|
+
if receiver is None:
|
|
145
|
+
# This receiver is dead, so skip it.
|
|
146
|
+
continue
|
|
147
|
+
response = _call(receiver, signal=signal, sender=sender, **kwds)
|
|
148
|
+
responses += [(receiver, response)]
|
|
149
|
+
return responses
|
|
150
|
+
|
|
151
|
+
def _call(receiver, **kwds):
|
|
152
|
+
"""Call receiver with only arguments it can accept."""
|
|
153
|
+
## if type(receiver) is types.InstanceType:
|
|
154
|
+
if hasattr(receiver, '__call__') and \
|
|
155
|
+
(hasattr(receiver.__call__, '__func__') or hasattr(receiver.__call__, '__code__')):
|
|
156
|
+
# receiver is a class instance; assume it is callable.
|
|
157
|
+
# Reassign receiver to the actual method that will be called.
|
|
158
|
+
receiver = receiver.__call__
|
|
159
|
+
if hasattr(receiver, '__func__'):
|
|
160
|
+
# receiver is a method. Drop the first argument, usually 'self'.
|
|
161
|
+
fc = receiver.__func__.__code__
|
|
162
|
+
acceptable = fc.co_varnames[1:fc.co_argcount]
|
|
163
|
+
elif hasattr(receiver, '__code__'):
|
|
164
|
+
# receiver is a function.
|
|
165
|
+
fc = receiver.__code__
|
|
166
|
+
acceptable = fc.co_varnames[0:fc.co_argcount]
|
|
167
|
+
else:
|
|
168
|
+
raise DispatcherError('Unknown receiver %s of type %s' % (receiver, type(receiver)))
|
|
169
|
+
if not (fc.co_flags & 8):
|
|
170
|
+
# fc does not have a **kwds type parameter, therefore
|
|
171
|
+
# remove unacceptable arguments.
|
|
172
|
+
|
|
173
|
+
for arg in list(kwds):
|
|
174
|
+
if arg not in acceptable:
|
|
175
|
+
del kwds[arg]
|
|
176
|
+
return receiver(**kwds)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def safeRef(object):
|
|
180
|
+
"""Return a *safe* weak reference to a callable object."""
|
|
181
|
+
if hasattr(object, '__self__'):
|
|
182
|
+
if object.__self__ is not None:
|
|
183
|
+
# Turn a bound method into a BoundMethodWeakref instance.
|
|
184
|
+
# Keep track of these instances for lookup by disconnect().
|
|
185
|
+
selfkey = object.__self__
|
|
186
|
+
funckey = object.__func__
|
|
187
|
+
if selfkey not in _boundMethods:
|
|
188
|
+
_boundMethods[selfkey] = weakref.WeakKeyDictionary()
|
|
189
|
+
if funckey not in _boundMethods[selfkey]:
|
|
190
|
+
_boundMethods[selfkey][funckey] = \
|
|
191
|
+
BoundMethodWeakref(boundMethod=object)
|
|
192
|
+
return _boundMethods[selfkey][funckey]
|
|
193
|
+
return weakref.ref(object, _removeReceiver)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class BoundMethodWeakref:
|
|
197
|
+
"""BoundMethodWeakref class."""
|
|
198
|
+
|
|
199
|
+
def __init__(self, boundMethod):
|
|
200
|
+
"""Return a weak-reference-like instance for a bound method."""
|
|
201
|
+
self.isDead = 0
|
|
202
|
+
def remove(object, self=self):
|
|
203
|
+
"""Set self.isDead to true when method or instance is destroyed."""
|
|
204
|
+
self.isDead = 1
|
|
205
|
+
_removeReceiver(receiver=self)
|
|
206
|
+
self.weakSelf = weakref.ref(boundMethod.__self__, remove)
|
|
207
|
+
self.weakFunc = weakref.ref(boundMethod.__func__, remove)
|
|
208
|
+
|
|
209
|
+
def __repr__(self):
|
|
210
|
+
"""Return the closest representation."""
|
|
211
|
+
return '<bound method weakref for %s.%s>' % (self.weakSelf, self.weakFunc)
|
|
212
|
+
|
|
213
|
+
def __call__(self):
|
|
214
|
+
"""Return a strong reference to the bound method."""
|
|
215
|
+
if self.isDead:
|
|
216
|
+
return None
|
|
217
|
+
else:
|
|
218
|
+
object = self.weakSelf()
|
|
219
|
+
method = self.weakFunc().__name__
|
|
220
|
+
try: # wxPython hack to handle wxDead objects.
|
|
221
|
+
return getattr(object, method)
|
|
222
|
+
except AttributeError:
|
|
223
|
+
## _removeReceiver(receiver=self)
|
|
224
|
+
return None
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def _removeReceiver(receiver):
|
|
228
|
+
"""Remove receiver from connections."""
|
|
229
|
+
list_keys = [(senderkey, signal)
|
|
230
|
+
for senderkey in connections
|
|
231
|
+
for signal in connections[senderkey]]
|
|
232
|
+
|
|
233
|
+
for senderkey, signal in list_keys:
|
|
234
|
+
try:
|
|
235
|
+
connections[senderkey][signal].remove(receiver)
|
|
236
|
+
except:
|
|
237
|
+
pass
|
|
238
|
+
_cleanupConnections(senderkey, signal)
|
|
239
|
+
|
|
240
|
+
def _cleanupConnections(senderkey, signal):
|
|
241
|
+
"""Delete any empty signals for senderkey. Delete senderkey if empty."""
|
|
242
|
+
receivers = connections[senderkey][signal]
|
|
243
|
+
if not receivers:
|
|
244
|
+
# No more connected receivers. Therefore, remove the signal.
|
|
245
|
+
signals = connections[senderkey]
|
|
246
|
+
del signals[signal]
|
|
247
|
+
if not signals:
|
|
248
|
+
# No more signal connections. Therefore, remove the sender.
|
|
249
|
+
_removeSender(senderkey)
|
|
250
|
+
|
|
251
|
+
def _removeSender(senderkey):
|
|
252
|
+
"""Remove senderkey from connections."""
|
|
253
|
+
del connections[senderkey]
|
|
254
|
+
# Senderkey will only be in senders dictionary if sender
|
|
255
|
+
# could be weakly referenced.
|
|
256
|
+
try:
|
|
257
|
+
del senders[senderkey]
|
|
258
|
+
except:
|
|
259
|
+
pass
|
wx/py/document.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Document class."""
|
|
2
|
+
|
|
3
|
+
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Document:
|
|
9
|
+
"""Document class."""
|
|
10
|
+
|
|
11
|
+
def __init__(self, filename=None):
|
|
12
|
+
"""Create a Document instance."""
|
|
13
|
+
self.filename = filename
|
|
14
|
+
self.filepath = None
|
|
15
|
+
self.filedir = None
|
|
16
|
+
self.filebase = None
|
|
17
|
+
self.fileext = None
|
|
18
|
+
if self.filename:
|
|
19
|
+
self.filepath = os.path.realpath(self.filename)
|
|
20
|
+
self.filedir, self.filename = os.path.split(self.filepath)
|
|
21
|
+
self.filebase, self.fileext = os.path.splitext(self.filename)
|
|
22
|
+
|
|
23
|
+
def read(self):
|
|
24
|
+
"""Return contents of file."""
|
|
25
|
+
if self.filepath and os.path.exists(self.filepath):
|
|
26
|
+
with open(self.filepath, 'rb') as f:
|
|
27
|
+
return f.read().decode('utf-8')
|
|
28
|
+
return ''
|
|
29
|
+
|
|
30
|
+
def write(self, text):
|
|
31
|
+
"""Write text to file."""
|
|
32
|
+
with open(self.filepath, 'wb') as f:
|
|
33
|
+
try: # Convert from unicode to bytes
|
|
34
|
+
text = text.encode('utf-8')
|
|
35
|
+
f.write(text)
|
|
36
|
+
except AttributeError:
|
|
37
|
+
pass
|