diff --git a/src/gui/bottier.py b/src/gui/bottier.py index 6cfc623..63842ac 100644 --- a/src/gui/bottier.py +++ b/src/gui/bottier.py @@ -19,29 +19,31 @@ import ImageTk LOG = logging.getLogger() -logging.basicConfig(level=logging.DEBUG, +logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03i %(levelname).4s %(process)d:%(thread)d %(message)s', datefmt='%H:%M:%S') CODE = "#MWmBEKNQkAbqXHgUFRhdwp8&aDGVZ9utO03CYvlrI=i<7+?}(*[/|;!^-~`,:. " + def main(): tkis = [] # build gui root = Tk.Tk() root.title("bottier") - bu1 = Tk.Button(root, text='Quit', command= root.quit) - bu1.pack(side = Tk.BOTTOM, padx = 5, pady = 5) + bu1 = Tk.Button(root, text='Quit', command=root.quit) + bu1.pack(side=Tk.BOTTOM, padx=5, pady=5) for s in (PIC1, PIC2, PIC3, PIC4, PIC5): im = ascii2img(s) - tki = ImageTk.PhotoImage(im, gamma = 2) + tki = ImageTk.PhotoImage(im, gamma=2) tkis.append(tki) - la = Tk.Label(root, image = tki) - la.pack(side = Tk.RIGHT, padx = 5, pady = 5) + la = Tk.Label(root, image=tki) + la.pack(side=Tk.RIGHT, padx=5, pady=5) root.mainloop() root.destroy() + def ascii2img(s): # create the image # lines = StringIO(s).readlines() @@ -54,7 +56,7 @@ def ascii2img(s): im.putpixel((x, y), CODE.find(c) * 4) bbox = im.getbbox() bbim = im.crop(bbox) - imx2 = bbim.resize((bbox[2]*2, bbox[3]*2), Image.ANTIALIAS) + imx2 = bbim.resize((bbox[2] * 2, bbox[3] * 2), Image.ANTIALIAS) return imx2 PIC1 = """\ @@ -316,7 +318,7 @@ uuO03v=iIlaXAkdlrRB#WWmAQMmEBEBmmEKBEN3([*[[[[[/[*(?++?7?+7+<<7<77i<77+: OOt0CYlIl<