[prev in list] [next in list] [prev in thread] [next in thread]
List: klik-devel
Subject: [klik-devel] [klikclient commit] r932 - in
From: codesite-noreply () google ! com
Date: 2008-01-27 20:18:58
Message-ID: 000e0cd0ed780444b9e6cb3cb6119ea () google ! com
[Download RAW message or body]
Author: KillerKiwi2005
Date: Sun Jan 27 12:18:33 2008
New Revision: 932
Modified:
trunk/client/trunk/klikclient/lib/klik/base.py
trunk/client/trunk/klikclient/lib/klik/gtk/create.py
trunk/client/trunk/klikclient/lib/klik/recipe.py
Log:
Better fix for malformed xml
Modified: trunk/client/trunk/klikclient/lib/klik/base.py
==============================================================================
--- trunk/client/trunk/klikclient/lib/klik/base.py (original)
+++ trunk/client/trunk/klikclient/lib/klik/base.py Sun Jan 27 12:18:33 2008
@@ -138,11 +138,9 @@
# Load Recipe
print("Parsing recipe...")
recipe = KlikRecipe()
- try:
- recipe.load_from_string( data )
- self.print_recipe(recipe)
- except:
- raise SafeException("Error occurred while attempting to load recipe")
+ recipe.load_from_string( data )
+ self.print_recipe(recipe)
+
return recipe
def print_recipe(self, recipe):
Modified: trunk/client/trunk/klikclient/lib/klik/gtk/create.py
==============================================================================
--- trunk/client/trunk/klikclient/lib/klik/gtk/create.py (original)
+++ trunk/client/trunk/klikclient/lib/klik/gtk/create.py Sun Jan 27
12:18:33 2008
@@ -348,9 +348,8 @@
self.args = args
gtk.gdk.threads_init()
- self.download_recipe()
-
try:
+ self.download_recipe()
gtk.main()
self.quit()
except Exception, inst:
@@ -411,7 +410,7 @@
def error_alert(self, error_inst):
gtk.gdk.threads_enter()
-
+
text = "<b>%s</b>\n\n%s" % (_("Error Occurred"), str(error_inst))
text = string.replace(text, "\\n","\n")
print ""
@@ -419,6 +418,7 @@
if isinstance(error_inst, SafeException) == False and not isinstance(error_inst ,ExecuteException):
# dump trace to screen
traceback.print_exc()
+ gtk.gdk.threads_leave()
else:
print >> sys.stderr, error_inst
Modified: trunk/client/trunk/klikclient/lib/klik/recipe.py
==============================================================================
--- trunk/client/trunk/klikclient/lib/klik/recipe.py (original)
+++ trunk/client/trunk/klikclient/lib/klik/recipe.py Sun Jan 27
12:18:33 2008
@@ -173,13 +173,13 @@
def load_from_file(self, path):
- #try:
+ try:
f = open(path, "r")
xml = f.read()
f.close()
self.load_from_string(xml)
- #except:
- # raise Exception("Error recipe could not be loaded does not appear
to be valid XML")
+ except:
+ raise SafeException("Error recipe could not be loaded does not
appear to be valid XML")
def load_from_string(self, xml):
@@ -188,7 +188,7 @@
document = parseString(xml)
except:
- raise Exception("Error recipe could not be loaded does not appear
to be valid XML")
+ raise SafeException("Error recipe could not be loaded does not
appear to be valid XML")
self.__load_from_document(document)
_______________________________________________
klik-devel mailing list
klik-devel@kde.org
https://mail.kde.org/mailman/listinfo/klik-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic