-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloop.py
43 lines (37 loc) · 1.3 KB
/
loop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import yaml
def get_config(*args):
with open('test-repo.yml', 'r') as f:
conf = yaml.safe_load(f)
# get section
section = args[0]
# check if Config file has Section
# if not conf.has_key(section):
if not section in conf:
print ("key missing")
quit()
# get values
argList = list(args) # convert tuple to list
argList.pop(0) # remove Section from list
# create lookup path
parsepath = "conf['" + section + "']"
for arg in argList:
parsepath = parsepath + "['" + arg + "']"
return eval(parsepath)
f.close()
lst=[]
scans = list(get_config('project','organization'))
for i in range(0,len(scans)):
scans1=list(get_config('project','organization',scans[i]))
for j in range(0,len(scans1)):
scans2=list(get_config('project','organization',scans[i],scans1[j]))
for k in range(0,len(scans2)):
scan3=list(get_config('project','organization',scans[i],scans1[j]))
lst.append("https://github.developer.io/"+scans[i]+"/"+scans1[j])
# print (scans[i],scans1[j],*scan3)
# print (" ")
# git_url=["https://github.developer.io/"+scans[i]+"/"+scans1[j]]
print(lst)
# print (git_url)
# print (*scan3)