File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
- #!/usr/bin/python
1
+ #!/usr/bin/python3
2
2
3
- import urllib2
4
- import libxml2
3
+ import urllib . request
4
+ import lxml . etree
5
5
import sys
6
6
7
7
printurls = False
@@ -10,13 +10,12 @@ if (len(sys.argv) == 2) and (sys.argv[1] == '-u'):
10
10
elif len (sys .argv ) != 1 :
11
11
sys .exit ("Usage: print_osg_repos [-u]" )
12
12
13
- response = urllib2 .urlopen ("http://myosg.grid.iu.edu/vosummary/xml?summary_attrs_showoasis=on&all_vos=on&active=on&active_value=1&sort_key=name" )
14
- xml = response .read ()
15
- doc = libxml2 .parseDoc (xml )
13
+ response = urllib .request .urlopen ("http://my.opensciencegrid.org/vosummary/xml?summary_attrs_showoasis=on&all_vos=on&active=on&active_value=1&sort_key=name" )
14
+ doc = lxml .etree .XML (response .read ())
16
15
17
16
repos = []
18
- for urlfield in doc .xpathEval ("//VO/OASIS/OASISRepoURLs/URL" ):
19
- url = urlfield .content
17
+ for urlfield in doc .xpath ("//VO/OASIS/OASISRepoURLs/URL" ):
18
+ url = urlfield .text
20
19
if url [- 1 ] == '/' :
21
20
# remove a trailing slash
22
21
url = url [:- 1 ]
@@ -27,4 +26,4 @@ for urlfield in doc.xpathEval("//VO/OASIS/OASISRepoURLs/URL"):
27
26
28
27
repos .sort ()
29
28
for repo in repos :
30
- print repo
29
+ print ( repo )
You can’t perform that action at this time.
0 commit comments