Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup code #2905

Merged
merged 17 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- master
- develop
- cleanup_code
jobs:
sonarcloud:
name: SonarCloud
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
'psutil',
'Pywin32; sys_platform=="win32"',
'wxPython',
'packaging']
'packaging',
'requests>=2.32.2']

PACKAGE_DATA = {
'robotide.preferences': ['settings.cfg'],
Expand Down
1 change: 1 addition & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sonar.projectKey=HelioGuilherme66_RIDE
sonar.organization=helioguilherme66
sonar.host.url=https://sonarcloud.io
sonar.python.version=3.10
sonar.projectVersion=v2.1
sonar.sources=src/
sonar.tests=utest/
sonar.exclusions=**/lib/robot/**/*
Expand Down
32 changes: 18 additions & 14 deletions src/robotide/editor/dialoghelps.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
_ = GetTranslation # To keep linter/code analyser happy
builtins.__dict__['_'] = GetTranslation

PH_ESCAPE ="%(ESCAPE)s" # PH = Place Holder
INHERIT_TAG = "Inherited tags are not shown in this view."
PH_TAGS = "%(TAG)s"
PH_FIXTURE = "%(FIXTURE)s"

def get_help(title):
_HELPS = {}
Expand All @@ -46,44 +50,44 @@ def get_help(title):
_("Give name, optional arguments and optional alias of the library to import."),
_("Separate multiple arguments with a pipe character like 'arg 1 | arg 2'."), "%(ALIAS)s", '',
"Variables", _("Give path and optional arguments of the variable file to import."),
_("Separate multiple arguments with a pipe character like 'arg 1 | arg 2'."), "%(ESCAPE)s", '',
_("Separate multiple arguments with a pipe character like 'arg 1 | arg 2'."), PH_ESCAPE, '',
"Resource", _("Give path to the resource file to import."),
_("Existing resources will be automatically loaded to the resource tree."),
_("New resources must be created separately."), '', "Documentation", _("Give the documentation."),
_("Simple formatting like *bold* and _italic_ can be used."),
_("Additionally, URLs are converted to clickable links."), '', "Force Tags",
_("These tags are set to all test cases in this test suite."),
_("Inherited tags are not shown in this view."), "%(TAG)s", "%(ESCAPE)s", '', "Default Tags",
_(INHERIT_TAG), PH_TAGS, PH_ESCAPE, '', "Default Tags",
_("These tags are set to all test cases in this test suite unless test cases have their own tags."),
"%(TAG)s", "%(ESCAPE)s", '', "Test Tags",
PH_TAGS, PH_ESCAPE, '', "Test Tags",
_("These tags are applied to all test cases in this test suite. "
"This field exists since Robot Framework 6.0 and will replace "
"Force and Default Tags after version 7.0."), _("Inherited tags are not shown in this view."),
"%(TAG)s", "%(ESCAPE)s", '', "Tags",
"Force and Default Tags after version 7.0."), _(INHERIT_TAG),
PH_TAGS, PH_ESCAPE, '', "Tags",
_("These tags are set to this test case in addition to "
"Force Tags and they override possible Default Tags."),
_("Inherited tags are not shown in this view."), "%(TAG)s", "%(ESCAPE)s", '', "Suite Setup",
_(INHERIT_TAG), PH_TAGS, PH_ESCAPE, '', "Suite Setup",
_("This keyword is executed before executing any of the test cases or lower level suites."),
"%(FIXTURE)s", "%(ESCAPE)s", '', "Suite Teardown",
PH_FIXTURE, PH_ESCAPE, '', "Suite Teardown",
_("This keyword is executed after all test cases and lower level suites have been executed."),
"%(FIXTURE)s", "%(ESCAPE)s", '', "Test Setup",
PH_FIXTURE, PH_ESCAPE, '', "Test Setup",
_("This keyword is executed before every test case in this suite unless test cases override it."),
"%(FIXTURE)s", "%(ESCAPE)s", '', "Test Teardown",
PH_FIXTURE, PH_ESCAPE, '', "Test Teardown",
_("This keyword is executed after every test case in this suite unless test cases override it."),
"%(FIXTURE)s", "%(ESCAPE)s", '', "Setup",
PH_FIXTURE, PH_ESCAPE, '', "Setup",
_("This keyword is executed before other keywords in this test case or keyword."),
_("In test cases, overrides possible Test Setup set on the suite level."),
_("Setup in keywords exists since Robot v7.0."), "%(FIXTURE)s", "%(ESCAPE)s", '', "Teardown",
_("Setup in keywords exists since Robot v7.0."), PH_FIXTURE, PH_ESCAPE, '', "Teardown",
_("This keyword is executed after other keywords in this test case or keyword even if the test or "
"keyword fails."),
_("In test cases, overrides possible Test Teardown set on the suite level."),
"%(FIXTURE)s", "%(ESCAPE)s", '', "Test Template",
PH_FIXTURE, PH_ESCAPE, '', "Test Template",
_("Specifies the default template keyword used by tests in this suite."),
_("The test cases will contain only data to use as arguments to that keyword."), '', "Template",
_("Specifies the template keyword to use."),
_("The test itself will contain only data to use as arguments to that keyword."), '', "Arguments",
"%(ARGUMENTS)s", "%(ESCAPE)s", '', "Return Value",
_("Specify the return value. Use a pipe character to separate multiple values."), "%(ESCAPE)s",
"%(ARGUMENTS)s", PH_ESCAPE, '', "Return Value",
_("Specify the return value. Use a pipe character to separate multiple values."), PH_ESCAPE,
"The '[Return]' setting is deprecated since Robot v7.0. Use the 'RETURN' statement instead.", '',
"Test Timeout",
_("Maximum time test cases in this suite are allowed to execute before aborting them forcefully."),
Expand Down
63 changes: 36 additions & 27 deletions src/robotide/editor/editordialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
_ = wx.GetTranslation # To keep linter/code analyser happy
builtins.__dict__['_'] = wx.GetTranslation

FORCE_TAGS = 'Force Tags'
DEFAULT_TAGS = 'Default Tags'
TEST_TAGS = 'Test Tags'
SUITE_SETUP = 'Suite Setup'
SUITE_TEAR = 'Suite Teardown'
TEST_SETUP = 'Test Setup'
TEST_TEAR = 'Test Teardown'
RET_VAL = 'Return Value'
TEST_TEMPL = 'Test Template'

def editor_dialog(obj, lang='en'):
set_lang = lang if lang and len(lang) > 0 else 'en'
Expand Down Expand Up @@ -295,11 +304,11 @@ def _execute(self):


class ForceTagsDialog(_SettingDialog):
_title_nt = 'Force Tags'
_title_nt = FORCE_TAGS

def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Force Tags'):
def __init__(self, controller, item=None, plugin=None, title=None, title_nt=FORCE_TAGS):
__ = title
self._title = _('Force Tags')
self._title = _(FORCE_TAGS)
_SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt)

def _execute(self):
Expand All @@ -308,11 +317,11 @@ def _execute(self):


class DefaultTagsDialog(_SettingDialog):
_title_nt = 'Default Tags'
_title_nt = DEFAULT_TAGS

def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Default Tags'):
def __init__(self, controller, item=None, plugin=None, title=None, title_nt=DEFAULT_TAGS):
__ = title
self._title = _('Default Tags')
self._title = _(DEFAULT_TAGS)
_SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt)

def _execute(self):
Expand All @@ -321,11 +330,11 @@ def _execute(self):


class TestTagsDialog(_SettingDialog):
_title_nt = 'Test Tags'
_title_nt = TEST_TAGS

def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Test Tags'):
def __init__(self, controller, item=None, plugin=None, title=None, title_nt=TEST_TAGS):
__ = title
self._title = _('Test Tags')
self._title = _(TEST_TAGS)
_SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt)

def _execute(self):
Expand Down Expand Up @@ -367,11 +376,11 @@ def _execute(self):

class SuiteSetupDialog(_FixtureDialog):
tooltip = _("Suite Setup is run before any tests")
_title_nt = 'Suite Setup'
_title_nt = SUITE_SETUP

def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Suite Setup'):
def __init__(self, controller, item=None, plugin=None, title=None, title_nt=SUITE_SETUP):
__ = title
self._title = _('Suite Setup')
self._title = _(SUITE_SETUP)
_FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt)

def _execute(self):
Expand All @@ -380,11 +389,11 @@ def _execute(self):


class SuiteTeardownDialog(_FixtureDialog):
_title_nt = 'Suite Teardown'
_title_nt = SUITE_TEAR

def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Suite Teardown'):
def __init__(self, controller, item=None, plugin=None, title=None, title_nt=SUITE_TEAR):
__ = title
self._title = _('Suite Teardown')
self._title = _(SUITE_TEAR)
_FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt)

def _execute(self):
Expand All @@ -394,11 +403,11 @@ def _execute(self):

class TestSetupDialog(_FixtureDialog):
__test__ = False
_title_nt = 'Test Setup'
_title_nt = TEST_SETUP

def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Test Setup'):
def __init__(self, controller, item=None, plugin=None, title=None, title_nt=TEST_SETUP):
__ = title
self._title = _('Test Setup')
self._title = _(TEST_SETUP)
_FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt)

def _execute(self):
Expand All @@ -408,11 +417,11 @@ def _execute(self):

class TestTeardownDialog(_FixtureDialog):
__test__ = False
_title_nt = 'Test Teardown'
_title_nt = TEST_TEAR

def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Test Teardown'):
def __init__(self, controller, item=None, plugin=None, title=None, title_nt=TEST_TEAR):
__ = title
self._title = _('Test Teardown')
self._title = _(TEST_TEAR)
_FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt)

def _execute(self):
Expand Down Expand Up @@ -463,11 +472,11 @@ def _execute(self):

class TestTemplateDialog(_FixtureDialog):
__test__ = False
_title_nt = 'Test Template'
_title_nt = TEST_TEMPL

def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Test Template'):
def __init__(self, controller, item=None, plugin=None, title=None, title_nt=TEST_TEMPL):
__ = title
self._title = _('Test Template')
self._title = _(TEST_TEMPL)
_FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt)

def _execute(self):
Expand All @@ -492,11 +501,11 @@ def _execute(self):


class ReturnValueDialog(_SettingDialog):
_title_nt = 'Return Value'
_title_nt = RET_VAL

def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Return Value'):
def __init__(self, controller, item=None, plugin=None, title=None, title_nt=RET_VAL):
__ = title
self._title = _('Return Value')
self._title = _(RET_VAL)
_SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt)

def _execute(self):
Expand Down
Loading
Loading