From b375a3ea017316482e1ed37ec7ef8c668649f3de 2015-03-17 23:48:31 From: Matthias Bussonnier Date: 2015-03-17 23:48:31 Subject: [PATCH] Make nbconvert a little less chatty. User don't really care what template is used by default. and no need to say where the files might be written if they won't be. --- diff --git a/IPython/nbconvert/exporters/templateexporter.py b/IPython/nbconvert/exporters/templateexporter.py index 8472c93..649509f 100644 --- a/IPython/nbconvert/exporters/templateexporter.py +++ b/IPython/nbconvert/exporters/templateexporter.py @@ -190,7 +190,7 @@ class TemplateExporter(Exporter): except Exception as e: self.log.warn("Unexpected exception loading template: %s", try_name, exc_info=True) else: - self.log.info("Loaded template %s", try_name) + self.log.debug("Loaded template %s", try_name) break def from_notebook_node(self, nb, resources=None, **kw): diff --git a/IPython/nbconvert/nbconvertapp.py b/IPython/nbconvert/nbconvertapp.py index 255ea1a..39bbc82 100755 --- a/IPython/nbconvert/nbconvertapp.py +++ b/IPython/nbconvert/nbconvertapp.py @@ -310,7 +310,6 @@ class NbConvertApp(BaseIPythonApplication): resources['profile_dir'] = self.profile_dir.location resources['unique_key'] = notebook_name resources['output_files_dir'] = '%s_files' % notebook_name - self.log.info("Support files will be in %s", os.path.join(resources['output_files_dir'], '')) # Try to export try: diff --git a/IPython/nbconvert/writers/files.py b/IPython/nbconvert/writers/files.py index ebcf89b..7fddbd7 100644 --- a/IPython/nbconvert/writers/files.py +++ b/IPython/nbconvert/writers/files.py @@ -76,7 +76,11 @@ class FilesWriter(WriterBase): # Write all of the extracted resources to the destination directory. # NOTE: WE WRITE EVERYTHING AS-IF IT'S BINARY. THE EXTRACT FIG # PREPROCESSOR SHOULD HANDLE UNIX/WINDOWS LINE ENDINGS... - for filename, data in resources.get('outputs', {}).items(): + + items = resources.get('outputs', {}).items() + if items: + self.log.info("Support files will be in %s", os.path.join(resources['output_files_dir'], '')) + for filename, data in items: # Determine where to write the file to dest = os.path.join(self.build_directory, filename)