Removed use of eval

This commit is contained in:
Andrew Murray 2016-05-10 23:07:16 +10:00
parent b1a528bf10
commit 6475530f65
3 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ class Enhance(Frame):
s.pack() s.pack()
def update(self, value): def update(self, value):
self.value = eval(value) self.value = float(value)
self.tkim.paste(self.enhancer.enhance(self.value)) self.tkim.paste(self.enhancer.enhance(self.value))
# #

View File

@ -208,7 +208,7 @@ class PILDriver(object):
Process the top image with the given filter. Process the top image with the given filter.
""" """
from PIL import ImageFilter from PIL import ImageFilter
imageFilter = eval("ImageFilter." + self.do_pop().upper()) imageFilter = getattr(ImageFilter, self.do_pop().upper())
image = self.do_pop() image = self.do_pop()
self.push(image.filter(imageFilter)) self.push(image.filter(imageFilter))

View File

@ -42,7 +42,7 @@ class UI(Frame):
# self.redraw() # self.redraw()
def update_scale(self, value): def update_scale(self, value):
self.value = eval(value) self.value = float(value)
self.redraw() self.redraw()