while ok == 0 becomes while not ok
This commit is contained in:
parent
103ee6e6bc
commit
4f05f4a2a5
|
@ -38,6 +38,7 @@ gtk.glade.textdomain (APP)
|
||||||
|
|
||||||
GTKGUI_GLADE = 'gtkgui.glade'
|
GTKGUI_GLADE = 'gtkgui.glade'
|
||||||
|
|
||||||
|
|
||||||
# helper function to create #aabbcc color string
|
# helper function to create #aabbcc color string
|
||||||
def mk_color_string(color):
|
def mk_color_string(color):
|
||||||
return '#' + (hex(color.red) + '0')[2:4] + \
|
return '#' + (hex(color.red) + '0')[2:4] + \
|
||||||
|
@ -498,15 +499,15 @@ class Preferences_window:
|
||||||
file = os.path.join(os.getcwd(), file)
|
file = os.path.join(os.getcwd(), file)
|
||||||
dialog.set_filename(file)
|
dialog.set_filename(file)
|
||||||
file = ''
|
file = ''
|
||||||
ok = 0
|
ok = False
|
||||||
while ok == 0:
|
while not ok:
|
||||||
response = dialog.run()
|
response = dialog.run()
|
||||||
if response == gtk.RESPONSE_OK:
|
if response == gtk.RESPONSE_OK:
|
||||||
file = dialog.get_filename()
|
file = dialog.get_filename()
|
||||||
if os.path.exists(file):
|
if os.path.exists(file):
|
||||||
ok = 1
|
ok = True
|
||||||
else:
|
else:
|
||||||
ok = 1
|
ok = True
|
||||||
dialog.destroy()
|
dialog.destroy()
|
||||||
if file:
|
if file:
|
||||||
self.xml.get_widget('sounds_entry').set_text(file)
|
self.xml.get_widget('sounds_entry').set_text(file)
|
||||||
|
@ -1476,15 +1477,15 @@ class Add_remove_emoticons_window:
|
||||||
file = os.path.join(os.getcwd(), file)
|
file = os.path.join(os.getcwd(), file)
|
||||||
dialog.set_filename(file)
|
dialog.set_filename(file)
|
||||||
file = ''
|
file = ''
|
||||||
ok = 0
|
ok = False
|
||||||
while ok == 0:
|
while not ok:
|
||||||
response = dialog.run()
|
response = dialog.run()
|
||||||
if response == gtk.RESPONSE_OK:
|
if response == gtk.RESPONSE_OK:
|
||||||
file = dialog.get_filename()
|
file = dialog.get_filename()
|
||||||
if self.image_is_ok(file):
|
if self.image_is_ok(file):
|
||||||
ok = 1
|
ok = True
|
||||||
else:
|
else:
|
||||||
ok = 1
|
ok = True
|
||||||
dialog.destroy()
|
dialog.destroy()
|
||||||
if file:
|
if file:
|
||||||
model.set_value(iter, 1, file)
|
model.set_value(iter, 1, file)
|
||||||
|
|
Loading…
Reference in New Issue