CLI
elva.cli
Module providing the main command line interface functionality.
Subcommands are defined in the respective app module.
Functions:
-
find_config_path
–Find the next ELVA configuration file.
-
resolve_configs
–Hook sanitizing configuration file paths on invoking the ELVA command.
-
resolve_log
–Hook sanitizing the log file path on invoking the ELVA command.
-
elva
–ELVA - A suite of real-time collaboration TUI apps.
-
context
–Print the parameters passed to apps and other subcommands.
Attributes:
-
APP_NAME
–Default app name.
-
CONFIG_NAME
–Default ELVA configuration file name.
-
LEVEL
–Logging levels sorted by verbosity.
-
CONFIG_PATHS
–List containing all found default ELVA configuration file paths.
-
USER_HOME_CONFIG
–Path to the calling system user's ELVA configuration file.
-
PROJECT_PATH
–The path to the current active project.
APP_NAME = 'elva'
module-attribute
Default app name.
CONFIG_NAME = APP_NAME + '.toml'
module-attribute
Default ELVA configuration file name.
LEVEL = [None, logging.CRITICAL, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG]
module-attribute
Logging levels sorted by verbosity.
CONFIG_PATHS = list()
module-attribute
List containing all found default ELVA configuration file paths.
USER_HOME_CONFIG = Path(platformdirs.user_config_dir(APP_NAME)) / CONFIG_NAME
module-attribute
Path to the calling system user's ELVA configuration file.
PROJECT_PATH = None
module-attribute
The path to the current active project.
find_config_path()
Find the next ELVA configuration file.
This function searches the directory tree from bottom to top.
Source code in src/elva/cli.py
resolve_configs(ctx, param, paths)
Hook sanitizing configuration file paths on invoking the ELVA command.
Parameters:
-
ctx
(Context
) –the click context of the current invokation.
-
param
(Parameter
) –the parameter currently being parsed.
-
paths
(None | list[Path]
) –the paths given to the parameter.
Returns:
Source code in src/elva/cli.py
resolve_log(ctx, param, log)
Hook sanitizing the log file path on invoking the ELVA command.
Parameters:
-
ctx
(Context
) –the click context of the current invokation.
-
param
(Parameter
) –the parameter currently being parsed.
-
log
(None | Path
) –the path of the log file given to the parameter.
Returns:
-
None | Path
–the resolved path of the log file if one was given, else
None
.
Source code in src/elva/cli.py
elva(ctx, configs, log, verbose, name, user, password, server, identifier, messages)
ELVA - A suite of real-time collaboration TUI apps.
Parameters:
-
ctx
(Context
) –the click context holding the configuration parameter object.
-
configs
(list[Path]
) –list of configuration files to parse.
-
log
(Path
) –path of the log file.
-
verbose
(int
) –verbosity, i.e. log level, indicator from 0 (no logging) to 5 (log everything).
-
name
(str
) –the name to display instead of the user name.
-
user
(str
) –the user name to login with.
-
password
(str
) –the password to login with.
-
server
(str | None
) –the address of the remote server for synchronization.
-
identifier
(str | None
) –the identifier of the Y document.
-
messages
(str
) –the type of messages to use for synchronization.
Source code in src/elva/cli.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
|
context(ctx, file, app)
Print the parameters passed to apps and other subcommands.
Parameters:
-
ctx
(Context
) –the click context holding the configuration parameter object.
-
file
(None | Path
) –the path to the ELVA SQLite database file.
-
app
(None | str
) –the app section to take additional configuration parameters from.