Skip to content

Commit 94603c1

Browse files
committed
Merge branch 'HelioGuilherme66-improvements' into wxPython3-compatibility
2 parents bf894f6 + 4fbe10c commit 94603c1

File tree

4 files changed

+23
-25
lines changed

4 files changed

+23
-25
lines changed

src/robotide/__init__.py

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@
3232
from string import Template
3333

3434
errorMessageTemplate = Template("""$reason
35-
You need to install wxPython 2.8.12.1 or 3.0.2 or newer with unicode support to run RIDE.
36-
wxPython can be downloaded from http://sourceforge.net/projects/wxpython/files/wxPython/""")
35+
You need to install wxPython 2.8.12.1 or 3.0.2 or newer with unicode support \
36+
to run RIDE. wxPython can be downloaded from \
37+
http://sourceforge.net/projects/wxpython/files/wxPython/""")
3738
supported_versions = ["2.8", "3.0"]
3839

3940
try:
@@ -42,19 +43,19 @@
4243
wxversion.select(supported_versions)
4344
import wx
4445
except ImportError as e:
45-
if "no appropriate 64-bit architecture" in e.message.lower() and \
46+
if "no appropriate 64-bit architecture" in "{0}".format(e).lower() and \
4647
sys.platform == 'darwin':
47-
print "python should be executed in 32-bit mode with wxPython on OSX."
48+
print("python should be executed in 32-bit mode with wxPython on OSX.")
4849
else:
49-
print errorMessageTemplate.substitute(reason="wxPython not found.")
50+
print(errorMessageTemplate.substitute(reason="wxPython not found."))
5051
sys.exit(1)
5152
except VersionError:
52-
print errorMessageTemplate.substitute(reason="Wrong wxPython version.")
53+
print(errorMessageTemplate.substitute(reason="Wrong wxPython version."))
5354
sys.exit(1)
5455

5556
if "ansi" in wx.PlatformInfo:
56-
print errorMessageTemplate.substitute(
57-
reason="wxPython with ansi encoding is not supported")
57+
print(errorMessageTemplate.substitute(reason="wxPython with ansi encoding \
58+
is not supported"))
5859
sys.exit(1)
5960

6061

@@ -65,7 +66,7 @@
6566
def main(*args):
6667
noupdatecheck, debug_console, inpath = _parse_args(args)
6768
if len(args) > 3 or '--help' in args:
68-
print __doc__
69+
print(__doc__)
6970
sys.exit()
7071
try:
7172
_run(inpath, not noupdatecheck, debug_console)
@@ -80,7 +81,7 @@ def _parse_args(args):
8081
return False, False, None
8182
noupdatecheck = '--noupdatecheck' in args
8283
debug_console = '--debugconsole' in args
83-
inpath = args[-1] if args[-1] not in ['--noupdatecheck', '--debugconsole'] \
84+
inpath = args[-1] if args[-1] not in ['--noupdatecheck', '--debugconsole']\
8485
else None
8586
return noupdatecheck, debug_console, inpath
8687

@@ -105,19 +106,17 @@ def _show_old_wxpython_warning_if_needed(parent=None):
105106
if wx.VERSION >= (2, 8, 12, 1):
106107
return
107108
title = 'Please upgrade your wxPython installation'
108-
message = ('RIDE officially supports wxPython 2.8.12.1, 3.0.2 and newer releases in 3.0 series. '
109-
'Your current version is %s.\n\n'
110-
'Older wxPython versions are known to miss some features used by RIDE. '
111-
'Notice also that wxPython 3.0 is not yet supported.\n\n'
112-
'wxPython 2.8.12.1 packages can be found from\n'
113-
'http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/.'
114-
% wx.VERSION_STRING)
109+
message = ("RIDE officially supports wxPython 2.8.12.1, 3.0.2 and newer \
110+
releases in 3.0 series. Your current version is {0}.\n\n \
111+
Older wxPython versions are known to miss some features used by RIDE.\n \
112+
wxPython 2.8.12.1 packages can be found from\n \
113+
http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/.".format(
114+
wx.VERSION_STRING))
115115
style = wx.ICON_EXCLAMATION
116116
if not parent:
117-
_ = wx.PyApp()
118-
parent = wx.Frame(None, size=(0,0))
117+
_ = wx.App()
118+
parent = wx.Frame(None, size=(0, 0))
119119
wx.MessageDialog(parent, message, title, style).ShowModal()
120120

121-
122121
if __name__ == '__main__':
123122
main(sys.argv[1:])

src/robotide/editor/grid.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def write_cell(self, row, col, value, update_history=True):
5656
if update_history:
5757
self._update_history()
5858
self._expand_if_necessary(row, col)
59-
print self.GetCellSize(row, col)
6059
self.SetCellValue(row, col, value)
6160

6261
def _expand_if_necessary(self, row, col):

src/robotide/log/log.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self, app):
4040
self._log = []
4141
self._window = None
4242
self._path = os.path.join(
43-
tempfile.gettempdir(), '{}-ride.log'.format(uuid.uuid4()))
43+
tempfile.gettempdir(), '{0}-ride.log'.format(uuid.uuid4()))
4444
self._outfile = None
4545
self._remove_old_log_files()
4646
atexit.register(self._close)
@@ -56,7 +56,7 @@ def _remove_old_log_files(self):
5656
try:
5757
os.remove(fname)
5858
except OSError or IOError as e:
59-
sys.stderr.write("{}".format(e))
59+
sys.stderr.write("{0}".format(e))
6060

6161
@property
6262
def _logfile(self):
@@ -118,7 +118,7 @@ def _create_ui(self):
118118
self.Sizer.add_expanding(self._output)
119119

120120
def _add_to_notebook(self, notebook):
121-
notebook.add_tab(self, 'Log', allow_closing=True)
121+
notebook.add_tab(self, 'RIDE Log', allow_closing=True)
122122
notebook.show_tab(self)
123123
self._output.SetSize(self.Size)
124124

utest/resources/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040

4141
PATH_RESOURCE_NAME = 'pathresource.html' if CIF else 'PathResource.html'
4242

43-
PYAPP_REFERENCE = wx.PySimpleApp()
43+
PYAPP_REFERENCE = wx.App()

0 commit comments

Comments
 (0)