Skip to content

Commit fd23b56

Browse files
Merge pull request #2927 from robotframework/develop
Prepare release 2.1.3
2 parents 73e6681 + 2294b7f commit fd23b56

38 files changed

+1247
-522
lines changed

CHANGELOG.adoc

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,26 @@ All notable changes to this project will be documented in this file.
66
The format is based on http://keepachangelog.com/en/1.0.0/[Keep a Changelog]
77
and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioning].
88

9-
<!-- == https://github.com/robotframework/RIDE[Unreleased] -->
9+
== https://github.com/robotframework/RIDE[Unreleased]
10+
11+
=== Added
12+
- Added syntax colorization for the ``GROUP`` marker.
13+
- Added on Text Editor, tab indentation markers and ``tab markers`` boolean setting with default ``True``.
14+
- Added on Text Editor, folding margin with markers style configurable with ``fold symbols`` in settings.cfg.
15+
16+
=== Changed
17+
- Better Search element in Text Editor which allows to be cleared.
18+
- When saving in Text Editor, the cursor remains at position, instead of jumping to Tree selection.
19+
- Improved autocompletion lists, by using existing words in Test Suite file (still needs more improvements).
20+
- Create directories when needed in New Project dialog.
21+
- Improved the recognition of BDD/Gherkin prefixes when localized in autocomplete on Grid Editor.
22+
- Improved colorization for multiple Gherkin words, for example in the French language.
23+
24+
=== Fixed
25+
- Fixed not set text color on row labels in Grid Editor. Now the General ``secondary foreground`` is applied.
26+
- Fixed multiple scroll bars in Grid Editor when editing Test Cases or Keywords. This caused bad navigation on cells.
27+
- Regression fix from v2.1b1 - Fix wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.
28+
When right clicking over Tree elements, to, for example, expand or select tests, we want to keep the Editor in the same file or position.
1029

1130
== https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride-2.1.2.rst[2.1.2] - 2025-01-28
1231

README.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ See the https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride
3131
**Version https://github.com/robotframework/RIDE/tree/release/1.7.4.2[1.7.4.2] was the last release supporting Python 2.7**
3232

3333

34-
**The current development version is based on 2.1,2, supports Python from 3.8 up to 3.13 (28th January 2025).**
34+
**The current development version is based on 2.1.2, supports Python from 3.8 up to 3.13 (28th January 2025).**
3535

36-
Currently, the unit tests are tested on Python 3.10, 3.11 and 3.13 (but 3.12 is the recommended version).
36+
Currently, the unit tests are tested on Python 3.10, 3.11 and 3.13 (3.13 is the recommended version).
3737
Likewise, the current version of wxPython, is 4.2.2, but RIDE is known to work with 4.0.7 and 4.1.1 versions.
3838

39-
(3.8 &lt;= python &lt;= 3.12) Install current released version (*2.1.2*) with:
39+
(3.8 &lt;= python &lt;= 3.13) Install current released version (*2.1.2*) with:
4040

4141
`pip install -U robotframework-ride`
4242

43-
(3.8 &lt;= python &lt;= 3.13) Install current development version (**2.1.2**) with:
43+
(3.8 &lt;= python &lt;= 3.13) Install current development version (**2.2dev14**) with:
4444

4545
`pip install -U https://github.com/robotframework/RIDE/archive/develop.zip`
4646

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ sonar.projectKey=HelioGuilherme66_RIDE
22
sonar.organization=helioguilherme66
33
sonar.host.url=https://sonarcloud.io
44
sonar.python.version=3.10
5-
sonar.projectVersion=v2.1
5+
sonar.projectVersion=v2.1.3
66
sonar.sources=src/
77
sonar.tests=utest/
88
sonar.exclusions=**/lib/robot/**/*

src/robotide/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def writelines(self, sequence):
136136
""" Override """
137137
pass
138138

139-
if sys.executable.endswith('pythonw.exe'):
139+
if sys.executable.endswith('.exe'):
140140
# In windows, when launching RIDE with pythonw.exe
141141
# sys.stderr and sys.stdout will be None
142142
if sys.stderr is None:

src/robotide/application/CHANGELOG.html

Lines changed: 74 additions & 49 deletions
Large diffs are not rendered by default.

src/robotide/application/releasenotes.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def set_content(self, html_win, content):
151151
<p><a class="reference external" href="https://github.com/robotframework/RIDE/">RIDE (Robot Framework IDE)</a>
152152
{VERSION} is a new release with some enhancements and bug fixes. The reference for valid arguments is
153153
<a class="reference external" href="https://robotframework.org/">Robot Framework</a> previous version, which was 7.1.1
154-
(currently is 7.2). However, internal library code is originally based on version 3.1.2, but adapted for new versions.</p>
154+
(currently is 7.2.2). However, internal library code is originally based on version 3.1.2, but adapted for new versions.</p>
155155
<ul class="simple">
156156
<li>This version supports Python 3.8 up to 3.13.</li>
157157
<li>There are some changes, or known issues:<ul>
@@ -168,8 +168,19 @@ def set_content(self, html_win, content):
168168
</ul>
169169
<p><strong>New Features and Fixes Highlights</strong></p>
170170
<ul class="simple">
171-
<li><em>Partial fix</em> of no update of renaming resource prefixed keywords. Issue #1230 from 29 Jan 2013.</li>
172-
<li>Fixed no recognition of keywords with embedded arguments and full name. Issue #1106 from 12 Sep 2012.</li>
171+
<li>Better Search element in Text Editor which allows to be cleared.</li>
172+
<li>When saving in Text Editor, the cursor remains at position, instead of jumping to Tree selection.</li>
173+
<li>Improved autocompletion lists, by using existing words in Test Suite file (still needs more improvements).</li>
174+
<li>Fixed not set text color on row labels in Grid Editor. Now the General <b>secondary foreground</b> is applied.</li>
175+
<li>Added on Text Editor, tab indentation markers and <b>tab markers</b> boolean setting with default <b>True</b>.</li>
176+
<li>Added on Text Editor, folding margin with markers style configurable with <b>fold symbols</b> in settings.cfg.</li>
177+
<li>Create directories when needed in New Project dialog.</li>
178+
<li>Improved the recognition of BDD/Gherkin prefixes when localized in autocomplete on Grid Editor.</li>
179+
<li>Added syntax colorization for the <em>GROUP</em> marker. Improved colorization for multiple Gherkin words, for
180+
example in the French language.</li>
181+
<li>Fixed multiple scroll bars in Grid Editor when editing Test Cases or Keywords. This caused bad navigation on cells.</li>
182+
<li>Regression fix from v2.1b1 - Fix wrong item selection, like Test Suite, when doing right-click actions in
183+
Project Explorer.</li>
173184
</ul>
174185
<!-- <p>We hope to implement or complete features and make fixes on next major version 2.1 (in mid Autumm of 2024).</p>
175186
-->
@@ -224,7 +235,7 @@ def set_content(self, html_win, content):
224235
<pre class="literal-block">python -m robotide.postinstall -install</pre>
225236
<p>or</p>
226237
<pre class="literal-block">ride_postinstall.py -install</pre>
227-
<p>RIDE {VERSION} was released on 28/January/2025.</p>
238+
<p>RIDE {VERSION} was released on 24/March/2025.</p>
228239
<!-- <br/>
229240
<h3>May The Fourth Be With You!</h3>
230241
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>

src/robotide/application/updatenotifier.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
import builtins
16+
import os
1617
import re
1718
import subprocess
1819
import sys
20+
import tempfile
1921
# Configure wx uversion to allow running test app in __main__
2022

2123

@@ -27,6 +29,7 @@
2729
import requests
2830
import wx
2931
from wx import Colour
32+
from os import path
3033

3134
from .. import version
3235
from ..utils.versioncomparator import cmp_versions, parse_version
@@ -173,8 +176,28 @@ def do_upgrade(command, notebook):
173176

174177
def start_upgraded(message):
175178
__ = message
179+
import zipfile
180+
import requests
181+
182+
def download_url(url, save_path, chunk_size=128):
183+
r = requests.get(url, stream=True)
184+
with open(save_path, 'wb') as fd:
185+
for chunk in r.iter_content(chunk_size=chunk_size):
186+
fd.write(chunk)
187+
188+
backup_configobj = tempfile.NamedTemporaryFile(delete=False)
189+
config_obj_dir = path.join(path.dirname(__file__), '../preferences')
190+
# print(f"DEBUG: updatenotifier, Starting do_upgrade {config_obj_dir=} zip is {backup_configobj.name=}")
191+
download_url('https://robotframework.transformidea.com/RIDE/packages/configobj.zip', backup_configobj.name)
192+
with zipfile.ZipFile(backup_configobj, 'r') as zzip:
193+
zzip.extractall(config_obj_dir)
194+
# print(f"DEBUG: updatenotifier, {config_obj_dir=} extracted {backup_configobj.name}")
195+
try:
196+
os.remove(backup_configobj.name)
197+
except PermissionError:
198+
pass
176199
command = sys.executable + " -m robotide.__init__ --noupdatecheck"
177-
wx.CallLater(500, subprocess.Popen, command.split(' '), start_new_session=True)
200+
wx.CallLater(1000, subprocess.Popen, command.split(' '), start_new_session=True)
178201
p = psutil.Process()
179202
result = _askyesno(_("Completed Upgrade"), f"\n{SPC}{_('You should close this RIDE (Process ID = ')}{p.pid}){SPC}"
180203
f"\n{SPC}{_('Do you want to CLOSE RIDE now?')}\n{SPC}",

src/robotide/context/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ def bind_keys_to_evt_menu(target, actions):
414414
<td>CtrlCmd-2</td>
415415
<td>Make list variable body</td>
416416
</tr>
417+
<tr>
418+
<td>CtrlCmd-5</td>
419+
<td>Make dictionary variable body</td>
420+
</tr>
417421
<tr>
418422
<td>Alt-Up</td>
419423
<td>Move row(s) up</td>
@@ -455,8 +459,8 @@ def bind_keys_to_evt_menu(target, actions):
455459
<td>Delete cell(s)</td>
456460
</tr>
457461
<tr>
458-
<td>CtrlCmd-5</td>
459-
<td>Make dictionary variable body</td>
462+
<td>CtrlCmd-Shift Click on Folding marker</td>
463+
<td>Expands or Collapses all Folding markers</td>
460464
</tr>
461465
<tr>
462466
<td>Enter</td>

src/robotide/controller/ctrlcommands.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626
from ..utils import variablematcher
2727

2828

29+
BDD_ENGLISH = 'Given|When|Then|And|But'
30+
31+
def obtain_bdd_prefixes(language):
32+
from robotide.lib.compat.parsing.language import Language
33+
lang = Language.from_name(language[0] if isinstance(language, list) else language)
34+
bdd_prefixes = [f"{x}|" for x in lang.bdd_prefixes]
35+
bdd_prefixes = "".join(bdd_prefixes).strip('|')
36+
return bdd_prefixes
37+
38+
2939
class Occurrence(object):
3040

3141
def __init__(self, item, value):
@@ -279,16 +289,22 @@ class NullObserver(object):
279289

280290

281291
class RenameKeywordOccurrences(_ReversibleCommand):
282-
_gherkin_prefix = re.compile('^(Given|When|Then|And|But) ', re.IGNORECASE)
283292

284-
def __init__(self, original_name, new_name, observer, keyword_info=None):
293+
def __init__(self, original_name, new_name, observer, keyword_info=None, language='En'):
294+
self._language = language[0] if isinstance(language, list) else language
295+
if self._language.lower() not in ['en', 'english']:
296+
bdd_prefix = f"{obtain_bdd_prefixes(self._language)}|{BDD_ENGLISH}"
297+
else:
298+
bdd_prefix = BDD_ENGLISH
299+
self._gherkin_prefix = re.compile(f'^({bdd_prefix}) ', re.IGNORECASE)
285300
self._original_name, self._new_name = self._check_gherkin(new_name, original_name)
286301
self._observer = observer
287302
self._keyword_info = keyword_info
288303
self._occurrences = None
289304
# print(f"DEBUG: ctrlcommands.py RenameKeywordOccurrences INIT\n"
290-
# f"{original_name=}, {new_name=}, self._original_name={self._original_name} "
291-
# f"self._new_name={self._new_name} self._keyword_info={self._keyword_info} ")
305+
# f"{original_name=}, {new_name=}, self._original_name={self._original_name} "
306+
# f"self._new_name={self._new_name} self._keyword_info={self._keyword_info}"
307+
# f" self._gherkin_prefix={self._gherkin_prefix} ")
292308

293309
def _check_gherkin(self, new_name, original_name):
294310
was_gherkin, keyword_name = self._get_gherkin(original_name)
@@ -1339,7 +1355,7 @@ def _get_undo_command(self):
13391355

13401356

13411357
INDENTED_INNER = ['ELSE', 'ELSE IF', 'EXCEPT', 'FINALLY']
1342-
INDENTED_START = ['FOR', 'IF', 'WHILE', 'TRY'] + INDENTED_INNER
1358+
INDENTED_START = ['FOR', 'GROUP', 'IF', 'WHILE', 'TRY'] + INDENTED_INNER
13431359

13441360

13451361
def is_indent_start(cell):

src/robotide/controller/macrocontrollers.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
TESTCASE_NAME_FIELD = 'Test Case Name'
3434

3535

36+
def obtain_bdd_prefixes(language):
37+
from robotide.lib.compat.parsing.language import Language
38+
lang = Language.from_name(language[0] if isinstance(language, list) else language)
39+
bdd_prefixes = lang.bdd_prefixes
40+
return list(bdd_prefixes)
41+
3642
def _empty_step():
3743
return robotapi.Step([])
3844

@@ -161,7 +167,6 @@ def update_namespace(self):
161167
self.datafile_controller.update_namespace()
162168

163169
def get_local_namespace(self):
164-
# print(f"DEBUG: local namespace controller.namespace {self.datafile_controller.namespace}")
165170
return local_namespace(self, self.datafile_controller.namespace)
166171

167172
def get_local_namespace_for_row(self, row):
@@ -239,10 +244,15 @@ def create_keyword(self, name, argstr):
239244
raise ValueError(validation.error_message)
240245
return self.datafile_controller.create_keyword(name, argstr)
241246

242-
@staticmethod
243-
def _remove_bdd_prefix(name):
247+
def _remove_bdd_prefix(self, name):
248+
bdd_prefix = []
249+
language = self.language[0] if isinstance(self.language, list) else self.language
250+
if language and language.lower() not in ['en', 'english']:
251+
bdd_prefix = [f"{x.lower()} " for x in obtain_bdd_prefixes(language)]
252+
bdd_prefix += ['given ', 'when ', 'then ', 'and ', 'but ']
253+
# print(f"DEBUG: macrocontrollers.py WithStepsController _remove_bdd_prefix bdd_prefix={bdd_prefix}")
244254
matcher = name.lower()
245-
for match in ['given ', 'when ', 'then ', 'and ', 'but ']:
255+
for match in bdd_prefix:
246256
if matcher.startswith(match):
247257
return name[len(match):]
248258
return name

0 commit comments

Comments
 (0)