Commit 1f35e634 authored by Alexandre Iooss's avatar Alexandre Iooss Committed by chirac

Update to match current

Now ` gen_contrib` generates a matching the
already existing format. It normalizes names to make the list more

Before using this to seriously generate we need to
figure out a way to add pseudo names, or tell everyone to change their
name on GitLab.
parent a584c37b
......@@ -32,16 +32,38 @@ class Command(BaseCommand):
""" The command object for `gen_contrib` """
help = 'Update contributors list'
def _contrib_file_generator(contributors):
Generate the content of
buffer = "# -*- mode: python; coding: utf-8 -*-\n"
buffer += "\"\"\"re2o.contributors\n"
buffer += "A list of the proud contributors to Re2o\n"
buffer += "\"\"\"\n"
buffer += "\n"
buffer += "CONTRIBUTORS = [\n"
for name in contributors:
# Split name into parts
names = name.split()
# Normalize it
names = list(map(str.capitalize, names))
# Put it back together
name_text = " ".join(names)
buffer += " '{}',\n".format(name_text)
buffer += "]"
return buffer
def handle(self, *args, **options):
contributeurs = [
contributors = [
for item in os.popen("git shortlog -s -n").read().split("\n")
if '\t' in item
self.stdout.write("Exportation Sucessfull"))
self.stdout.write("Exportation Successful"))
with open("re2o/", "w") as contrib_file:
contrib_file.write("A list of the contributors to Re2o\n")
contrib_file.write("CONTRIBUTORS = " + str(contributeurs))
content = self._contrib_file_generator(contributors)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment