11#!/usr/bin/env python3
22import yaml
33import click
4- from plugins . pagure import get_pull_requests
4+ from pprint import pprint
55
6+ from plugins import github
7+ from plugins import gitlab
8+ from plugins import pagure
9+
10+ plugins = {
11+ "github" : github .get_pull_requests ,
12+ "pagure" : pagure .get_pull_requests ,
13+ # "gitlab": gitlab.get_pull_requests
14+ }
615
716@click .command ()
817@click .option ('--site' , default = 'config' , help = 'Please enter the sitename to list activity, e.g. github' )
@@ -12,18 +21,22 @@ def execute_board(site, username, repo):
1221 '''Take Arguments from command line OR Read configuration files, which is YAML format'''
1322 #print (site)
1423 #print (username)
15- if site == 'config' and username == 'config' and repo == 'config' :
24+ if username == 'config' and repo == 'config' :
1625 print ("The Application will read username and code sites from configuraiton file" )
1726 with open ('config.yml' , 'r' ) as f :
1827 conf = yaml .load (f )
1928
2029 # Expect site, username and repo comming from command line
2130 #data = get_pull_requests('walters', 'fedora-atomic')
22- data = get_pull_requests (username , repo )
23- print (data )
24-
25-
26-
31+ # data = get_pull_requests(username, repo)
32+ # print (data)
33+
34+ if site in plugins .keys ():
35+ data = plugins [site ](username , repo )
36+ pprint (data )
37+
38+ else :
39+ print ("Couldnt find Plugin for site \" %s\" " % site )
2740
2841def getComments (site , username ):
2942 pass
0 commit comments