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