From 54d650047ae80f0730227e65eb6bc439b7934365 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 04 Dec 2013 00:18:06 +0000 Subject: more tweaks to get URL, including new status block --- (limited to 'TurtleArt') diff --git a/TurtleArt/taconstants.py b/TurtleArt/taconstants.py index 4cedb34..78cb9e1 100644 --- a/TurtleArt/taconstants.py +++ b/TurtleArt/taconstants.py @@ -287,7 +287,7 @@ OVERLAY_SHAPES = ['Cartesian', 'Cartesian_labeled', 'polar', 'metric'] STATUS_SHAPES = ['status', 'info', 'nostack', 'dupstack', 'noinput', 'emptyheap', 'emptybox', 'nomedia', 'nocode', 'overflowerror', 'negroot', 'syntaxerror', 'nofile', 'nojournal', 'zerodivide', - 'notanumber', 'incompatible', 'help', 'print'] + 'notanumber', 'incompatible', 'help', 'print', 'noconnection'] # Emulate Sugar toolbar when running from outside of Sugar TOOLBAR_SHAPES = ['hideshowoff', 'eraseron', 'run-fastoff', diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index 11e98f7..7f4138c 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -1068,9 +1068,14 @@ class LogoCode: url = "http://" + url # assume HTTP try: req = urllib2.urlopen(url) - except urllib2.HTTPError: - debug_output("Couldn't open %s" % (url), self.tw.running_sugar) + except urllib2.HTTPError, e: + debug_output("Couldn't open %s: %s" % (url, e), + self.tw.running_sugar) raise logoerror(url) + except urllib2.URLError, e: + debug_output("Couldn't open %s: %s" % (url, e), + self.tw.running_sugar) + raise logoerror('#noconnection') if req.info().getheader("Content-Type")[0:5] == "image": # it can't be deleted immediately, or else we won't ever access it -- cgit v0.9.1