86 Commits

Author SHA1 Message Date
Kazuya O'moto
ffe0166e4e Enable whole-word search
Add whole-word search functionality to DoFindNext
* Use stc's SearchInTarget instead of str.find/rfind.

Modify ShowPosition (override)
* Reverted the comment line.
  Folded lines need to be expanded to ensure the target line is visible.
2025-07-05 21:51:06 +09:00
Scott Talbert
4320e9da00 Merge pull request #2747 from komoto48g/fix-search-dir
Some checks failed
ci-build / build-source-dist (push) Has been cancelled
ci-build / Build wxPython documentation (push) Has been cancelled
ci-build / build-wheels (arm64, macos-14, 3.10) (push) Has been cancelled
ci-build / build-wheels (arm64, macos-14, 3.11) (push) Has been cancelled
ci-build / build-wheels (arm64, macos-14, 3.12) (push) Has been cancelled
ci-build / build-wheels (arm64, macos-14, 3.13) (push) Has been cancelled
ci-build / build-wheels (arm64, macos-14, 3.9) (push) Has been cancelled
ci-build / build-wheels (x64, macos-13, 3.10) (push) Has been cancelled
ci-build / build-wheels (x64, macos-13, 3.11) (push) Has been cancelled
ci-build / build-wheels (x64, macos-13, 3.12) (push) Has been cancelled
ci-build / build-wheels (x64, macos-13, 3.13) (push) Has been cancelled
ci-build / build-wheels (x64, macos-13, 3.9) (push) Has been cancelled
ci-build / build-wheels (x64, ubuntu-22.04, 3.10) (push) Has been cancelled
ci-build / build-wheels (x64, ubuntu-22.04, 3.11) (push) Has been cancelled
ci-build / build-wheels (x64, ubuntu-22.04, 3.12) (push) Has been cancelled
ci-build / build-wheels (x64, ubuntu-22.04, 3.13) (push) Has been cancelled
ci-build / build-wheels (x64, ubuntu-22.04, 3.9) (push) Has been cancelled
ci-build / build-wheels (x64, windows-2022, 3.10) (push) Has been cancelled
ci-build / build-wheels (x64, windows-2022, 3.11) (push) Has been cancelled
ci-build / build-wheels (x64, windows-2022, 3.12) (push) Has been cancelled
ci-build / build-wheels (x64, windows-2022, 3.13) (push) Has been cancelled
ci-build / build-wheels (x64, windows-2022, 3.9) (push) Has been cancelled
ci-build / build-wheels (x86, windows-2022, 3.10) (push) Has been cancelled
ci-build / build-wheels (x86, windows-2022, 3.11) (push) Has been cancelled
ci-build / build-wheels (x86, windows-2022, 3.12) (push) Has been cancelled
ci-build / build-wheels (x86, windows-2022, 3.13) (push) Has been cancelled
ci-build / build-wheels (x86, windows-2022, 3.9) (push) Has been cancelled
ci-build / Publish Python distribution to PyPI (push) Has been cancelled
ci-build / Create GitHub Release and upload source (push) Has been cancelled
ci-build / Upload wheels to snapshot-builds on wxpython.org (push) Has been cancelled
Fix up/down option not working on the initial search
2025-05-06 14:42:54 -04:00
Kazuya O'moto
f0ac2b51eb Fix up/down option not working on the initial search 2025-05-06 04:33:10 +09:00
Kazuya O'moto
087d2c82fa Replace imp with types
https://docs.python.org/3.12/library/imp.html
2025-05-03 02:32:56 +09:00
Kazuya O'moto
ff679f93a8 Fix eol style
According to the documentation, 'eol' enables EOL filling (not 'eolfilled').
https://docs.wxpython.org/wx.stc.StyledTextCtrl.html#wx.stc.StyledTextCtrl.StyleSetSpec
2025-05-01 04:02:31 +09:00
Kazuya O'moto
636dab57b8 Add a few more dunders
Clean up comments
2025-03-30 02:53:06 +09:00
Kazuya O'moto
fbd25d56fc Change special_attrs from PY2 to PY3
Change deprecated variables in PY2 to new ones in PY3
2025-03-30 02:53:06 +09:00
Kazuya O'moto
d6b6c3c0fd Add NL token type check to getRoot
little tweaks to if statements.
2025-03-30 02:52:48 +09:00
Kazuya O'moto
39045d9fe8 Fix assert_ to assertTrue
The unittest `assert_` has been deprecated since 3.12
2025-03-15 00:51:32 +09:00
Alexandre Detiste
323e78c085 remove more Python2 hybridation 2025-02-02 20:29:49 -05:00
Alexandre Detiste
0257f755cf remove most of Python2 compatibility code 2025-02-02 20:17:45 -05:00
Scott Talbert
31c996461e Merge pull request #2365 from komoto48g/py-filling
Don't crush pie filling
2024-11-14 20:30:31 -05:00
Kazuya O'moto
1fb1e84012 Use unwrap before isbuiltin check
`inspect.isbuiltin` does not unwrap obj, but `inspect.signature` does,
which can result in a ValueError.

    >>> wx.Bell
    <built-in function Bell>
    >>> bell #= dcor(wx.Bell)
    <function Bell at 0x0000015E53D92B60>
    >>> inspect.isbuiltin(bell)
    False
    >>> inspect.signature(bell)
    ... (snip) ...
    ValueError: no signature found for builtin <built-in function Bell>
2023-11-26 16:32:57 +09:00
Kazuya O'moto
1563d3e1f0 Don't watch DropTarget
Windows bug fix
    https://github.com/wxWidgets/Phoenix/issues/2043
2023-03-06 22:07:12 +09:00
Kazuya O'moto
e0a71625e2 Extract argspec inside paren using re
ex.
argspec = '(x, /, y, z=3, *args, value: int = 0, **kwargs) -> int'
      --> 'x, /, y, z=3, *args, value: int = 0, **kwargs'
2023-02-24 23:21:59 +09:00
Kazuya O'moto
8e98e8b442 Use inspect.signature instead of formatargspec
inspect.formatargspec has been deprecated since Python 3.5,
and removed in Python 3.11.
2023-02-24 23:02:48 +09:00
Robin Dunn
727f3aff2a Merge pull request #2158 from komoto48g/shell-stc
Fix issue #2157: wx.py.shell.Shell.OnHistorySearch
2022-05-22 23:01:11 -07:00
komoto
de5abf4219 Override editwindow SetSelection as a temporary patch
Better to override editwindow (a common parent of shell and sliceshell)
2022-05-20 13:22:43 +09:00
komoto
85466c87b8 Revert "Override SetSelection as a temporary patch"
Better to override editwindow
2022-05-20 13:09:07 +09:00
komoto
3381f5bfb4 Override SetSelection as a temporary patch
Patch for miss-insertion position when from_ > to_.
    This is needed until the stc.StyledText.SetSelection bug is fixed.
2022-05-12 23:47:22 +09:00
komoto
efa85f1798 Fix OnHistorySearch range+ error
Fix TypeError: unsupported operand type(s) for +: 'range' and 'range'
2022-05-12 23:24:25 +09:00
komoto
ab6ec5b9fd Fix shell getMultilineCommand
Add limitation to avoid an infinite loop at EOF,
    when programmatically called on the current prompt.
2022-04-26 22:30:49 +09:00
Scott Talbert
2871c46d33 Fix a bunch of DeprecationWarnings due to invalid escape sequences
Fixes #1454.
2022-01-11 11:23:06 -05:00
komoto
d8a0f0e639 Remove comments and cleanup 2021-12-14 14:42:04 +09:00
Kazuya O'moto
0d6031df60 Merge branch 'wxWidgets:master' into feature-shell 2021-12-14 14:24:43 +09:00
Robin Dunn
cbe539efd9 Merge pull request #2047 from swt2c/df_unicode
Use wx.DF_UNICODETEXT instead of wx.DF_TEXT
2021-12-13 20:46:14 -08:00
Scott Talbert
2791fd7016 Use wx.DF_UNICODETEXT instead of wx.DF_TEXT
wx.DF_TEXT doesn't work on macOS and Unicode should be available under
all platforms.
2021-12-06 19:56:04 -05:00
Christian Clauss
25ba122168 Fix typos discovered by codespell 2021-08-07 18:55:49 +02:00
komoto
fd0560f256 Add Shell EVT_UPDATE_UI handler for each id
(revert)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateContextMenu) without specifing id
triggers EVT_UPDATE_UI frequently.
2021-07-29 16:09:56 +09:00
komoto
5d1b6e0d28 Fix Shell update event handler
Rename the handler so that it does not override the base class EditWindow.OnUpdateUI.
2021-07-29 16:09:56 +09:00
komoto
7ff7d46a7e Add Shell missing keywords
Add the keyword 'finally' in Execute, to fix miss-indentation
when pasting the following code:
try:
    1
    finally: <-- indent error
        0

Add the keyword 'with' to fix mis-indentation when typing:
with xxx:
| <-- incorrect auto-indentation in the next line
2021-07-29 16:01:10 +09:00
Robin Dunn
732ff6752b Revert "Spelling fixes in wx.lib"
This reverts commit c00b8950da.
The spelling changes were a bit too aggressive.
2020-08-31 13:01:31 -07:00
Robin Dunn
c00b8950da Spelling fixes in wx.lib 2020-07-14 12:53:31 -07:00
Metallicow
6e681835a6 Remove exception in py shell wrap() method
This exists in Scintilla when wxPython 4.0 Phoenix came out, so remove it as cruft.
2020-06-09 22:14:18 -05:00
efahl
2c571edc23 Eliminate deprecation warning
Remove import of 'imp' module to eliminate deprecation warning.
2020-05-14 12:00:56 -07:00
Per A. Brodtkorb
426258b7b7 Adding missing close for open and replaced "fid=open(filename) fid.close()"
statements with the safer "with open(filename) as fid:" blocks.

Also removed unnecessary "try: ... finally: pass" statements
and refactored code from img2py function into _write_image and _replace_non_alphanumeric_with_underscore

Fixes #1574
2020-03-25 10:36:38 +01:00
Robin Dunn
7a05d20d82 Merge pull request #1572 from pbrod/Fix_issue1571
Fixes issue 1571:
2020-03-23 16:07:22 -07:00
Robin Dunn
41c5af9cde Merge pull request #1569 from pbrod/Fix_issue1554
Fixes issue # 1554:
2020-03-23 15:35:41 -07:00
Per A. Brodtkorb
e4e8bf8317 Fixes issue 1571:
Adding missing close for open.
If the "close()" call is missing after a "open(filename)" call, the filename isn't guaranteed to be closed before the interpreter exits.
This is generally a bad practice as explained here: https://stackoverflow.com/questions/7395542/is-explicitly-closing-files-important

Also replaced "fid=open(filename) fid.close()" statements for files with the safer
"with open(filename) as fid:" blocks. See https://www.python.org/dev/peps/pep-0343/
2020-03-23 17:16:44 +01:00
Per A. Brodtkorb
fc1823315b Fixes issue # 1554:
Replaced "== None" and "!= None" with "is None" and "is not None", respectively, because the former is slower and error-prone.
2020-03-23 11:53:36 +01:00
Robin Dunn
8e2627e8e3 Merge pull request #1564 from pbrod/Fix_issue1556
Fixes issue #1556
2020-03-20 15:19:40 -07:00
Per A. Brodtkorb
033c18fd9f Fixes issue #1556
Replaced XXX.keys() calls with idiomatic python 3 calls that are compatible with python 2 such as eg:
 * replaced "y = xxx.keys()" or "y = list(xxx.keys())" with just "y = list(xxx)"
 * replaced "sorted(xxx.keys())" or "sorted(list(xxx.keys()))" with just "sorted(xxx)"
 * replaced "if not A in B.keys():" with "if A not in B:"
 * replaced "for A in B.keys():"  with "for A in B:"

See also https://python-future.org/compatible_idioms.html
https://python-future.org/compatible_idioms.html#dict-keys-values-items-as-a-list
2020-03-20 18:51:19 +01:00
Per A. Brodtkorb
05ac589e2d Fixes issue 1555
Replace open-close statements by the use of "with"-blocks.

With the "With" statement, you get better syntax and exceptions handling.

"The with statement simplifies exception handling by encapsulating common
preparation and cleanup tasks."

In addition, it will automatically close the file. The with statement provides
a way for ensuring that a clean-up is always used.
2020-03-20 15:03:09 +01:00
Robin Dunn
6206d20bad Various small tweaks and fixes 2019-09-11 12:56:11 -07:00
Paul Kienzle
37a575c1fb python 2/3 compatible file handling. Refs #1193. 2019-04-13 02:19:52 -04:00
jensgoe
714a9a222d ignore newline added by Tokenize module since Python 3.6 (fixes #1109) 2018-12-12 16:00:46 +01:00
Metallicow
230bf5d6d3 Optimize All PNGs Nov2018
Since I had to fix a image issue and optimize it. I decided to rerun FileOptimizer 13.30.2393 over all pngs. Small bytes for some that had been optimized before, but this comit covers all pngs that may have been missed in the past. Maybe revisit running them all again in 2 years. Total time to process all pngs: approx 8 hours.
As technology improves this will only get better/faster when downloading, loading in browser, embedded, etc...
2018-11-13 16:08:12 -06:00
Robin Dunn
e92d572267 Merge pull request #1057 from RobinD42/fix-issue1025
fix test suite errors in wx/py/tests

(cherry picked from commit ebb3de75ed)
2018-10-26 18:17:52 -07:00
Felipe Calliari
94e9a38085 fix DeprecationWarnings in frame.py (#1043)
This commit solves the following messages:
    DeprecationWarning: Menu.Append() is deprecated
2018-10-24 19:27:47 -07:00
David N. Mashburn
12aed76e6b Fixes save/ load bugs Pyslices 2018-08-26 11:25:15 -04:00