Skip to content

Commit

Permalink
Merge pull request #2627 from HelioGuilherme66/misc_fixes
Browse files Browse the repository at this point in the history
Add support for JSON variables, from installed Robot modules
  • Loading branch information
HelioGuilherme66 authored Aug 31, 2023
2 parents c590353 + c4f6b73 commit e53a4d7
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni

=== Added

-
- Added support for JSON variables, by using the installed Robot Framework import method

=== Fixed

Expand Down
6 changes: 5 additions & 1 deletion src/robotide/application/CHANGELOG.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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>
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><p>-</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_fixed"></a>1.2. Fixed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
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">
Added support for JSON variables, by using the installed Robot Framework import method
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_fixed"></a>1.2. Fixed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Colorization of Grid Editor cells after the continuation marker ``…`` and correct parsing of those lines
</li><li class="listitem">
Colorization of Grid Editor cells when contents is list or dictionary variables
Expand All @@ -11,6 +13,8 @@
</li><li class="listitem">
Drag and drop of variables defined with comments between resource files
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_changed"></a>1.3. Changed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Improved keyword ``Find Usages`` to return more matches. Fails to find mixed spaces and ``_``
</li><li class="listitem">
In Grid Editor ``Ctrl-Shift-4`` now replaces escaped spaces ``\\ `` by spaces
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_removed"></a>1.4. Removed</h3></div></div></div><p>-</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_ulink_url_https_github_com_robotframework_ride_blob_master_doc_releasenotes_ride_2_0_7_rst_2_0_7_ulink_2023_08_13"></a>2. <a class="ulink" href="https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride-2.0.7.rst" target="_top">2.0.7</a> - 2023-08-13</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_added_2"></a>2.1. Added</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Added indication of matching brackets, ``()``, ``{}``, ``[]``, in Text Editor
Expand Down
5 changes: 3 additions & 2 deletions src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def set_content(self, html_win, content):
</ul>
<p><strong>New Features and Fixes Highlights</strong></p>
<ul class="simple">
<li>Colorization of Grid Editor cells after the continuation marker <b>…</b> and correct parsing of those lines</li>
<li>Added support for JSON variables, by using the installed Robot Framework import method</li>
<li>Colorization of Grid Editor cells after the continuation marker <b>...</b> and correct parsing of those lines</li>
<li>Colorization of Grid Editor cells when contents is list or dictionary variables</li>
<li>Added indication of matching brackets, <b>()</b>, <b>"""'''{}'''f"""</b>, <b>[]</b>, in Text Editor</li>
<li>Fixed non syncronized expanding/collapse of Settings panel in Grid Editor, on Linux</li>
Expand Down Expand Up @@ -232,6 +233,6 @@ def set_content(self, html_win, content):
<pre class="literal-block">
python -m robotide.postinstall -install
</pre>
<p>RIDE {VERSION} was released on 23/Aug/2023.</p>
<p>RIDE {VERSION} was released on 31/Aug/2023.</p>
</div>
"""
4 changes: 2 additions & 2 deletions src/robotide/lib/robot/variables/filesetter.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def __init__(self, store):
self._store = store

def set(self, path_or_variables, args=None, overwrite=False):
variables = self.import_if_needed(path_or_variables, args)
variables = self._import_if_needed(path_or_variables, args)
self._set(variables, overwrite)
return variables

def import_if_needed(self, path_or_variables, args=None):
def _import_if_needed(self, path_or_variables, args=None):
if not is_string(path_or_variables):
return path_or_variables
LOGGER.info("Importing variable file '%s' with args %s"
Expand Down
2 changes: 1 addition & 1 deletion src/robotide/namespace/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def _empty_value_for_variable_type(name):

def set_from_file(self, varfile_path, args):
try:
vars_from_file = VariableFileSetter(None).import_if_needed(
vars_from_file = VariableFileSetter(None)._import_if_needed(
varfile_path, args)
except (robotapi.DataError, Exception) as e:
print(f"namespace._VariableStash.set_from_file: unexpected DataError: variable_path {varfile_path} "
Expand Down
7 changes: 6 additions & 1 deletion src/robotide/robotapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@
from .lib.robot.utils import normpath, NormalizedDict
from .lib.robot.variables import Variables as RobotVariables
from .lib.robot.variables import is_scalar_var, is_list_var, is_var, is_dict_var, VariableSplitter
from .lib.robot.variables.filesetter import VariableFileSetter
from .lib.robot.variables.tablesetter import VariableTableReader
from .lib.robot.version import ROBOT_VERSION, ALIAS_MARKER
try:
from robot.variables.filesetter import VariableFileSetter
# print("DEBUG: robotapi using installed RobotFramework VariableFileSetter.")
except ImportError:
from .lib.robot.variables.filesetter import VariableFileSetter
print("DEBUG: robotapi using RIDE VariableFileSetter (JSON variables will not be recognized).")

populators.PROCESS_CURDIR = False

Expand Down
2 changes: 1 addition & 1 deletion src/robotide/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.
#
# Automatically generated by `tasks.py`.
VERSION = 'v2.0.8dev6'
VERSION = 'v2.0.8dev7'

0 comments on commit e53a4d7

Please sign in to comment.