mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Simplify usage of utils.copy
Remove confusing parameters, clarify usage in __doc__
This commit is contained in:
parent
7da0506f2d
commit
fd7fc2e202
3 changed files with 27 additions and 38 deletions
|
|
@ -550,8 +550,12 @@ class StaticGenerator(Generator):
|
|||
final_path=None):
|
||||
"""Copy all the paths from source to destination"""
|
||||
for path in paths:
|
||||
copy(path, source, os.path.join(output_path, destination),
|
||||
final_path)
|
||||
if final_path:
|
||||
copy(os.path.join(source, path),
|
||||
os.path.join(output_path, destination, final_path))
|
||||
else:
|
||||
copy(os.path.join(source, path),
|
||||
os.path.join(output_path, destination, path))
|
||||
|
||||
def generate_context(self):
|
||||
self.staticfiles = []
|
||||
|
|
@ -592,7 +596,7 @@ class SourceFileGenerator(Generator):
|
|||
output_path, _ = os.path.splitext(obj.save_as)
|
||||
dest = os.path.join(self.output_path,
|
||||
output_path + self.output_extension)
|
||||
copy('', obj.source_path, dest)
|
||||
copy(obj.source_path, dest)
|
||||
|
||||
def generate_output(self, writer=None):
|
||||
logger.info(' Generating source files...')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue