mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Prettify output and fix copy of static files.
This commit is contained in:
parent
6192d5a647
commit
536245b006
2 changed files with 10 additions and 5 deletions
|
|
@ -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 !"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue