Input
clo.input
Input handler
clo.input.Env
Bases: Enum
A collection of possible environment variables. All members in this
Enum
assume the following:
- The
.name
represents the variable (prefix withCLO_
) one would export in their shell. - The
.value
represents the long-flag (prefix with--
) one would specify in their command.
clo.input.Env.CONF
class-attribute
instance-attribute
CONF = '.clorc'
NOTE: This is a special member and is not recognized as an environment variable or a flag.
The default environment file. clo
will fallback to any vairables declared
in this file, barring they're explicitly set from the command-line. Empty
declarations are ignored.
clo.input.Env.INSTANCE
class-attribute
instance-attribute
INSTANCE = 'instance'
The application database to perform operations on. Equivalent to --database
.
clo.input.Env.DATABASE
class-attribute
instance-attribute
DATABASE = 'database'
The application database to perform operations on. Equivalent to --database
.
clo.input.Env.USERNAME
class-attribute
instance-attribute
USERNAME = 'username'
The user to perform operations as. Equivalent to --user
.
clo.input.Env.PASSWORD
class-attribute
instance-attribute
PASSWORD = 'password'
The user's password. There is no command-line equivalent.
clo.input.Env.OUT
class-attribute
instance-attribute
OUT = 'out'
Where to stream the output. Equivalent to --out
.
clo.input.Env.LOG
class-attribute
instance-attribute
LOG = 'log'
The level of logs to produce. Equivalent to --log
.
clo.input.Env.get
get(__default=None)
Retrieve the environment variable value of a member.
PARAMETER | DESCRIPTION |
---|---|
__default |
A value to use if none is found in the environment.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
The environment variable value
TYPE:
|
clo.input.Env.at
classmethod
at(value)
Retrieve the member who holds the specified member value.
PARAMETER | DESCRIPTION |
---|---|
value |
The member value to match.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Env
|
Env | None: The matching member, if found. |
clo.input.Explain
A container for specialize documention. This is called when the user runs clo explain TOPIC
.
clo.input.Explain.domains
classmethod
domains()
Outputs information regarding Odoo search domains.
clo.input.Explain.logic
classmethod
logic()
Outputs information regarding Odoo search domains' logical operators.
clo.input.Explain.models
classmethod
models()
Retrieves relevant metadata for all models in the specified Odoo instance/database.
RETURNS | DESCRIPTION |
---|---|
str
|
A formatted, human-readable documentation.
TYPE:
|
clo.input.Explain.fields
classmethod
fields()
Retrieves relevant metadata for all models in the specified Odoo instance/database.
RETURNS | DESCRIPTION |
---|---|
str
|
A formatted, human-readable documentation.
TYPE:
|
clo.input.Document
Document(parser, title=None, /, lines=[], base=0, location='docs/usage/index.md')
Recursively generate the README documentation.
PARAMETER | DESCRIPTION |
---|---|
parser |
A complete ArgumentParser object.
TYPE:
|
title |
The name of the of the document to produce.
TYPE:
|
lines |
For recursing, acts as the container for generated lines.
TYPE:
|
base |
For recursing, increments the heading levels by the value provided.
TYPE:
|
location |
The file path to save the doc to.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
Markdown-formatted documentation.
TYPE:
|