From 536245b0066a00647b2c0fe10165ad473fa5b428 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 30 Oct 2010 01:26:58 +0100 Subject: [PATCH] Prettify output and fix copy of static files. --- bin/pelican | 2 +- pelican/generators.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/pelican b/bin/pelican index 81be30b8..d85eaf3c 100755 --- a/bin/pelican +++ b/bin/pelican @@ -25,4 +25,4 @@ if __name__ == '__main__': args = parser.parse_args() gen = ArticlesGenerator(args.settings) gen.generate(args.path, args.theme, args.output, args.markup) - print 'Done !' + print "Enjoy !" diff --git a/pelican/generators.py b/pelican/generators.py index 695beeaf..67f838cf 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -79,6 +79,8 @@ class Generator(object): pass fp = open(complete_path, 'w') feed.write(fp, 'utf-8') + print u' ✔ writing %s' % complete_path + fp.close() return feed @@ -99,7 +101,7 @@ class Generator(object): pass with open(filename, 'w', encoding='utf-8') as f: f.write(output) - print 'writing %s' % filename + print u' ✔ writing %s' % filename def get_templates(self, path=None): """Return the templates to use. @@ -162,7 +164,7 @@ class ArticlesGenerator(Generator): try: article.check_properties() except NameError as e: - print "Error, The '%s' metadata is not present in %s" % (e, f) + print u" ☓ Skipping %s: impossible to find informations about '%s'" % (f, e) continue update_dict(self.dates, article.date.strftime('%Y-%m-%d'), article) @@ -221,8 +223,11 @@ class ArticlesGenerator(Generator): for path in self.settings['STATIC_PATHS']: try: - shutil.copytree(os.path.join(self.theme, path), - os.path.join(self.output_path, path)) + fromp = os.path.expanduser(os.path.join(self.theme, path)) + to = os.path.expanduser(os.path.join(self.output_path, path)) + shutil.copytree(fromp, to) + print u' ✔ copying %s to %s' % (fromp, to) + except OSError: pass