Rename logging by log_file

This commit is contained in:
Alexis Métaireau 2016-06-20 19:17:21 +02:00
parent 6c1f22ae96
commit eee3447fd1
No known key found for this signature in database
GPG Key ID: 1EDF5A7A485D4A11

View File

@ -23,12 +23,12 @@ class ZimCreator(object):
def __init__(self, zimwriterfs_bin, output_location, def __init__(self, zimwriterfs_bin, output_location,
author=DEFAULT_AUTHOR, httrack_bin=HTTRACK_BIN, author=DEFAULT_AUTHOR, httrack_bin=HTTRACK_BIN,
logging=None): log_file=None):
self.output_location = output_location self.output_location = output_location
self.author = author self.author = author
self.zimwriterfs_bin = zimwriterfs_bin self.zimwriterfs_bin = zimwriterfs_bin
self.httrack_bin = httrack_bin self.httrack_bin = httrack_bin
self.logging = logging self.log_file = log_file
utils.ensure_paths_exists( utils.ensure_paths_exists(
self.zimwriterfs_bin, self.zimwriterfs_bin,
@ -36,7 +36,7 @@ class ZimCreator(object):
self.output_location) self.output_location)
def _spawn(self, cmd): def _spawn(self, cmd):
return utils.spawn(cmd, self.logging) return utils.spawn(cmd, self.log_file)
def download_website(self, url, destination_path): def download_website(self, url, destination_path):
"""Downloads the website using HTTrack and wait for the results to """Downloads the website using HTTrack and wait for the results to
@ -116,7 +116,7 @@ class ZimCreator(object):
return zim_file return zim_file
def load_from_settings(settings, logging=None): def load_from_settings(settings, log_file=None):
"""Load the ZimCreator object from the given pyramid settings, converting """Load the ZimCreator object from the given pyramid settings, converting
them to actual parameters. them to actual parameters.
@ -133,5 +133,5 @@ def load_from_settings(settings, logging=None):
httrack_bin=settings.get('zimit.httrack_bin'), httrack_bin=settings.get('zimit.httrack_bin'),
output_location=settings.get('zimit.output_location'), output_location=settings.get('zimit.output_location'),
author=settings.get('zimit.default_author'), author=settings.get('zimit.default_author'),
logging=logging log_file=log_file
) )