Simplify usage of utils.copy

Remove confusing parameters, clarify usage in __doc__
This commit is contained in:
Rogdham 2013-12-07 21:11:15 +01:00
commit fd7fc2e202
3 changed files with 27 additions and 38 deletions

View file

@ -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...')