Add exceeption if linklist not exist

This commit is contained in:
Disco-STU 2009-05-14 10:23:42 +02:00
parent b6d3ef1b04
commit cb0fec3c03

View File

@ -243,13 +243,16 @@ else:
if linklist == "True":
print ' <div class="sidebarentry">'
print ' <small>links</small><br />'
content = open("linklist", "r")
for line in content:
if line.strip() is "":
print ' <br />'
else:
print ' &nbsp;<a href="' + line.split(" ")[0] + '" target="_blank">' + line.split(" ", 1)[1].strip() + '</a>&nbsp;<br />'
content.close()
try:
content = open("linklist", "r")
for line in content:
if line.strip() is "":
print ' <br />'
else:
print ' &nbsp;<a href="' + line.split(" ")[0] + '" target="_blank">' + line.split(" ", 1)[1].strip() + '</a>&nbsp;<br />'
content.close()
except:
print ' <br />'
print ' </div>'
print ' </div>'