Skip to content

Commit e10f2bc

Browse files
committed
Merge branch 'master' into wxPython3-compatibility
2 parents 94603c1 + c843738 commit e10f2bc

File tree

17 files changed

+363
-227
lines changed

17 files changed

+363
-227
lines changed

AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ Timothy Alexander
2323
@tuds
2424
@goodwillcoding
2525
@synsun
26+
Ferenc Züllich

src/robotide/application/releasenotes.py

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _create_view(self):
8686
# Release notes are updated automatically by package.py script whenever
8787
# a numbered distribution is created.
8888
RELEASE_NOTES = """
89-
<h2>Release notes for 1.5</h2>
89+
<h2>Release notes for 1.5.1</h2>
9090
<table border="1">
9191
<tr>
9292
<td><p><b>ID</b></p></td>
@@ -97,75 +97,33 @@ def _create_view(self):
9797
<tr>
9898
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
9999
<td>bug</td>
100-
<td>critical</td>
101-
<td>Cannot import remote library in 1.4.1</td>
102-
</tr>
103-
<tr>
104-
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
105-
<td>enhancement</td>
106-
<td>critical</td>
107-
<td>Support RF 2.9</td>
108-
</tr>
109-
<tr>
110-
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
111-
<td>bug</td>
112-
<td>high</td>
113-
<td>Argument validation error thrown when a valid ordering is specified</td>
114-
</tr>
115-
<tr>
116-
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
117-
<td>enhancement</td>
118100
<td>high</td>
119-
<td>Re-package bundled Robot Framework, never use bundled standard libraries</td>
101+
<td>Error in RIDE startup</td>
120102
</tr>
121103
<tr>
122104
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
123105
<td>bug</td>
124106
<td>high</td>
125-
<td>'--monitorcolors' and '--monitorwidth' is deprecated WARN message</td>
126-
</tr>
127-
<tr>
128-
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
129-
<td>bug</td>
130-
<td>medium</td>
131-
<td>fix view all tags(F7) doesn't work on windows #1526</td>
132-
</tr>
133-
<tr>
134-
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
135-
<td>enhancement</td>
136-
<td>medium</td>
137-
<td>Updates arguments for pybot to RF 2.9.1.</td>
138-
</tr>
139-
<tr>
140-
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
141-
<td>bug</td>
142-
<td>medium</td>
143-
<td>Content Assist fails with unicode characters</td>
144-
</tr>
145-
<tr>
146-
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
147-
<td>bug</td>
148-
<td>medium</td>
149-
<td>#1500: Remove deprecated options warning messages</td>
107+
<td>Problem with opening two ride </td>
150108
</tr>
151109
<tr>
152110
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
153111
<td>bug</td>
154-
<td>medium</td>
155-
<td>Highlighting selected cell (and matches) does not work.</td>
112+
<td>high</td>
113+
<td>Should not crash when removing old log files fails</td>
156114
</tr>
157115
<tr>
158116
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
159117
<td>bug</td>
160118
<td>medium</td>
161-
<td>RIDE Log shows "The C++ part of the VariablesListEditor object has been deleted, attribute access no longer allowed"</td>
119+
<td>It is possible to create suite variables with a blank space before the $, @ or &</td>
162120
</tr>
163121
<tr>
164122
<td><a href="http://github.com/robotframework/RIDE/issues/http://github.com/robotframework/RIDE/issues/">Issue http://github.com/robotframework/RIDE/issues/</a></td>
165123
<td>bug</td>
166124
<td>medium</td>
167-
<td>"Find Where Used" in editor not working</td>
125+
<td>Create Dictionary Variable is missing from the tree context menu</td>
168126
</tr>
169127
</table>
170-
<p>Altogether 12 issues.</p>
128+
<p>Altogether 5 issues.</p>
171129
"""

src/robotide/contrib/testrunner/testrunnerplugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def _set_margins(self, out):
639639
out.SetMarginWidth(3,0)
640640

641641
def _create_font(self):
642-
font=wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FIXED_FONT)
642+
font=wx.SystemSettings.GetFont(wx.SYS_ANSI_FIXED_FONT)
643643
if not font.IsFixedWidth():
644644
# fixed width fonts are typically a little bigger than their variable width
645645
# peers so subtract one from the point size.

src/robotide/controller/macrocontrollers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def create_keyword(self, name, argstr):
232232

233233
def _remove_bdd_prefix(self, name):
234234
matcher = name.lower()
235-
for match in ['given ', 'when ', 'then ', 'and ']:
235+
for match in ['given ', 'when ', 'then ', 'and ', 'but ']:
236236
if matcher.startswith(match):
237237
return name[len(match):]
238238
return name

src/robotide/controller/stepcontrollers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525
class StepController(_BaseController):
2626

27-
_GIVEN_WHEN_THEN_MATCHER = re.compile(r'^(given|when|then|and)\s*', re.I)
27+
_GIVEN_WHEN_THEN_MATCHER = re.compile(r'^(given|when|then|and|but)\s*',
28+
re.I)
2829

2930
def __init__(self, parent, step):
3031
self._init(parent, step)

src/robotide/editor/contentassist.py

Lines changed: 54 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def __init__(self, suggestion_source):
3737
self.Bind(wx.EVT_MOVE, self.OnFocusLost)
3838
self._showing_content_assist = False
3939
self._row = None
40+
self.gherkin_prefix = '' # Store gherkin prefix from input to add \
41+
# later after search is performed
4042

4143
def set_row(self, row):
4244
self._row = row
@@ -48,7 +50,7 @@ def OnChar(self, event):
4850
if keycode == wx.WXK_SPACE and event.ControlDown():
4951
self.show_content_assist()
5052
return
51-
if keycode in [wx.WXK_UP, wx.WXK_DOWN, wx.WXK_PAGEUP, wx.WXK_PAGEDOWN] \
53+
if keycode in [wx.WXK_UP, wx.WXK_DOWN, wx.WXK_PAGEUP, wx.WXK_PAGEDOWN]\
5254
and self._popup.is_shown():
5355
self._popup.select_and_scroll(keycode)
5456
return
@@ -62,14 +64,16 @@ def OnChar(self, event):
6264
return
6365
elif self._popup.is_shown() and keycode < 256:
6466
self._populate_content_assist(event)
65-
elif keycode in (ord('1'), ord('2')) and event.ControlDown() and not event.AltDown():
66-
self.execute_variable_creator(list_variable=(keycode==ord('2')))
67+
elif keycode in (ord('1'), ord('2')) and event.ControlDown() and not \
68+
event.AltDown():
69+
self.execute_variable_creator(list_variable=(keycode == ord('2')))
6770
event.Skip()
6871

6972
def execute_variable_creator(self, list_variable=False):
7073
from_, to_ = self.GetSelection()
7174
symbol = '@' if list_variable else '$'
72-
self.SetValue(self._variable_creator_value(self.Value, symbol, from_, to_))
75+
self.SetValue(self._variable_creator_value(
76+
self.Value, symbol, from_, to_))
7377
if from_ == to_:
7478
self.SetInsertionPoint(from_ + 2)
7579
else:
@@ -81,7 +85,7 @@ def _variable_creator_value(self, value, symbol, from_, to_):
8185
def OnFocusLost(self, event, set_value=True):
8286
if not self._popup.is_shown():
8387
return
84-
value = self._popup.get_value()
88+
value = self.gherkin_prefix + self._popup.get_value()
8589
if set_value and value:
8690
self.SetValue(value)
8791
self.SetInsertionPoint(len(self.Value))
@@ -113,26 +117,41 @@ def _populate_content_assist(self, event=None):
113117
return False
114118
else:
115119
value += unichr(event.GetRawKeyCode())
120+
(self.gherkin_prefix, value) = self._remove_bdd_prefix(value)
116121
return self._popup.content_assist_for(value, row=self._row)
117122

123+
def _remove_bdd_prefix(self, name):
124+
for match in ['given ', 'when ', 'then ', 'and ', 'but ']:
125+
if name.lower().startswith(match):
126+
return (name[:len(match)], name[len(match):])
127+
return ('', name)
128+
118129
def _show_content_assist(self):
119130
height = self.GetSizeTuple()[1]
120131
x, y = self.ClientToScreenXY(0, 0)
121132
self._popup.show(x, y, height)
122133

123134
def content_assist_value(self):
124-
return self._popup.content_assist_value(self.Value)
135+
suggestion = self._popup.content_assist_value(self.Value)
136+
if suggestion is None:
137+
return suggestion
138+
else:
139+
return self.gherkin_prefix + suggestion
125140

126141
def hide(self):
127142
self._popup.hide()
128143
self._showing_content_assist = False
129144

130145

131-
class ExpandingContentAssistTextCtrl(_ContentAssistTextCtrlBase, ExpandoTextCtrl):
146+
class ExpandingContentAssistTextCtrl(_ContentAssistTextCtrlBase,
147+
ExpandoTextCtrl):
132148

133149
def __init__(self, parent, plugin, controller):
134-
ExpandoTextCtrl.__init__(self, parent, size=wx.DefaultSize, style=wx.WANTS_CHARS)
135-
_ContentAssistTextCtrlBase.__init__(self, SuggestionSource(plugin, controller))
150+
ExpandoTextCtrl.__init__(self, parent, size=wx.DefaultSize,
151+
style=wx.WANTS_CHARS)
152+
_ContentAssistTextCtrlBase.__init__(self,
153+
SuggestionSource(plugin,
154+
controller))
136155

137156

138157
class ContentAssistTextCtrl(_ContentAssistTextCtrlBase, wx.TextCtrl):
@@ -144,10 +163,11 @@ def __init__(self, parent, suggestion_source, size=wx.DefaultSize):
144163

145164
class ContentAssistFileButton(_ContentAssistTextCtrlBase, FileBrowseButton):
146165

147-
def __init__(self, parent, suggestion_source, label, controller, size=wx.DefaultSize):
166+
def __init__(self, parent, suggestion_source, label, controller,
167+
size=wx.DefaultSize):
148168
FileBrowseButton.__init__(self, parent, labelText=label,
149-
size=size, fileMask="*",
150-
changeCallback=self.OnFileChanged)
169+
size=size, fileMask="*",
170+
changeCallback=self.OnFileChanged)
151171
self._parent = parent
152172
self._controller = controller
153173
self._browsed = False
@@ -183,10 +203,11 @@ def SelectAll(self):
183203
def _relative_path(self, value):
184204
src = self._controller.datafile.source
185205
if utils.is_same_drive(src, value):
186-
path = relpath(value, src if isdir(src) else dirname(src))
206+
path = relpath(value, src if isdir(src) else dirname(src))
187207
else:
188208
path = value
189-
return path.replace('\\', '/') if context.IS_WINDOWS else path.replace('\\', '\\\\')
209+
return path.replace('\\', '/') if context.IS_WINDOWS else\
210+
path.replace('\\', '\\\\')
190211

191212

192213
class Suggestions(object):
@@ -199,7 +220,7 @@ def __init__(self, suggestion_source):
199220
def get_for(self, value, row=None):
200221
self._previous_choices = self._get_choices(value, row)
201222
self._previous_value = value
202-
return [k for k,_ in self._previous_choices]
223+
return [k for k, _ in self._previous_choices]
203224

204225
def get_item(self, name):
205226
for k, v in self._previous_choices:
@@ -210,7 +231,7 @@ def get_item(self, name):
210231
def _get_choices(self, value, row):
211232
if self._previous_value and value.startswith(self._previous_value):
212233
return [(key, val) for key, val in self._previous_choices
213-
if utils.normalize(key).startswith(utils.normalize(value))]
234+
if utils.normalize(key).startswith(utils.normalize(value))]
214235
choices = self._suggestion_source.get_suggestions(value, row)
215236
duplicate_names = self._get_duplicate_names(choices)
216237
return self._format_choices(choices, value, duplicate_names)
@@ -225,15 +246,18 @@ def _get_duplicate_names(self, choices):
225246
return results
226247

227248
def _format_choices(self, choices, prefix, duplicate_names):
228-
return [(self._format(val, prefix, duplicate_names), val) for val in choices]
249+
return [(self._format(val, prefix, duplicate_names), val) for val in
250+
choices]
229251

230252
def _format(self, choice, prefix, duplicate_names):
231-
return choice.name if self._matches_unique_shortname(choice, prefix, duplicate_names) else choice.longname
253+
return choice.name if self._matches_unique_shortname(
254+
choice, prefix, duplicate_names) else choice.longname
232255

233256
def _matches_unique_shortname(self, choice, prefix, duplicate_names):
234257
if isinstance(choice, VariableInfo):
235258
return True
236-
if not utils.normalize(choice.name).startswith(utils.normalize(prefix)):
259+
if not utils.normalize(choice.name).startswith(
260+
utils.normalize(prefix)):
237261
return False
238262
if utils.normalize(choice.name) in duplicate_names:
239263
return False
@@ -247,15 +271,17 @@ def __init__(self, parent, suggestion_source):
247271
self._main_popup = RidePopupWindow(parent, _PREFERRED_POPUP_SIZE)
248272
self._details_popup = HtmlPopupWindow(parent, _PREFERRED_POPUP_SIZE)
249273
self._selection = -1
250-
self._list = ContentAssistList(self._main_popup, self.OnListItemSelected,
274+
self._list = ContentAssistList(self._main_popup,
275+
self.OnListItemSelected,
251276
self.OnListItemActivated)
252277
self._suggestions = Suggestions(suggestion_source)
253278

254279
def reset(self):
255280
self._selection = -1
256281

257282
def get_value(self):
258-
return self._selection != -1 and self._list.get_text(self._selection) or None
283+
return self._selection != -1 and self._list.get_text(
284+
self._selection) or None
259285

260286
def content_assist_for(self, value, row=None):
261287
self._choices = self._suggestions.get_for(value, row=row)
@@ -275,9 +301,12 @@ def content_assist_value(self, value):
275301
return None
276302

277303
def show(self, xcoord, ycoord, cell_height):
278-
self._main_popup.SetPosition((xcoord, self._move_y_where_room(ycoord, cell_height)))
304+
self._main_popup.SetPosition((xcoord,
305+
self._move_y_where_room(ycoord,
306+
cell_height)))
279307
self._details_popup.SetPosition((self._move_x_where_room(xcoord),
280-
self._move_y_where_room(ycoord, cell_height)))
308+
self._move_y_where_room(ycoord,
309+
cell_height)))
281310
self._main_popup.Show()
282311
self._list.SetFocus()
283312

@@ -303,13 +332,13 @@ def is_shown(self):
303332

304333
def select_and_scroll(self, keycode):
305334
sel = self._list.GetFirstSelected()
306-
if keycode == wx.WXK_DOWN :
335+
if keycode == wx.WXK_DOWN:
307336
if sel < (self._list.GetItemCount() - 1):
308337
self._select_and_scroll(sel + 1)
309338
else:
310339
self._select_and_scroll(0)
311340
elif keycode == wx.WXK_UP:
312-
if sel > 0 :
341+
if sel > 0:
313342
self._select_and_scroll(sel - 1)
314343
else:
315344
self._select_and_scroll(self._list.GetItemCount() - 1)

src/robotide/editor/robotframeworklexer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def _tokenize(self, value, index):
275275

276276

277277
class GherkinTokenizer(object):
278-
_gherkin_prefix = re.compile('^(Given|When|Then|And) ', re.IGNORECASE)
278+
_gherkin_prefix = re.compile('^(Given|When|Then|And|But) ', re.IGNORECASE)
279279

280280
def tokenize(self, value, token):
281281
match = self._gherkin_prefix.match(value)
@@ -321,7 +321,7 @@ def tokenize(self, value, index):
321321

322322
def _continues(self, value, index):
323323
return value == '...' and all(self._is_empty(t)
324-
for t in self._prev_values_on_row)
324+
for t in self._prev_values_on_row)
325325

326326
def _is_empty(self, value):
327327
return value in ('', '\\')
@@ -367,8 +367,8 @@ class TestCaseTable(_Table):
367367

368368
@property
369369
def _tokenizer_class(self):
370-
if self._test_template or (self._default_template and
371-
self._test_template is not False):
370+
if self._test_template or (self._default_template
371+
and self._test_template is not False):
372372
return TemplatedKeywordCall
373373
return KeywordCall
374374

@@ -470,7 +470,7 @@ def _split(self, string):
470470
self._state(char, index)
471471
except StopIteration:
472472
return
473-
if index == max_index and not self._scanning_list_variable_index():
473+
if index == max_index and not self._scanning_list_variable_index():
474474
return
475475

476476
def _scanning_list_variable_index(self):

src/robotide/namespace/namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def _add_resource(self, res, ctx, items):
521521

522522
class _Keywords(object):
523523

524-
regexp = re.compile("\s*(given|when|then|and)\s*(.*)", re.IGNORECASE)
524+
regexp = re.compile("\s*(given|when|then|and|but)\s*(.*)", re.IGNORECASE)
525525

526526
def __init__(self, keywords):
527527
self.keywords = robotapi.NormalizedDict(ignore=['_'])

0 commit comments

Comments
 (0)