Skip to content

Commit c05ab91

Browse files
Add color to links in Console Log of Test Runner, since 7.1rc
1 parent 4ce90dd commit c05ab91

File tree

11 files changed

+62
-18
lines changed

11 files changed

+62
-18
lines changed

CHANGELOG.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
1111

1212
=== Added
1313

14+
- Added color to Test Runner Console Log final output, report and log since RF v7.1rc1.
1415
- Added Korean language support for UI, experimental.
1516
- Added option ``caret style`` to change insert caret to `block` or `line` in Text Editor, by editing ``settings.cfg``.
1617
The color of the caret is the same as `setting` and will be adjusted for better contrast with the background.

README.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.1, but RIDE is known to work w
4040

4141
`pip install -U robotframework-ride`
4242

43-
(3.8 <= python <= 3.12) Install current development version (**2.1dev72**) with:
43+
(3.8 <= python <= 3.12) Install current development version (**2.1dev73**) with:
4444

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

src/robotide/application/CHANGELOG.html

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Changelog</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id1337"></a>Changelog</h2></div></div><hr /></div><p>All notable changes to this project will be documented in this file.</p><p>The format is based on <a class="ulink" href="http://keepachangelog.com/en/1.0.0/" target="_top">Keep a Changelog</a>
33
and this project adheres to <a class="ulink" href="http://semver.org/spec/v2.0.0.html" target="_top">Semantic Versioning</a>.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_ulink_url_https_github_com_robotframework_ride_unreleased_ulink"></a>1. <a class="ulink" href="https://github.com/robotframework/RIDE" target="_top">Unreleased</a></h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_added"></a>1.1. Added</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
4+
Added color to Test Runner Console Log final output, report and log since RF v7.1rc1.
5+
</li><li class="listitem">
46
Added Korean language support for UI, experimental.
57
</li><li class="listitem">
68
Added option ``caret style`` to change insert caret to <code class="literal">block</code> or <code class="literal">line</code> in Text Editor, by editing ``settings.cfg``.

src/robotide/application/releasenotes.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def set_content(self, html_win, content):
197197
</ul>
198198
<p><strong>New Features and Fixes Highlights</strong></p>
199199
<ul class="simple">
200+
<li>Added color to Test Runner Console Log final output, report and log since RF v7.1rc1.</li>
200201
<li>Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared.</li>
201202
<li>Added Korean language support for UI, experimental.</li>
202203
<li>Fixed wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.</li>
@@ -326,7 +327,7 @@ def set_content(self, html_win, content):
326327
<pre class="literal-block">
327328
python -m robotide.postinstall -install
328329
</pre>
329-
<p>RIDE {VERSION} was released on 31/August/2024.</p>
330+
<p>RIDE {VERSION} was released on 03/September/2024.</p>
330331
<!-- <br/>
331332
<h3>May The Fourth Be With You!</h3>
332333
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>

src/robotide/contrib/testrunner/testrunnerplugin.py

+24-5
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
STYLE_PASS = 1
117117
STYLE_SKIP = 3
118118
STYLE_FAIL = 4
119+
STYLE_LINK = 5
119120
FILE_MANAGER = 'file manager'
120121

121122
ATEXIT_LOCK = threading.RLock()
@@ -634,6 +635,8 @@ def _append_text(self, text_ctrl, text, source="stdout"):
634635
style = STYLE_PASS
635636
elif item[1] == 'YELLOW':
636637
style = STYLE_SKIP
638+
elif item[1] == 'BLUE':
639+
style = STYLE_LINK
637640
elif item[1] is None:
638641
style = STYLE_DEFAULT
639642
if style:
@@ -660,7 +663,9 @@ def parse_colors(self, txt):
660663
# print(f"{str(txt[idx])}")
661664
if txt[idx] == 27: # .startswith('\033[32m'):
662665
color = False
663-
# print(f"DEBUG: parse_colors got ESC, {txt[idx+1:idx+5]}")
666+
if txt[idx + 1:idx+5] == b']8;;' and txt[idx+6] != 27: # New file:// URI in RF 7.1, Start
667+
color = True
668+
self.store_color(idx, 'BLUE')
664669
if txt[idx + 1:idx+5] == b'[34m':
665670
color = True
666671
self.store_color(idx, 'BLUE')
@@ -681,6 +686,12 @@ def parse_colors(self, txt):
681686
# print(f"DEBUG: parse_colors reset to NORMAL")
682687
self.store_color(idx, None)
683688
txt = txt[:idx] + txt[idx+4:]
689+
elif txt[idx + 1] == 92:
690+
self.store_color(idx, None)
691+
txt = txt[:idx] + txt[idx+2:]
692+
elif txt[idx + 1:idx + 7] == b']8;;\x1b\\': # New file:// URI in RF 7.1, End
693+
self.store_color(idx, None)
694+
txt = txt[:idx] + txt[idx + 7:]
684695
elif color:
685696
txt = txt[:idx] + txt[idx+5:]
686697
if idx >= len(txt):
@@ -1127,7 +1138,7 @@ def __init__(self, parent, fail_color='#FF8E8E', pass_color="#9FCC9F", skip_colo
11271138
self._gauge = wx.Gauge(self, size=(100, 15), style=wx.GA_HORIZONTAL)
11281139
self._label = Label(self)
11291140
self._sizer.Add(self._label, 1, wx.EXPAND | wx.LEFT, 10)
1130-
self._sizer.Add(self._gauge, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 15)
1141+
self._sizer.Add(self._gauge, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 20)
11311142
self._sizer.Layout()
11321143
self.SetSizer(self._sizer)
11331144
self._gauge.Hide()
@@ -1305,6 +1316,7 @@ def _set_styles(self):
13051316
self.fail_color = self.settings.get('fail color', '#FF8E8E')
13061317
self.pass_color = self.settings.get('pass color', '#9FCC9F')
13071318
self.skip_color = self.settings.get('skip color', 'yellow')
1319+
self.link_color = self.settings.get('link color', '#1E1EFF')
13081320

13091321
default_style = self._get_style_string(
13101322
fore=self.settings.get('foreground', 'black'), back=background,
@@ -1315,20 +1327,27 @@ def _set_styles(self):
13151327
fail_style = self._get_style_string(fore=self.fail_color, back=background, size=font_size, face=font_face)
13161328
pass_style = self._get_style_string(fore=self.pass_color, back=background, size=font_size, face=font_face)
13171329
skip_style = self._get_style_string(fore=self.skip_color, back=background, size=font_size, face=font_face)
1330+
link_style = self._get_style_string(fore=self.link_color, back=background, size=font_size, face=font_face,
1331+
bold='bold')
13181332

13191333
self.editor.StyleSetSpec(STYLE_DEFAULT, default_style)
13201334
self.editor.StyleSetSpec(STYLE_STDERR, error_style)
13211335
self.editor.StyleSetSpec(STYLE_FAIL, fail_style)
13221336
self.editor.StyleSetSpec(STYLE_PASS, pass_style)
13231337
self.editor.StyleSetSpec(STYLE_SKIP, skip_style)
1338+
self.editor.StyleSetSpec(STYLE_LINK, link_style)
13241339
self.editor.StyleSetSpec(7, error_style)
13251340
self.editor.StyleSetBackground(wx.stc.STC_STYLE_DEFAULT, background)
13261341
self.editor.Refresh()
13271342

13281343
@staticmethod
1329-
def _get_style_string(back, fore, size, face):
1330-
return ','.join('%s:%s' % (name, value)
1331-
for name, value in locals().items() if value)
1344+
def _get_style_string(back, fore, size, face, bold=None):
1345+
# print(f"DEBUG: testrunnerplugin.py get_style_string locals={locals().items()}")
1346+
style = ','.join('%s:%s' % (name, value)
1347+
for name, value in locals().items() if value and name!='bold')
1348+
if bold is not None:
1349+
style += ',bold'
1350+
return style
13321351

13331352
def _ensure_default_font_is_valid(self):
13341353
"""Checks if default font is installed"""

src/robotide/lib/robot/parsing/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,5 +477,5 @@ def _populate(self, item_class, data, comment):
477477

478478
class MetadataList(_DataList):
479479

480-
def populate(self, name, value, comment):
480+
def populate(self, name, value, comment=''):
481481
self._add(Metadata(self._parent, name, value, comment, joined=True))

src/robotide/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#
1616
# Automatically generated by `tasks.py`.
1717

18-
VERSION = 'v2.1dev72'
18+
VERSION = 'v2.1dev73'

utest/resources/robotdata/language/en/full_test_en.robot

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ${myvar} 123 # This is a comment
2424
*** Comments ***
2525
This is a comments block
2626
Second line of comments
27+
# Comment inside second comments block
2728

2829
*** Test Cases ***
2930
first test

utest/resources/robotdata/language/pt/full_task_pt.robot

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Documentação This is the documentation
1212
... A continued line of documentation
1313
Inicialização de Suíte No Operation
1414
Finalização de Suíte No Operation
15-
Metadados Nome Value
15+
Metadados Nome Value # A comment
1616
Biblioteca Process
1717
Recurso full_pt.resource
1818
Variável full_pt.yaml

utest/resources/robotdata/language/pt/full_test_pt.robot

+4-8
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,18 @@ Biblioteca Process
1414
Recurso full_pt.resource
1515
Variável full_pt.yaml
1616
Variável full_pt.json
17-
Variável full_pt.py
18-
# Comment inside settings block, next is empty line followed by documention
17+
Variável full_pt.py # Comment inside settings block, next is empty line followed by documention
1918

2019
Documentação This is the documentation
2120
... A continued line of documentation
2221

23-
Metadados Nome Value
24-
# Comment inside settings block after metadata, next is empty line followed by suite setup
22+
Metadados Nome Value # Comment inside settings block after metadata, next is empty line followed by suite setup
2523

2624
Inicialização de Suíte No Operation
27-
Finalização de Suíte No Operation
28-
# Comment inside settings block after suite teardown, next is empty line followed by variables section
25+
Finalização de Suíte No Operation # Comment inside settings block after suite teardown, next is empty line followed by variables section
2926

3027
*** Variáveis ***
31-
${myvar} 123
32-
# Comment inside variables, next is empty line followed by a comments section
28+
${myvar} 123 # Comment inside variables, next is empty line followed by a comments section
3329

3430
*** Comentários ***
3531
This is a comments block
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*** Settings ***
2+
Resource resource.robot
3+
4+
*** Variables ***
5+
${RESOURCE var} Foo
6+
7+
*** Keywords ***
8+
Resource UK
9+
[Documentation] This is a user keyword from resource file
10+
[Timeout]
11+
No Operation
12+
13+
Parametrized UK
14+
[Arguments] ${arg} ${defarg}=def val @{vararg}
15+
[Timeout]
16+
Log Many ${arg} ${defarg} @{vararg}
17+
18+
Funny Def Value
19+
[Arguments] ${arg}=${None} ${urg}=${myvar=foo}
20+
[Timeout]
21+
Log Many ${arg} ${urg}
22+
23+
Duplicate UK
24+
No Operation

0 commit comments

Comments
 (0)