Skip to content

Commit 0c96417

Browse files
Library installer (#2961)
* Initial files for LibraryFinder * Installation and Documentation for known libraries OK. Missing dialogs for unknown libraries. * Add more libraries to Lib Finder * Add CSVLibrary. Working dialogs. Bad column size for list of commands * Better dialog for Library Installer * Add DataDriver. Always show Open Documentation for libraries. * Fix Library Finder dialog help * Add known libraries to autocomplete * Exclude utests in Windows * Renamed funtion that was being considered a test * Prevent storing lib info for Standard libs. Fits unitest WIP * Unit tests for Library Finder at 57% * Improve tests cases * Update translations and docs * Update PT translations
1 parent 232ae64 commit 0c96417

File tree

80 files changed

+5774
-2871
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+5774
-2871
lines changed

CHANGELOG.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
99
== https://github.com/robotframework/RIDE[Unreleased]
1010

1111
=== Added
12+
- Added Tools->Library Finder... to install libraries and Help->Open Library Documentation... . They share the same dialog, and definitions are recorded in ``settings.cfg``.
13+
- Added context menu to install libraries and to open documentation in Grid Editor Import section. Same as above description.
1214
- Added keyboard shortcuts ``Ctrl-Shift-Up`` and ``Ctrl-Shift-Down`` as alternatives to ``Alt-Up`` and ``Alt-Down`` to move rows in Grid and Text Editors.
1315
- Added Settings Editor button to Preferences dialog, to edit settings.cfg.
1416
- Created backup of settings.cfg to allow recovering some settings when broken upgrades.

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Likewise, the current version of wxPython, is 4.2.3, but RIDE is known to work w
4141

4242
`pip install -U robotframework-ride`
4343

44-
(3.8 <= python <= 3.13) Install current development version (**2.2dev30**) with:
44+
(3.8 <= python <= 3.13) Install current development version (**2.2dev31**) with:
4545

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

src/robotide/application/CHANGELOG.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
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 Tools→Library Finder… to install libraries and Help→Open Library Documentation… . They share the same dialog, and definitions are recorded in ``settings.cfg``.
5+
</li><li class="listitem">
6+
Added context menu to install libraries and to open documentation in Grid Editor Import section. Same as above description.
7+
</li><li class="listitem">
48
Added keyboard shortcuts ``Ctrl-Shift-Up`` and ``Ctrl-Shift-Down`` as alternatives to ``Alt-Up`` and ``Alt-Down`` to move rows in Grid and Text Editors.
59
</li><li class="listitem">
610
Added Settings Editor button to Preferences dialog, to edit settings.cfg.

src/robotide/application/releasenotes.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def set_content(self, html_win, content):
150150
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
153-
<a class="reference external" href="https://robotframework.org/">Robot Framework</a> current version, 7.3. However,
153+
<a class="reference external" href="https://robotframework.org/">Robot Framework</a> current version, 7.3.1. However,
154154
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 (and also tested on 3.14.a7 with wxPython 4.2.3).</li>
@@ -172,6 +172,10 @@ def set_content(self, html_win, content):
172172
</ul>
173173
<p><strong>New Features and Fixes Highlights</strong></p>
174174
<ul class="simple">
175+
<li>Added <b>Tools-&gt;Library Finder...</b> to install libraries and <b>Help-&gt;Open Library Documentation...</b> .
176+
They share the same dialog, and definitions are recorded in ``settings.cfg``.</li>
177+
<li>Added context menu to install libraries and to open documentation in Grid Editor Import section.
178+
Same as above description.</li>
175179
<li>Added keyboard shortcuts <b>Ctrl-Shift-Up</b> and <b>Ctrl-Shift-Down</b> as alternatives to <b>Alt-Up</b> and
176180
<b>Alt-Down</b> to move rows in Grid and Text Editors.</li>
177181
<li>Improved vertical scroll in Grid Editor, by having main scroll bars out of cells.</li>
@@ -243,7 +247,7 @@ def set_content(self, html_win, content):
243247
<pre class="literal-block">python -m robotide.postinstall -install</pre>
244248
<p>or</p>
245249
<pre class="literal-block">ride_postinstall.py -install</pre>
246-
<p>RIDE {VERSION} was released on 06/June/2025.</p>
250+
<p>RIDE {VERSION} was released on 16/June/2025.</p>
247251
<!-- <br/>
248252
<h3>May The Fourth Be With You!</h3>
249253
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>

src/robotide/context/coreplugins.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ def get_core_plugins():
2525
from ..parserlog import ParserLogPlugin
2626
from ..searchtests.searchtests import TestSearchPlugin
2727
from ..spec.specimporter import SpecImporterPlugin
28+
from ..spec.libraryfinder import LibraryFinderPlugin
2829
from ..postinstall.desktopshortcut import ShortcutPlugin
2930

30-
return [LogPlugin, RunAnything, RecentFilesPlugin, SpecImporterPlugin, EditorPlugin, TextEditorPlugin,
31-
KeywordSearch, TestSearchPlugin, ShortcutPlugin, ParserLogPlugin, TreePlugin, FileExplorerPlugin]
31+
return [LogPlugin, RunAnything, RecentFilesPlugin, SpecImporterPlugin, LibraryFinderPlugin, EditorPlugin,
32+
TextEditorPlugin, KeywordSearch, TestSearchPlugin, ShortcutPlugin, ParserLogPlugin, TreePlugin,
33+
FileExplorerPlugin]

src/robotide/editor/dialoghelps.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ def get_help(title):
4949
_("Individual items must be in format `key=value`"), '', "Library",
5050
_("Give name, optional arguments and optional alias of the library to import."),
5151
_("Separate multiple arguments with a pipe character like 'arg 1 | arg 2'."), "%(ALIAS)s", '',
52+
"Library Finder", _("Give library name, library documentation URL and command to install."),
53+
_("In the command, you can use `%%executable` as a placeholder to be replaced by the actual path"),
54+
_(" to Python executable."), '',
5255
"Variables", _("Give path and optional arguments of the variable file to import."),
5356
_("Separate multiple arguments with a pipe character like 'arg 1 | arg 2'."), PH_ESCAPE, '',
5457
"Resource", _("Give path to the resource file to import."),

src/robotide/editor/editordialogs.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,49 @@ def _execute(self):
215215
pass
216216

217217

218+
219+
class LibraryFinderDialog(_Dialog):
220+
221+
_history_suggester = HistorySuggester()
222+
223+
def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Library Finder'):
224+
if title:
225+
self._title = title
226+
else:
227+
self._title = _('Library')
228+
self._title_nt = title_nt
229+
self._library_suggester = LibrariesSuggester(controller, self._history_suggester)
230+
_Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title)
231+
232+
def _get_editors(self, item):
233+
name = item and item.name or ''
234+
doc_url = item and item.documentation or ''
235+
command = item and item.command or ''
236+
str_command = ''
237+
if isinstance(command, list):
238+
str_command = " | ".join(command).strip(" |")
239+
else:
240+
str_command = command
241+
self._suggester = LibrariesSuggester(self._controller, self._library_suggester)
242+
return [FileNameEditor(self, name, _('Name'), self._controller,
243+
suggestion_source=self._suggester),
244+
ValueEditor(self, doc_url, _('Documentation')),
245+
ValueEditor(self, str_command, _('Command'))]
246+
247+
def _add_comment_editor(self, item):
248+
_ = item # No comments :)
249+
pass
250+
251+
def get_value(self):
252+
values = _Dialog.get_value(self)
253+
self._history_suggester.store(values[0])
254+
return values
255+
256+
def _execute(self):
257+
""" Just ignore it """
258+
pass
259+
260+
218261
class VariablesDialog(LibraryDialog):
219262
_title_nt = 'Variables'
220263

src/robotide/editor/settingeditors.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131
from .. import utils
3232
from ..controller import ctrlcommands
3333
from ..publish import PUBLISHER
34-
from ..publish.messages import (RideImportSetting, RideOpenVariableDialog, RideExecuteSpecXmlImport, RideSaving,
35-
RideVariableAdded, RideVariableUpdated, RideVariableRemoved)
34+
from ..publish.messages import (RideImportSetting, RideOpenVariableDialog, RideExecuteSpecXmlImport,
35+
RideOpenLibraryDocumentation, RideSaving, RideVariableAdded,
36+
RideVariableUpdated, RideVariableRemoved, RideExecuteLibraryInstall)
3637
from ..utils.highlightmatcher import highlight_matcher
3738
from ..widgets import ButtonWithHandler, Label, HtmlWindow, PopupMenu, PopupMenuItems, HtmlDialog
3839

@@ -626,16 +627,27 @@ def _create_item_menu(self):
626627
menu = self._menu
627628
menu_nt = self._menu_nt
628629
item = self._controller[self._selection]
629-
if item.has_error() and item.type == 'Library':
630-
menu = menu[:] + [_('Import Library Spec XML')]
631-
menu_nt = menu_nt[:] + ['Import Library Spec XML']
630+
if item.type == 'Library':
631+
menu = menu[:] + [_('Open Library Documentation')]
632+
menu_nt = menu_nt[:] + ['Open Library Documentation']
633+
if item.has_error() and item.name != "Remote":
634+
menu = menu[:] + [_('Import Library Spec XML'), _('Install Library')]
635+
menu_nt = menu_nt[:] + ['Import Library Spec XML', 'Install Library']
632636
return menu, menu_nt
633637

634638
@staticmethod
635639
def on_import_library_spec_xml(event):
636640
__ = event
637641
RideExecuteSpecXmlImport().publish()
638642

643+
def on_open_library_documentation(self, event):
644+
item = self._controller[self._selection]
645+
RideOpenLibraryDocumentation(item=item.name).publish()
646+
647+
def on_install_library(self, event):
648+
item = self._controller[self._selection]
649+
RideExecuteLibraryInstall(item=item.name).publish()
650+
639651
def on_edit(self, event):
640652
setting = self._get_setting()
641653
self._show_import_editor_dialog(

0 commit comments

Comments
 (0)