Robot Framework Integrated Development Environment (RIDE)
imports.py
Go to the documentation of this file.
1 # Copyright 2008-2015 Nokia Networks
2 # Copyright 2016- Robot Framework Foundation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 
16 import wx
17 
18 from ..context import IS_WINDOWS
19 from ..ui.preferences_dialogs import PreferencesPanel, comma_separated_value_editor
20 from wx import Colour
21 
23  location = 'Importing'
24  title = 'Library imports and PYTHONPATH'
25 
26  def __init__(self, parent, settings):
27  super(PreferencesPanel, self).__init__(parent)
28  self.SetSizer(wx.FlexGridSizer(rows=4, cols=2, vgap=10, hgap=5))
29  self.Sizer.AddGrowableCol(1, proportion=1)
30  self.background_colorbackground_color = Colour("light gray")
31  self.foreground_colorforeground_color = Colour("black")
32  self._add_settings_add_settings(settings)
33 
34  def _add_settings(self, settings):
35  list_settings = [
36  ('auto imports', 'Comma separated list of libraries to be '
37  'automatically imported.'),
38  ('pythonpath', 'Comma separated list of directories to be added '
39  'to PYTHONPATH when libraries are searched.'),
40  ('library xml directories', 'Comma separated list of directories '
41  'containing library spec files.')
42  ]
43  for (name, _help) in list_settings:
44  self._create_list_setting_editor_create_list_setting_editor(settings, name, _help)
45 
46  def _create_list_setting_editor(self, settings, name, _help):
47  label, editor = comma_separated_value_editor(self, settings, name, name.capitalize(), _help)
48  if IS_WINDOWS:
49  label.SetForegroundColour(self.foreground_colorforeground_color)
50  label.SetBackgroundColour(self.background_colorbackground_color)
51  label.SetOwnBackgroundColour(self.background_colorbackground_color)
52  label.SetOwnForegroundColour(self.foreground_colorforeground_color)
53  self.Sizer.Add(label)
54  self.Sizer.Add(editor, flag=wx.EXPAND)
def _create_list_setting_editor(self, settings, name, _help)
Definition: imports.py:46
def __init__(self, parent, settings)
Definition: imports.py:26
Base class for all preference panels used by PreferencesDialog.
def comma_separated_value_editor(parent, settings, name, label, help='')