16 from datetime
import datetime
20 from wx.adv
import HyperlinkCtrl, EVT_HYPERLINK
22 from .preferences_dialogs
import PreferencesPanel
23 from ..widgets
import RIDEDialog, HtmlWindow
27 location = (
'Excludes')
31 super(ExcludePreferences, self).
__init__(*args, **kwargs)
34 self.
fontfont = self.GetFont()
37 self.SetFont(self.
fontfont)
38 self.SetBackgroundColour(Colour(self.
_general_settings_general_settings[
'background']))
40 self.SetForegroundColour(Colour(self.
_general_settings_general_settings[
'foreground']))
45 sizer = wx.BoxSizer(orient=wx.VERTICAL)
52 need_help = HyperlinkCtrl(self, wx.ID_ANY,
'',
'Need help?')
56 self.Bind(EVT_HYPERLINK, self.
OnHelpOnHelp)
60 style=wx.TE_MULTILINE|wx.TE_NOHIDESEL,
61 size=wx.Size(570, 100),
62 value=self.
_settings_settings.excludes.get_excludes())
65 sizer.Add(self.
_text_box_text_box, proportion=wx.EXPAND)
69 status_and_button_sizer = wx.GridSizer(rows=1, cols=2, vgap=10, hgap=10)
70 save_button = wx.Button(self, id=wx.ID_SAVE)
73 status_and_button_sizer.Add(save_button)
74 self.Bind(wx.EVT_BUTTON, self.
OnSaveOnSave)
77 sizer.Add(status_and_button_sizer)
81 self.
_settings_settings.excludes.write_excludes(set(text.split(
'\n')))
82 save_label =
'Saved at %s. Reload the project for changes to take an effect.' %\
83 datetime.now().strftime(
'%H:%M:%S')
92 help =
"""<font size="5">
95 Paths to excludes are described in the text box, one exclude per row.
96 These excludes are saved in a file which is located at $HOME/.robotframework/ride/excludes on POSIX-systems and
97 %APPDATA%\\RobotFramework\\ride\\excludes on Windows.
100 You can edit excludes yourself using either the text box or editing the file with an editor. After hitting "Save", close
101 the Preferences window and reload the project to make the edited exludes to take effect. You can reload the project by
102 selecting "File" from the main menu bar and then selecting your project from the list in view.
104 <h2>Patterns in paths</h2>
106 RIDE supports defining excludes with absolute paths. You can achieve relative paths with path patterns which are
110 The following shell-style wildcards are supported:
111 <table width="100%" border="1">
113 <th><b>Pattern</b></th>
114 <th><b>Meaning</b></th>
115 <th><b>Examples</b></th>
119 <td valign="top" align="center">*</td>
120 <td valign="top" align="center">matches everything</td>
121 <td valign="top" align="left">
122 Pattern /foo/*/quu matches:
124 <li>/foo/bar/quu</li>
125 <li>/foo/corge/quu</li>
131 <td valign="top" align="center">?</td>
132 <td valign="top" align="center">matches any single character</td>
133 <td valign="top" align="left">
134 Pattern C:\MyProject\?oo matches:
136 <li>C:\MyProject\\foo</li>
137 <li>C:\MyProject\\boo</li>
143 <td valign="top" align="center">[seq]</td>
144 <td valign="top" align="center">matches any character in <i>seq</i></td>
145 <td valign="top" align="left">
146 Pattern C:\MyProject\[bf]oo matches:
148 <li>C:\MyProject\\foo</li>
149 <li>C:\MyProject\\boo</li>
150 <li><i>and nothing else</i></li>
155 <td valign="top" align="center">[!seq]</td>
156 <td valign="top" align="center">matches any character not in <i>seq</i></td>
157 <td valign="top" align="left">
158 Pattern /foo/[!q]uu matches:
175 RIDEDialog.__init__(self, title=
'Help: excludes')
177 self.SetLayoutDirection(wx.Layout_LeftToRight)
178 sizer = wx.BoxSizer(wx.VERTICAL)
179 sizer.Add(HtmlWindow(self, (800, 600), self.
helphelp),
182 self.SetSizerAndFit(sizer)
def _add_help_dialog(self, sizer)
def __init__(self, settings, *args, **kwargs)
def _add_button_and_status(self, sizer)
color_secondary_background
def _add_text_box(self, sizer)
color_secondary_foreground
Base class for all preference panels used by PreferencesDialog.