Skip to content

Commit

Permalink
style(python): use yapf to format main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BobAnkh committed Jul 27, 2020
1 parent 22f6c71 commit c15c537
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</tr>
</table>'''


def github_login(ACCESS_TOKEN, REPO_NAME):
'''
Use Pygithub to login to the repository
Expand All @@ -29,6 +30,7 @@ def github_login(ACCESS_TOKEN, REPO_NAME):
repo = g.get_repo(REPO_NAME)
return repo


def get_inputs(input_name):
'''
Get a Github actions input by name
Expand All @@ -45,7 +47,9 @@ def get_inputs(input_name):
'''
return os.getenv('INPUT_{}'.format(input_name).upper())

def generate_contributors(repo, COLUMN_PER_ROW, img_width, font_size, head_format, tail_format):

def generate_contributors(repo, COLUMN_PER_ROW, img_width, font_size,
head_format, tail_format):
'''
Generate the contributors list using a given template
Expand All @@ -59,7 +63,7 @@ def generate_contributors(repo, COLUMN_PER_ROW, img_width, font_size, head_forma
Returns:
string: contributors list
'''
'''
USER = 0
HEAD = head_format
TAIL = tail_format
Expand Down Expand Up @@ -118,6 +122,7 @@ def write_contributors(repo, contributors_list, path, commit_message, CONTRIB):
else:
pass


def main():
ACCESS_TOKEN = get_inputs('ACCESS_TOKEN')
REPO_NAME = get_inputs('REPO_NAME')
Expand All @@ -128,8 +133,10 @@ def main():
PATH = get_inputs('PATH')
COMMIT_MESSAGE = get_inputs('COMMIT_MESSAGE')
repo = github_login(ACCESS_TOKEN, REPO_NAME)
CONTRIBUTORS_LIST = generate_contributors(repo, COLUMN_PER_ROW, IMG_WIDTH, FONT_SIZE, head, tail)
write_contributors(repo, CONTRIBUTORS_LIST, PATH, COMMIT_MESSAGE, CONTRIBUTOR)
CONTRIBUTORS_LIST = generate_contributors(repo, COLUMN_PER_ROW, IMG_WIDTH,
FONT_SIZE, head, tail)
write_contributors(repo, CONTRIBUTORS_LIST, PATH, COMMIT_MESSAGE,
CONTRIBUTOR)


if __name__ == '__main__':
Expand Down

0 comments on commit c15c537

Please sign in to comment.