-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetFixletsRest2File2.py
More file actions
executable file
·54 lines (46 loc) · 1.77 KB
/
getFixletsRest2File2.py
File metadata and controls
executable file
·54 lines (46 loc) · 1.77 KB
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
44
45
46
47
48
49
50
51
52
53
54
import requests
import xml.etree.ElementTree as ET
baseurl = 'http://localhost:52311/api/'
r = requests.get('http://localhost:52311/api/login',verify=False,auth=('adminMO','adminmo'))
if r.status_code != 200:
print r.status_code
#else:
# print('too bad sucka: %s')
myRequest = baseurl+'query?relevance=(name of fixlet of it) of results from (bes fixlets whose (display name of site of it contains "Patches for Windows (English)" and fixlet flag of it = true)) whose (exists last became relevant of it and relevant flag of it = false) of bes computers whose (name of it contains "GRASS")'
r = requests.get(myRequest,verify=False,auth=('adminMO','adminmo'))
#r = requests.get('http://localhost:52311/api/fixlets/master',verify=False,auth=('adminMO','adminmo'))
if r.status_code != 200:
print r.status_code
#else:
# print('GRASSKEET: %s', r.text)
file = open('c:/fixedFixlets.txt', 'w')
file.write(r.text)
file.close()
#root = ET.fromstring(r.text)
##for child in root:
## print child.tag, child.attrib
#i = []
#n = []
#for fixlet in root.findall('Answer'):
# n.append(fixlet.find('Result').text)
# i.append(fixlet.find('Evaluation').text)
# print fixlet.text
## n.append(fixlet.find('Name').text)
## i.append(fixlet.find('ID').text)
#d = dict(zip(i,n))
#
#for key in iter(d):
# print key,d[key]
#for name in root.iter('Name'):
# print name.attrib
#r = requests.get('http://localhost:52311/api/fixlet/master/7217',verify=False,auth=('adminMO','adminmo'))
#if r.status_code == 200:
# print(r.text)
#else:
# print('too bad sucka: %s')
#
#files = {'file': open('stopBesGather.xml', 'rb')}
#url = 'http://localhost:52311/api/actions'
#r = requests.post(url, verify=False,auth=('adminMO','adminmo'), files=files)
#print( r.text )
#