-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73b7209
commit ea6d17d
Showing
5 changed files
with
114 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
\section{Cylc Gscan Config File Reference} | ||
\label{GscanRCReference} | ||
|
||
\lstset{language=bash} | ||
|
||
This section defines all legal items and values for the gscan config | ||
file which should be located in | ||
\lstinline=$HOME/.cylc/gscan.rc=. | ||
|
||
\subsection{Top Level Items} | ||
|
||
\subsubsection{columns} | ||
Set the data fields displayed initially when the | ||
\lstinline=cylc gscan= | ||
GUI starts. This | ||
can be changed later using the right click context menu. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} string (a list of one or more view names) | ||
\item {\em legal values:} ``host'', ``status'', ``suite'', ``title'', | ||
``updated'' | ||
\item {\em default:} ``status'', ``suite'' | ||
\item {\em example:} \lstinline@columns = suite, title, status@ | ||
\end{myitemize} | ||
|
||
\subsubsection{activate on startup} | ||
Set whether | ||
\lstinline=cylc gpanel= | ||
will activate automatically when the gui is loaded or not. | ||
|
||
\begin{myitemize} | ||
\item {\em type:} boolean (True or False) | ||
\item {\em legal values:} ``True'', ``False'' | ||
\item {\em default:} ``False'' | ||
\item {\em example:} \lstinline@activate on startup = True@ | ||
\end{myitemize} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env python | ||
|
||
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. | ||
# Copyright (C) 2008-2016 NIWA | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import os | ||
import sys | ||
|
||
from parsec import ParsecError | ||
from parsec.validate import validator as vdr | ||
from parsec.config import config | ||
|
||
"""gscan config file format.""" | ||
|
||
USER_FILE = os.path.join(os.environ['HOME'], '.cylc', 'gscan.rc') | ||
|
||
SPEC = { | ||
'columns': vdr(vtype='string_list', default=['suite', 'status']), | ||
'activate on startup': vdr(vtype='boolean', default=False) | ||
} | ||
|
||
|
||
class gscanconfig(config): | ||
|
||
def check(self): | ||
cfg = self.get(sparse=True) | ||
if 'columns' in cfg: | ||
for column in cfg['columns']: | ||
if column not in ['host', 'suite', 'title', 'updated', | ||
'status']: | ||
print >> sys.stderr, ("WARNING: illegal column name " | ||
"'" + column + "'") | ||
cfg['columns'].remove(column) | ||
if len(cfg['columns']) < 1: | ||
print >> sys.stderr, ('WARNING: at least one column must be ' | ||
'specified, defaulting to "suite, ' | ||
'status"') | ||
cfg['columns'] = ['suite', 'status'] | ||
|
||
|
||
gsfg = None | ||
if not gsfg: | ||
gsfg = gscanconfig(SPEC) | ||
if os.access(USER_FILE, os.F_OK | os.R_OK): | ||
try: | ||
gsfg.loadcfg(USER_FILE, 'user config') | ||
except ParsecError as exc: | ||
sys.stderr.write('ERROR: bad gscan config %s:\n' % USER_FILE) | ||
raise | ||
gsfg.check() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters