mirror of
https://git.juggalol.com/agatha/gitmon.git
synced 2024-11-22 07:26:41 +00:00
Print events to terminal
This commit is contained in:
parent
8a9200e627
commit
7503a8effe
10
main.py
10
main.py
@ -2,6 +2,14 @@
|
||||
from gitmon.api import GitHubApi
|
||||
|
||||
|
||||
def print_event(event):
|
||||
event_type = event.get('type')
|
||||
repo = event.get('repo')
|
||||
actor = event.get('actor')
|
||||
|
||||
print(f'{event_type}:\t{repo["name"]}, {actor["login"]}')
|
||||
|
||||
|
||||
def main():
|
||||
"""Main entry point."""
|
||||
|
||||
@ -9,7 +17,7 @@ def main():
|
||||
|
||||
events = api.get_events()
|
||||
for event in events:
|
||||
print(event['type'])
|
||||
print_event(event)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user