@@ -1224,13 +1224,12 @@ def write_to_csv(self, output_path):
12241224 row_data = about_object .get_row_data (relative_path , custom_keys )
12251225 csv_writer .writerow (row_data )
12261226
1227- def generate_attribution (self , template_path , limit_to = None ):
1227+ def generate_attribution (self , template_path = None , limit_to = None ):
12281228 """
12291229 Generate an attribution file from the current list of ABOUT objects.
12301230 The optional `limit_to` parameter allows to restrict the generated
12311231 attribution to a specific list of component names.
12321232 """
1233-
12341233 try :
12351234 import jinja2 as j2
12361235 except ImportError :
@@ -1239,6 +1238,11 @@ def generate_attribution(self, template_path, limit_to=None):
12391238 '"configure"' )
12401239 return
12411240
1241+ # For some reasons, if I set the template_path = "templates/default.html"
1242+ # in the parameter, the tempalte_path will become 'None' and cause error
1243+ if not template_path :
1244+ template_path = "templates/default.html"
1245+
12421246 # FIXME: the template dir should be outside the code tree
12431247 template_dir = os .path .dirname (template_path )
12441248 template_file_name = os .path .basename (template_path )
@@ -1249,7 +1253,6 @@ def generate_attribution(self, template_path, limit_to=None):
12491253 template = jinja_env .get_template (template_file_name )
12501254 except j2 .TemplateNotFound :
12511255 return
1252-
12531256 limit_to = limit_to or []
12541257 limit_to = set (limit_to )
12551258
0 commit comments