Added regex to escape double quote charater in filenames

This commit is contained in:
glenntanner3 2015-05-18 13:54:38 -04:00
parent b9036954b4
commit 2ccf541835

View file

@ -17,6 +17,8 @@
from gi.repository import GObject,Gdk from gi.repository import GObject,Gdk
import re
class interface_manager(GObject.GObject): class interface_manager(GObject.GObject):
""" This class allows to automatically generate variables for a GLADE interface, """ This class allows to automatically generate variables for a GLADE interface,
set the widgets in the interface to their values, and copy the current values set the widgets in the interface to their values, and copy the current values
@ -75,7 +77,7 @@ class interface_manager(GObject.GObject):
The default value can be a text or None """ The default value can be a text or None """
if (default_value != None): if (default_value != None):
exec('self.'+text_name+' = "'+str(default_value)+'"') exec('self.'+text_name+' = "'+re.sub('\"','\\\"', str(default_value))+'"')
else: else:
exec('self.'+text_name+' = None') exec('self.'+text_name+' = None')
self.interface_text.append( (text_name, callback) ) self.interface_text.append( (text_name, callback) )