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
|
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():
|
def main():
|
||||||
"""Main entry point."""
|
"""Main entry point."""
|
||||||
|
|
||||||
@ -9,7 +17,7 @@ def main():
|
|||||||
|
|
||||||
events = api.get_events()
|
events = api.get_events()
|
||||||
for event in events:
|
for event in events:
|
||||||
print(event['type'])
|
print_event(event)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user