Fixed the packing and unpacking of parameters in the format module.

Forgot to specify the '*' operator when passing the parameters to the
callback functions; something which resulted in a dictionary being sent
into the callback functions. Obviously, this is not what we want.
This commit is contained in:
Adam Waldenberg 2012-10-18 16:56:46 +02:00
parent e11606bcaf
commit d9c94b53d6
3 changed files with 8 additions and 7 deletions

View File

@ -179,7 +179,7 @@ def output_text(hard):
else:
print("No commited files with the specified extensions were found.")
def output_xml(string, hard):
def output_xml(hard):
authorinfo_list = get(hard).get_authorinfo_list()
total_changes = 0.0
@ -204,6 +204,7 @@ def output_xml(string, hard):
changes_xml += ("\t\t\t<author>\n" + name_xml + commits_xml + insertions_xml +
deletions_xml + percentage_xml + "\t\t\t</author>\n")
print(string.format("\n\t<changes>\n" + message_xml + "\t\t<authors>\n" + changes_xml + "\t\t</authors>\n\t</changes>\n"))
print("\t<changes>\n" + message_xml + "\t\t<authors>\n" + changes_xml + "\t\t</authors>\n\t</changes>")
else:
print(string.format("<changes>" + "No commited files with the specified extensions were found." + "</changes>"))
print("\t<changes>\n\t\t<exception>" + "No commited files with the specified extensions were found." +
"</exception>\n\t</changes>")

View File

@ -39,8 +39,8 @@ def call_output_function(html_function, text_function, xml_function, *parameters
template_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "html.template")
file_r = open(template_path, "rb")
template = file_r.read().decode("utf-8", "replace")
html_function(template, parameters)
html_function(template, *parameters)
elif __selected_format__ == "text":
text_function(parameters)
text_function(*parameters)
else:
xml_function("<gitinspector>{0}</gitinspector>", parameters)
xml_function(*parameters)

View File

@ -34,7 +34,7 @@ def output_html(string, _):
def output_text(_):
print("gitinspector {0}\n".format(__version__) + __doc__)
def output_xml(string, _):
def output_xml(_):
license_text = "\t\t" + __doc__.replace("\n", "\n\t\t")
print(string.format("\n\t<version>" + __version__ + "</version>\n" +
"\t<license-text>\n" + license_text + "\n\t</license-text>\n"))