Commit Graph

52 Commits

Author SHA1 Message Date
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
764abb41bf Don't use relative imports in the tools scripts 2020-03-20 15:21:23 -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
Robin Dunn
9f2cc54b48 Update copyright years 2020-03-10 11:41:39 -07:00
Robin Dunn
e3ef0db163 Fix typos and trim whitespace 2019-12-31 14:13:20 -08:00
Paul Kienzle
092bb845d5 Fix wx/tools/pywxrc for py2/3 compatibility. Refs 1156. 2019-04-14 13:45:08 -04:00
Éric Piel
1b46085c97 pywxrc: fix showing the success message at the end
When generating a file, it should show a success message like "Resources written to...".
However, the print() failed, which made it sound like the whole generation failed.
2018-08-22 13:56:01 +02:00
Éric Piel
96ed353b34 pywxrc: fix Menu with variable name and label defined after sub-menus
If the XRC looked like:
<object class="wxMenu" name="menu_file">
  <object class="wxMenuItem" name="menu_item_open">
    <label>Save</label>
  </object>
  <label>File</label>
</object>

The generated code would fail, because it would try to look for a main menu called "Save"
instead of looking for "File".

=> Make the XML parsing more clever to not look for the first "label" tag,
but the first _direct_ child with tag "label".
2018-08-22 13:51:16 +02:00
Éric Piel
984a036d34 pywxrc: remove old comments
It's not using the 2 stages creation anymore.
2018-08-22 13:50:33 +02:00
Robin Dunn
b77c88a280 Merge tag 'wxPython-4.0.2' into wxPy-4.0.x
(cherry picked from commit 4c56c39e52)
2018-06-17 22:04:22 -07:00
Steve Barnes
517d316ba0 #817 Changes to allow wxget utility to work with pip v10+ 2018-04-17 06:50:14 +01:00
André Colomb
c655b09012 Remove obsolete argument from PreCreate().
With the `pre` object magic gone, there is no need to pass another
argument to the PreCreate() method, which can now just use `self`.

Note that this is will probably lead to incompatibilities for users of
the generated class who override this method, as advised in the
template.
2018-02-05 09:35:05 +01:00
André Colomb
6883afe8ce Simplify two stage creation process.
Remove "pre" object magic and use the parent class constructor
instead.  Remove deprecated PostCreate() call.  See
https://docs.wxpython.org/MigrationGuide.html#phase-create.

Load the XmlResource contents directly onto self.  See
https://docs.wxpython.org/MigrationGuide.html#xrc.
2018-02-02 17:37:01 +01:00
André Colomb
e17a8a907a Avoid deprecated class EmptyXmlResource.
According to the deprecation warning in wxPython Phoenix.
2018-02-02 17:29:07 +01:00
Robin Dunn
f3cbf76296 Fix more relative imports 2017-12-29 13:56:05 -08:00
Steve Barnes
22f21b369e Make trusted flag available as an option for wxget.py and fix some minor issues. 2017-09-22 12:06:38 +01:00
Steve Barnes
82a5a09b3d Add --no-check-certificate to wx/tools/wxget.py download_wget if trusted 2017-09-22 09:03:40 +01:00
Steve Barnes
69dce9e9a6 Split the URL into the link and filename parts for the error message. 2017-09-22 06:04:39 +01:00
Steve Barnes
1febcd10c3 #545 Fallback download process, wget, urllib, pip --trusted-host, to maximise possilities of success. 2017-09-21 16:16:45 +01:00
Steve Barnes
dd7bdde296 #545 Addressed import error and added --force flag 2017-09-21 09:10:22 +01:00
Robin Dunn
60dbde834b '&' --> 'and' and some other text tweaks 2017-08-08 19:44:26 -07:00
Steve Barnes
2eea0a5634 Catch URLError from firewall and give practical advice 2017-08-08 11:45:59 +01:00
Steve Barnes
404ac70b1b Minor message changes in wx/tools/wxget_docs_demo.py 2017-08-08 11:45:05 +01:00
Steve Barnes
b01de8654e Responded to inline review comments and added propmt before download 2017-08-08 06:59:04 +01:00
Steve Barnes
97de5b0f92 Added wx/tools/wxget_docs_demo.py with script entry points of wxdemo and wxdocs 2017-08-07 06:26:53 +01:00
Steve Barnes
1795b5e7c7 Added get_docs_demo_url to get the documents or demo URL. 2017-08-06 13:07:57 +01:00
Steve Barnes
125e368e1a New utility wxget to provide get where missing. 2017-08-06 12:55:39 +01:00
Mike Driscoll
435d779e8b Update img2py.py
Fix a couple of typos
2017-05-02 09:11:04 -05:00
Andrew Murray
2cfe4ad989 Fixed typos 2017-02-26 14:15:49 +11:00
Robin Dunn
a0604d128c Update copyright in wx/tools 2017-02-13 17:07:39 -08:00
Metallicow
576cf1d966 Trim Whitespace tools directory 2016-10-12 22:15:25 -05:00
david-hughes
bfcc50ce53 Update helpviewer.py
Trivial changes to comments
2016-07-08 16:26:19 +01:00
Robin Dunn
ed4756b902 Remove wx.lib.six and use the stock six module instead,
and add it as an installation dependency.
2016-06-30 20:07:57 -07:00
Robin Dunn
ea4b9b8fc5 updates for fullnames in the docstrings 2016-06-07 16:44:52 -07:00
Robin Dunn
76cf83468a Merge branch 'patch-1' of https://github.com/MichaelHipp/Phoenix into MichaelHipp-patch-1
Conflicts:
	wx/tools/img2img.py
2015-02-10 20:20:57 -08:00
Werner F Bruhin
c3d027aecb - use wx.Bitmap directly for icons
- ImageFromBitmap is deprecated, however can't test as I can't make the first SaveFile fail
2014-07-18 12:42:18 +02:00
Michael Hipp
f14ed529f3 Update img2img.py
Get rid of obsolete call to wx.BitmapFromIcon when converting '.ico' file  ( per http://wxpython.org/Phoenix/docs/html/classic_vs_phoenix.html )
2014-03-29 12:17:43 -05:00
Robin Dunn
bcbdcd9631 Remove more CVS $Id$ and $Revision$ tags, and a bit of code that uses them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-11 03:35:32 +00:00
Robin Dunn
37b08e317d Fix import for Py3
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-25 08:27:58 +00:00
Robin Dunn
9d5238fa33 Fix print statements that use the file= arg to use the print_ function from wx.lib.six instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-14 03:09:25 +00:00
Robin Dunn
24bf92a45d More wx.PySimpleApp —> wx.App migrations
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-14 02:34:31 +00:00
Robin Dunn
7d3e2b7c2e PR 40 from Metallicow. Py3 and Phoenix updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75601 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-11 23:12:43 +00:00
Robin Dunn
fbda4deb28 Fix some "wxPython" package names --> "wx" in comments, etc.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-10 05:39:16 +00:00
Robin Dunn
b4bb3dd746 Fix print statement errors
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-12-31 07:47:53 +00:00
Robin Dunn
9f24505715 Merge of PR 11 with the whitespace-only changes omitted.
See https://github.com/RobinD42/Phoenix/pull/11

Mostly phoenix-port changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-10 01:15:34 +00:00
Robin Dunn
c478ccdbfa Py3 port for helpviewer
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-23 02:35:29 +00:00
Robin Dunn
9760539742 Add declarations of the pure virtuals for the file-system handler classes so they can be instantiated, and some unittests.
Update wx.tools.helpviewer

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-22 06:20:36 +00:00