diff options
author | Disco-STU <discostu@horion.network1.lan> | 2009-05-14 10:23:42 +0200 |
---|---|---|
committer | Disco-STU <discostu@horion.network1.lan> | 2009-05-14 10:23:42 +0200 |
commit | cb0fec3c03486dc200010368b8d3ec2828bed705 (patch) | |
tree | 8bdfd3552d0ebea9458fa00552e95aa031d5e180 | |
parent | b6d3ef1b04ffbf02b753718d434fdbe0ba5defa8 (diff) |
Add exceeption if linklist not exist
-rwxr-xr-x | blogthon.cgi | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/blogthon.cgi b/blogthon.cgi index 2fcb619..bc246ab 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -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 ' <a href="' + line.split(" ")[0] + '" target="_blank">' + line.split(" ", 1)[1].strip() + '</a> <br />' - content.close() + try: + content = open("linklist", "r") + for line in content: + if line.strip() is "": + print ' <br />' + else: + print ' <a href="' + line.split(" ")[0] + '" target="_blank">' + line.split(" ", 1)[1].strip() + '</a> <br />' + content.close() + except: + print ' <br />' print ' </div>' print ' </div>' |