fixing what we return also do not check not loading. the point is to refuse on adding or else we allow bugs

This commit is contained in:
Nikos Kouremenos 2005-06-18 14:57:25 +00:00
parent 7e4f56f002
commit 39b0e8962a

View file

@ -663,14 +663,11 @@ class Interface:
try: try:
img.set_from_file(image) img.set_from_file(image)
except: except:
return True return False
if img.get_storage_type() == gtk.IMAGE_PIXBUF: if img.get_storage_type() == gtk.IMAGE_PIXBUF:
pix = img.get_pixbuf() pix = img.get_pixbuf()
else: else:
return False return False
if pix.get_width() > 24 or pix.get_height() > 24:
#FIXME: inform the user why you don't accept it
return False
return True return True
def make_regexps(self): def make_regexps(self):
@ -713,7 +710,7 @@ class Interface:
emoticons_pattern += emoticon_escaped + '|'# | means or in regexp emoticons_pattern += emoticon_escaped + '|'# | means or in regexp
emot_and_basic_pattern = emoticons_pattern + basic_pattern emot_and_basic_pattern = emoticons_pattern + basic_pattern
self.emot_and_basic_re = sre.compile(emot_and_basic_pattern,\ self.emot_and_basic_re = sre.compile(emot_and_basic_pattern,
sre.IGNORECASE) sre.IGNORECASE)
# at least one character in 3 parts (before @, after @, after .) # at least one character in 3 parts (before @, after @, after .)