Added help for the error levels
This commit is contained in:
parent
572204a5b2
commit
32fff15a5c
|
|
@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Camera option to set the clip start (#484)
|
||||
- Populate:
|
||||
- Basic support for regular list items (#480)
|
||||
- Help for the error levels
|
||||
|
||||
### Changed
|
||||
- Documentation:
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ source/configuration/sup_outputs.rst: ../kibot/out_*.py ../kibot/config_reader.p
|
|||
source/dependencies.rst: ../kibot/out_*.py ../kibot/pre_*.py ../kibot/var_*.py ../kibot/registrable.py ../kibot/misc.py ../kibot/config_reader.py ../kibot/dep_downloader.py
|
||||
../src/kibot --rst --help-dependencies > $@
|
||||
|
||||
source/errors.rst: ../kibot/misc.py ../kibot/config_reader.py
|
||||
../src/kibot --rst --help-errors > $@
|
||||
|
||||
source/usage.txt: ../kibot/__main__.py
|
||||
../src/kibot --help > $@
|
||||
|
||||
|
|
@ -48,7 +51,7 @@ help:
|
|||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
$(SPHINXTARGETS): Makefile source/configuration/sup_outputs.rst source/dependencies.rst source/usage.txt source/configuration/sup_preflights.rst \
|
||||
source/configuration/sup_filters.rst source/configuration/sup_variants.rst source/configuration/sup_globals.rst
|
||||
source/configuration/sup_filters.rst source/configuration/sup_variants.rst source/configuration/sup_globals.rst source/errors.rst
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
.. Automatically generated by KiBot, please don't edit this file
|
||||
|
||||
Supported error levels
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- 0: NONE
|
||||
- 1: INTERNAL_ERROR
|
||||
- 2: WRONG_ARGUMENTS
|
||||
- 3: UNSUPPORTED_OPTION
|
||||
- 4: MISSING_TOOL
|
||||
- 5: DRC_ERROR
|
||||
- 6: EXIT_BAD_ARGS
|
||||
- 7: EXIT_BAD_CONFIG
|
||||
- 8: NO_PCB_FILE
|
||||
- 9: NO_SCH_FILE
|
||||
- 10: ERC_ERROR
|
||||
- 11: BOM_ERROR
|
||||
- 12: PDF_SCH_PRINT
|
||||
- 13: PDF_PCB_PRINT
|
||||
- 14: PLOT_ERROR
|
||||
- 15: NO_YAML_MODULE
|
||||
- 16: NO_PCBNEW_MODULE
|
||||
- 17: CORRUPTED_PCB
|
||||
- 18: KICAD2STEP_ERR
|
||||
- 19: WONT_OVERWRITE
|
||||
- 20: PCBDRAW_ERR
|
||||
- 21: SVG_SCH_PRINT
|
||||
- 22: CORRUPTED_SCH
|
||||
- 23: WRONG_INSTALL
|
||||
- 24: RENDER_3D_ERR
|
||||
- 25: FAILED_EXECUTE
|
||||
- 26: KICOST_ERROR
|
||||
- 27: MISSING_WKS
|
||||
- 28: MISSING_FILES
|
||||
- 29: DIFF_TOO_BIG
|
||||
- 30: NETLIST_DIFF
|
||||
- 31: PS_SCH_PRINT
|
||||
- 32: DXF_SCH_PRINT
|
||||
- 33: HPGL_SCH_PRINT
|
||||
- 34: CORRUPTED_PRO
|
||||
|
|
@ -114,3 +114,6 @@ Command line help
|
|||
|
||||
.. literalinclude:: usage.txt
|
||||
|
||||
|
||||
.. include:: errors.rst
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ Usage:
|
|||
kibot [-v...] [--rst] --help-preflights
|
||||
kibot [-v...] [--rst] --help-variants
|
||||
kibot [-v...] --help-banners
|
||||
kibot [-v...] [--rst] --help-errors
|
||||
kibot -h | --help
|
||||
kibot --version
|
||||
|
||||
|
|
@ -74,6 +75,7 @@ Help options:
|
|||
-h, --help Show this help message and exit
|
||||
--help-banners Show all available banners
|
||||
--help-dependencies List dependencies in human readable format
|
||||
--help-errors List of error levels
|
||||
--help-filters List supported filters and details
|
||||
--help-global-options List supported global variables
|
||||
--help-list-outputs List supported outputs
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ Usage:
|
|||
kibot [-v...] [--rst] --help-preflights
|
||||
kibot [-v...] [--rst] --help-variants
|
||||
kibot [-v...] --help-banners
|
||||
kibot [-v...] [--rst] --help-errors
|
||||
kibot -h | --help
|
||||
kibot --version
|
||||
|
||||
|
|
@ -81,6 +82,7 @@ Help options:
|
|||
-h, --help Show this help message and exit
|
||||
--help-banners Show all available banners
|
||||
--help-dependencies List dependencies in human readable format
|
||||
--help-errors List of error levels
|
||||
--help-filters List supported filters and details
|
||||
--help-global-options List supported global variables
|
||||
--help-list-outputs List supported outputs
|
||||
|
|
@ -125,7 +127,8 @@ from .misc import EXIT_BAD_ARGS, W_VARCFG, NO_PCBNEW_MODULE, W_NOKIVER, hide_std
|
|||
from .pre_base import BasePreFlight
|
||||
from .error import KiPlotConfigurationError, config_error
|
||||
from .config_reader import (CfgYamlReader, print_outputs_help, print_output_help, print_preflights_help, create_example,
|
||||
print_filters_help, print_global_options_help, print_dependencies, print_variants_help)
|
||||
print_filters_help, print_global_options_help, print_dependencies, print_variants_help,
|
||||
print_errors)
|
||||
from .kiplot import (generate_outputs, load_actions, config_output, generate_makefile, generate_examples, solve_schematic,
|
||||
solve_board_file, solve_project_file, check_board_file)
|
||||
from .registrable import RegOutput
|
||||
|
|
@ -458,6 +461,9 @@ def main():
|
|||
logger.info('Banner '+str(c))
|
||||
logger.info(b)
|
||||
sys.exit(0)
|
||||
if args.help_errors:
|
||||
print_errors(args.rst)
|
||||
sys.exit(0)
|
||||
if args.example:
|
||||
check_board_file(args.board_file)
|
||||
if args.copy_options and not args.board_file:
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import textwrap
|
|||
|
||||
from .error import KiPlotConfigurationError, config_error
|
||||
from .misc import (NO_YAML_MODULE, EXIT_BAD_ARGS, EXAMPLE_CFG, WONT_OVERWRITE, W_NOOUTPUTS, W_UNKOUT, W_NOFILTERS,
|
||||
W_NOVARIANTS, W_NOGLOBALS, TRY_INSTALL_CHECK, W_NOPREFLIGHTS, W_NOGROUPS, W_NEWGROUP)
|
||||
W_NOVARIANTS, W_NOGLOBALS, TRY_INSTALL_CHECK, W_NOPREFLIGHTS, W_NOGROUPS, W_NEWGROUP, error_level_to_name)
|
||||
from .gs import GS
|
||||
from .registrable import RegOutput, RegVariant, RegFilter, RegDependency
|
||||
from .pre_base import BasePreFlight
|
||||
|
|
@ -948,7 +948,7 @@ def print_output_help(name):
|
|||
print_one_out_help(True, name, RegOutput.get_class_for(name))
|
||||
|
||||
|
||||
def make_title(rst, tp, n):
|
||||
def make_title(rst, tp, n, sub='^'):
|
||||
global rst_mode
|
||||
rst_mode = rst
|
||||
logger.debug('{} supported {}'.format(n, tp))
|
||||
|
|
@ -957,7 +957,7 @@ def make_title(rst, tp, n):
|
|||
title = 'Supported '+tp
|
||||
print(title)
|
||||
if rst_mode:
|
||||
print((len(title)*'^')+'\n')
|
||||
print((len(title)*sub)+'\n')
|
||||
return 3, ' '
|
||||
print()
|
||||
return 2, ''
|
||||
|
|
@ -1348,3 +1348,9 @@ def print_dependencies(markdown=True, jsn=False, rst=False):
|
|||
for c, rst_img in enumerate(rst_images):
|
||||
print(f'.. |image{c+1}| image:: {rst_img[0]}\n :target: {rst_img[1]}')
|
||||
print()
|
||||
|
||||
|
||||
def print_errors(rst):
|
||||
make_title(rst, 'error levels', len(error_level_to_name), '~')
|
||||
for c, n in enumerate(error_level_to_name):
|
||||
print(f'- {c}: {n}')
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from contextlib import contextmanager
|
|||
# Error levels
|
||||
INTERNAL_ERROR = 1 # Unhandled exceptions
|
||||
WRONG_ARGUMENTS = 2 # This is what argsparse uses
|
||||
USUPPORTED_OPTION = 3
|
||||
UNSUPPORTED_OPTION = 3
|
||||
MISSING_TOOL = 4
|
||||
DRC_ERROR = 5
|
||||
EXIT_BAD_ARGS = 6
|
||||
|
|
@ -48,7 +48,7 @@ CORRUPTED_PRO = 34
|
|||
error_level_to_name = ['NONE',
|
||||
'INTERNAL_ERROR',
|
||||
'WRONG_ARGUMENTS',
|
||||
'USUPPORTED_OPTION',
|
||||
'UNSUPPORTED_OPTION',
|
||||
'MISSING_TOOL',
|
||||
'DRC_ERROR',
|
||||
'EXIT_BAD_ARGS',
|
||||
|
|
|
|||
Loading…
Reference in New Issue