Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
kpetersn
aliveNotifier
Commits
260549f9
Commit
260549f9
authored
Jun 30, 2014
by
kpetersn
Browse files
Switched back to not using curl. Added comment about using curl to work around proxy problems.
parent
e7f6a2a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
an.py
View file @
260549f9
...
...
@@ -57,26 +57,24 @@ ioc_url = "http://bcda.xray.aps.anl.gov/cgi-bin/ioc_alive.cgi?ioc="
hb_period
=
10
ioc_list
=
{}
# Use curl to get the xml file to avoid python problems from cron job
#!print "Curling URL"
command
=
"curl -s %s"
%
alive_url
p
=
os
.
popen
(
command
,
'r'
)
xml_string
=
p
.
read
()
p
.
close
()
# Get the xml file
#!print "Opening URL"
#!
try:
#!
f = urllib.urlopen(alive_url)
#!
except IOError:
#!
print "Couldn't open URL"
#!
sys.exit(1)
try
:
f
=
urllib
.
urlopen
(
alive_url
)
except
IOError
:
print
"Couldn't open URL"
sys
.
exit
(
1
)
#!print "Reading XML from URL"
#!
xml_string = f.read()
xml_string
=
f
.
read
()
#!print "Closing URL"
#!
f.close()
f
.
close
()
# Use curl to get the xml file if you have web proxy problems
#!print "Curling URL"
#!command = "curl -s %s" % alive_url
#!p = os.popen(command, 'r')
#!xml_string = p.read()
#!p.close()
# Parse the xml string
#!print "Parsing XML"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment