-
Notifications
You must be signed in to change notification settings - Fork 93
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
gcylc.rc enhancements #1849
gcylc.rc enhancements #1849
Changes from all commits
0d27dad
4ccb679
cb6ea25
de71acf
ed2cd3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,31 @@ \section{Gcylc Config File Reference} | |
|
||
\subsection{Top Level Items} | ||
|
||
\subsubsection{dot icon size} | ||
|
||
Set the size of the task state dot icons displayed in the text and dot | ||
views. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} string | ||
\item {\em legal values:} ``small'' (10px), ``medium'' (14px), ``large'' (20px), | ||
``extra large (30px)'' | ||
\item {\em default:} ``medium'' | ||
\end{myitemize} | ||
|
||
|
||
\subsubsection{initial side-by-side views} | ||
|
||
Set the suite view panels initial orientation when the GUI starts. | ||
This can be changed later using the ``View'' menu ``Toggle views side-by-side'' | ||
option. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} boolean (False or True) | ||
\item {\em default:} ``False'' | ||
\end{myitemize} | ||
|
||
|
||
\subsubsection{initial views} | ||
|
||
Set the suite view panel(s) displayed initially, when the GUI starts. | ||
|
@@ -24,47 +49,62 @@ \subsubsection{initial views} | |
\item {\em example:} \lstinline@initial views = graph, dot@ | ||
\end{myitemize} | ||
|
||
\subsubsection{ungrouped views} | ||
\subsubsection{sort by definition order} | ||
|
||
List suite views, if any, that should be displayed initially in an | ||
ungrouped state. Namespace family grouping can be changed later | ||
using the tool bar. | ||
If this is not turned off the default sort order for task names and | ||
families in the dot and text views will the order they appear in the | ||
suite definition. Clicking on the task name column in the treeview will | ||
toggle to alphanumeric sort, and a View menu item does the same for the | ||
dot view. If turned off, the default sort order is alphanumeric and | ||
definition order is not available at all. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} string (a list of zero or more view names) | ||
\item {\em legal values:} ``text'', ``dot'', ``graph'' | ||
\item {\em default:} (none) | ||
\item {\em example:} \lstinline@ungrouped views = text, dot@ | ||
\item {\em type:} boolean | ||
\item {\em default:} True | ||
\end{myitemize} | ||
|
||
\subsubsection{use theme} | ||
|
||
Set the task state color theme, common to all views, to use | ||
initially. The color theme can be changed later using the tool bar. | ||
See \lstinline@gcylc.rc.eg@ and \lstinline@themes.rc@ in | ||
\lstinline@$CYLC_DIR/conf/gcylcrc/@ for how to modify existing color | ||
themes or define your own. Use \lstinline@cylc get-gui-config@ | ||
to list your available themes. | ||
\subsubsection{sort column} | ||
|
||
If ``text'' is in \lstinline@initial views@ then \lstinline@sort column@ sets | ||
the column that will be sorted initially when the GUI launches. Sorting can be | ||
changed later by clicking on the column headers. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} string (theme name) | ||
\item {\em legal values:} ``default'', ``solid'', ``high-contrast'', | ||
``color-blind'', and any custom or user-modified themes. | ||
\item {\em default:} ``default'' | ||
\item {\em type:} string | ||
\item {\em legal values:} ``task'', ``state'', ``host'', ``job system'', | ||
``job ID'', ``T-submit'', ``T-start'', ``T-finish'', ``dT-mean'', | ||
``latest message'', ``none'' | ||
\item {\em default:} ``none'' | ||
\item {\em example:} \lstinline@sort column = T-start@ | ||
\end{myitemize} | ||
|
||
\subsubsection{initial side-by-side views} | ||
|
||
Set the suite view panels initial orientation when the GUI starts. | ||
This can be changed later using the "View" menu "Toggle views side-by-side" | ||
option. | ||
\subsubsection{sort column ascending} | ||
|
||
For use in combination with \lstinline@sort column@, sets whether the column will | ||
be sorted using ascending or descending order. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} boolean (False or True) | ||
\item {\em legal values:} ``False'', ``True''. | ||
\item {\em default:} ``False'' | ||
\item {\em type:} boolean | ||
\item {\em default:} ``True'' | ||
\item {\em example:} \lstinline@sort column ascending = False@ | ||
\end{myitemize} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (see above - boolean items) |
||
|
||
\subsubsection{task filter highlight color} | ||
|
||
The color used to highlight active task filters in gcylc. It must be a name | ||
from the X11 rgb.txt file, e.g.\ \lstinline=SteelBlue=; or a | ||
{\em quoted} hexadecimal color code, e.g.\ \lstinline="#ff0000"= for red (quotes | ||
are required to prevent the hex code being interpreted as a comment). | ||
|
||
\begin{myitemize} | ||
\item {\em type:} string | ||
\item {\em default:} \lstinline=PowderBlue= | ||
\end{myitemize} | ||
|
||
|
||
\subsubsection{task states to filter out} | ||
|
||
Set the initial filtering options when the GUI starts. Later this can be | ||
|
@@ -77,43 +117,76 @@ \subsubsection{task states to filter out} | |
\item {\em default:} runahead | ||
\end{myitemize} | ||
|
||
\subsubsection{dot icon size} | ||
|
||
Set the size of the task state dot icons displayed in the text and dot | ||
views. | ||
\subsubsection{transpose dot} | ||
|
||
Transposes the content in dot view so that it displays from left to right rather | ||
than from top to bottom. Can be changed later using the options submenu | ||
available via the view menu. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} string | ||
\item {\em legal values:} ``small'' (10px), ``medium'' (14px), ``large'' (20px) | ||
\item {\em default:} ``medium'' | ||
\item {\em type:} boolean | ||
\item {\em default:} ``False'' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto boolean items |
||
\item {\em example:} \lstinline@transpose dot = True@ | ||
\end{myitemize} | ||
|
||
\subsubsection{sort by definition order} | ||
|
||
If this is not turned off the default sort order for task names and | ||
families in the dot and text views will the order they appear in the | ||
suite definition. Clicking on the task name column in the treeview will | ||
toggle to alphanumeric sort, and a View menu item does the same for the | ||
dot view. If turned off, the default sort order is alphanumeric and | ||
definition order is not available at all. | ||
\subsubsection{transpose graph} | ||
|
||
Transposes the content in graph view so that it displays from left to right | ||
rather than from top to bottom. Can be changed later using the options submenu | ||
via the view menu. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} boolean | ||
\item {\em default:} True | ||
\item {\em type:} boolean | ||
\item {\em default:} ``False'' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (ditto) |
||
\item {\em example:} \lstinline@transpose graph = True@ | ||
\end{myitemize} | ||
|
||
\subsubsection{task filter highlight color} | ||
|
||
The color used to highlight active task filters in gcylc. It must be a name | ||
from the X11 rgb.txt file, e.g.\ \lstinline=SteelBlue=; or a | ||
{\em quoted} hexadecimal color code, e.g.\ \lstinline="#ff0000"= for red (quotes | ||
are required to prevent the hex code being interpreted as a comment). | ||
\subsubsection{ungrouped views} | ||
|
||
List suite views, if any, that should be displayed initially in an | ||
ungrouped state. Namespace family grouping can be changed later | ||
using the tool bar. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} string | ||
\item {\em default:} \lstinline=PowderBlue= | ||
\item {\em type:} string (a list of zero or more view names) | ||
\item {\em legal values:} ``text'', ``dot'', ``graph'' | ||
\item {\em default:} (none) | ||
\item {\em example:} \lstinline@ungrouped views = text, dot@ | ||
\end{myitemize} | ||
|
||
|
||
\subsubsection{use theme} | ||
|
||
Set the task state color theme, common to all views, to use | ||
initially. The color theme can be changed later using the tool bar. | ||
See \lstinline@gcylc.rc.eg@ and \lstinline@themes.rc@ in | ||
\lstinline@$CYLC_DIR/conf/gcylcrc/@ for how to modify existing color | ||
themes or define your own. Use \lstinline@cylc get-gui-config@ | ||
to list your available themes. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} string (theme name) | ||
\item {\em legal values:} ``default'', ``solid'', ``high-contrast'', | ||
``color-blind'', and any custom or user-modified themes. | ||
\item {\em default:} ``default'' | ||
\end{myitemize} | ||
|
||
|
||
\subsubsection{window size} | ||
|
||
Sets the size (in pixels) of the cylc GUI at startup. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "...in pixels" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and "GUI" |
||
\begin{myitemize} | ||
\item {\em type:} integer list (x, y) | ||
\item {\em legal values:} positive integers | ||
\item {\em default:} 800, 500 | ||
\item {\em example:} \lstinline@window size = 1000, 700@ | ||
\end{myitemize} | ||
|
||
|
||
\subsection{[themes]} | ||
|
||
This section may contain task state color theme definitions. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
from parsec.validate import validator as vdr | ||
from parsec.upgrade import upgrader | ||
from parsec.util import printcfg | ||
from cylc.gui.view_tree import ControlTree | ||
from cylc.task_state import ( | ||
TASK_STATUSES_ALL, TASK_STATUS_RUNAHEAD, TASK_STATUS_HELD, | ||
TASK_STATUS_WAITING, TASK_STATUS_EXPIRED, TASK_STATUS_QUEUED, | ||
|
@@ -41,16 +42,20 @@ | |
USER_FILE = os.path.join(os.environ['HOME'], '.cylc', 'gcylc.rc') | ||
|
||
SPEC = { | ||
'initial views': vdr(vtype='string_list', default=["text"]), | ||
'ungrouped views': vdr(vtype='string_list', default=[]), | ||
'use theme': vdr(vtype='string', default="default"), | ||
'dot icon size': vdr( | ||
vtype='string', | ||
default="medium", | ||
options=["small", "medium", "large", "extra large"]), | ||
'initial side-by-side views': vdr(vtype='boolean', default=False), | ||
'initial views': vdr(vtype='string_list', default=["text"]), | ||
'sort by definition order': vdr(vtype='boolean', default=True), | ||
'sort column': vdr( | ||
vtype='string', | ||
default='none', | ||
options=[heading for heading in ControlTree.headings if heading is not | ||
None] + ['none']), | ||
'sort column ascending': vdr(vtype='boolean', default=True), | ||
'task filter highlight color': vdr(vtype='string', default='PowderBlue'), | ||
'initial side-by-side views': vdr(vtype='boolean', default=False), | ||
'task states to filter out': vdr( | ||
vtype='string_list', | ||
default=[TASK_STATUS_RUNAHEAD]), | ||
|
@@ -73,6 +78,11 @@ | |
TASK_STATUS_RUNAHEAD: vdr(vtype='string_list'), | ||
}, | ||
}, | ||
'transpose dot': vdr(vtype='boolean', default=False), | ||
'transpose graph': vdr(vtype='boolean', default=False), | ||
'ungrouped views': vdr(vtype='string_list', default=[]), | ||
'use theme': vdr(vtype='string', default="default"), | ||
'window size': vdr(vtype='integer_list', default=[800, 500]), | ||
} | ||
|
||
|
||
|
@@ -173,8 +183,24 @@ def transform(self): | |
cfg['themes'] = cfg_themes | ||
|
||
def check(self): | ||
# check initial view config | ||
cfg = self.get(sparse=True) | ||
|
||
# check window size config | ||
if 'window size' in cfg: | ||
fail = False | ||
if len(cfg['window size']) != 2: | ||
print >> sys.stderr, ("WARNING: window size requires two " | ||
"values (x, y). Using default.") | ||
fail = True | ||
elif cfg['window size'][0] < 0 or cfg['window size'][1] < 0: | ||
print >> sys.stderr, ("WARNING: window size values must be " | ||
"positive. Using default.") | ||
fail = True | ||
# TODO: check for daft window sizes? (10, 5), (80000, 5000) ? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Worth doing or leave it up to GTK? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does GTK check for sensible sizes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On my desktop it would appear so, though I can't find anything in the gtk documentation to confirm this. |
||
if fail: | ||
cfg['window size'] = [800, 500] | ||
|
||
# check initial view config | ||
if 'initial views' not in cfg: | ||
return | ||
views = copy(cfg['initial views']) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with other boolean items: we aren't giving "legal values" lines (it should be obvious), and we aren't quoting the default value.