[Navigate results][Fixed] Exception when no outputs

This commit is contained in:
Salvador E. Tropea 2022-12-02 09:33:43 -03:00
parent 64b2cd780f
commit bd9d2ec7b7
2 changed files with 5 additions and 1 deletions

View File

@ -67,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Imports:
- Problems with recursive imports when the intermediate import didn't
contain any of the requested elements (i.e. no outputs). (#335)
- Navigate results: fail when no output to generate. Now you get a warning.
## [1.4.0] - 2022-10-12
### Added

View File

@ -29,7 +29,7 @@ from tempfile import NamedTemporaryFile
from .gs import GS
from .optionable import BaseOptions
from .kiplot import config_output, get_output_dir
from .misc import W_NOTYET, W_MISSTOOL
from .misc import W_NOTYET, W_MISSTOOL, W_NOOUTPUTS
from .registrable import RegOutput
from .macros import macros, document, output_class # noqa: F401
from . import log, __version__
@ -447,6 +447,9 @@ class Navigate_ResultsOptions(BaseOptions):
for c in cat:
self.add_to_tree(c, o, o_tree)
logger.debug('Collected outputs:\n'+pprint.pformat(o_tree))
if not o_tree:
logger.warning(W_NOOUTPUTS+'No outputs for navigate results')
return
with open(os.path.join(self.out_dir, 'styles.css'), 'wt') as f:
f.write(STYLE)
self.rsvg_command = self.check_tool('rsvg1')