From c3ffbff146c18600d85be46b7abc3580b374e72d Mon Sep 17 00:00:00 2001 From: lufebe16 Date: Thu, 23 Nov 2023 17:49:38 +0100 Subject: [PATCH] Kivy Version - refactorings & some clean up --- buildozer/main.py | 3 + pysollib/kivy/LApp.py | 202 ++---------------------- pysollib/kivy/LBase.py | 24 +++ pysollib/kivy/LImage.py | 244 +++++++++++++++++++++++++++++ pysollib/kivy/card.py | 2 +- pysollib/kivy/fullpicturedialog.py | 3 +- pysollib/kivy/tkcanvas.py | 15 +- pysollib/kivy/tkstats.py | 2 +- pysollib/kivy/tkutil.py | 2 +- pysollib/kivy/tkwidget.py | 2 +- pysollib/kivy/toast.py | 2 +- pysollib/kivy/toolbar.py | 9 +- 12 files changed, 303 insertions(+), 207 deletions(-) create mode 100644 pysollib/kivy/LBase.py create mode 100644 pysollib/kivy/LImage.py diff --git a/buildozer/main.py b/buildozer/main.py index c3dac4bd6d..e6426b0d97 100755 --- a/buildozer/main.py +++ b/buildozer/main.py @@ -23,6 +23,7 @@ # Starter for kivy/android using buildozer: Needs an explizitly # named main.py as startpoint. +import os import sys if '--kivy' not in sys.argv: sys.argv.append('--kivy') @@ -34,4 +35,6 @@ if runmain: from pysollib.main import main + +os.environ['KIVY_NO_CONSOLELOG'] = "No" sys.exit(main(sys.argv)) diff --git a/pysollib/kivy/LApp.py b/pysollib/kivy/LApp.py index c19fa22592..01a483d4ef 100644 --- a/pysollib/kivy/LApp.py +++ b/pysollib/kivy/LApp.py @@ -46,7 +46,6 @@ from kivy.uix.behaviors import ButtonBehavior from kivy.uix.boxlayout import BoxLayout from kivy.uix.floatlayout import FloatLayout -from kivy.uix.image import Image as KivyImage from kivy.uix.label import Label from kivy.uix.scrollview import ScrollView from kivy.uix.treeview import TreeView @@ -54,6 +53,7 @@ from kivy.uix.widget import Widget from kivy.utils import platform +from pysollib.kivy.LBase import LBase from pysollib.kivy.androidperms import requestStoragePerm from pysollib.kivy.androidrot import AndroidScreenRotation from pysollib.resource import CSI @@ -97,19 +97,6 @@ def get_screen_ori(): return so # ============================================================================= -# kivy EventDispatcher passes keywords, that to not correspond to properties -# to the base classes. Finally they will reach 'object'. With python3 (but not -# python2) 'object' throws an exception 'takes no parameters' in that a -# situation. We therefore underlay a base class (right outside), which -# swallows up remaining keywords. Thus the keywords do not reach 'object' any -# more. - - -class LBase(object): - def __init__(self, **kw): - super(LBase, self).__init__() - -# ============================================================================= class LPopCommander(LBase): @@ -147,6 +134,8 @@ def animEnd(self, anim, widget): # no further animations for widget so stop del self.widgets[widget] + # print('Clock.get_fps() ->', Clock.get_fps()) + def makeAnimStart(self, anim, spos, widget): def animStart(dt): widget.pos = spos @@ -217,173 +206,6 @@ def winfo_screenheight(self): # ============================================================================= -class LImage(Widget, LBase): - CONTAIN = 0 - FILL = 1 - COVER = 2 - SCALE_DOWN = 3 - fit_mode = StringProperty("contain") - - def make_scale_down(self, s, p): - r = self.rect - t = self.texture.size - if (t[0] > s[0]) or (t[1] > s[1]): - self.make_contain(s, p) - else: - r.size = t - r.pos = (p[0]+(s[0]-t[0])/2.0, p[1]+(s[1]-t[1])/2.0) - - def make_fill(self, s, p): - r = self.rect - r.size = s - r.pos = p - - def make_contain(self, s, p): - taspect = self.texture.size[0]/self.texture.size[1] - waspect = s[0]/s[1] - r = self.rect - if waspect < taspect: - s1 = s[1]*waspect/taspect - r.size = (s[0], s1) - r.pos = (p[0], p[1]+(s[1]-s1)/2.0) - else: - s0 = s[0]/waspect*taspect - r.size = (s0, s[1]) - r.pos = (p[0]+(s[0]-s0)/2.0, p[1]) - - def make_cover(self, s, p): - aspect = self.texture.size[0]/self.texture.size[1] - waspect = self.size[0]/self.size[1] - print ('aspect: ', aspect) # noqa - print ('waspect: ', waspect) # noqa - - # 'clamp_to_edge','repeat','mirrored_repeat' - self.texture.wrap = 'repeat' - print ('wrap: ',self.texture.wrap) # noqa - - # set rect size/pos to window - r = self.rect - r.size = s - r.pos = p - - # evaluate original texture coords ? - u = uu = self.tex_u # noqa - v = vv = self.tex_v # noqa - w = ww = self.tex_w - h = hh = self.tex_h - - # in order to center the image in the window - # modify texture coords - if waspect < aspect: - w = ww/aspect*waspect # noqa - u = 0.5 - w/2.0 # noqa - else: - h = hh*aspect/waspect # noqa - v = 0.5 - h/2.0 # noqa - - # and update them. - tc = ( u, v, u + w, v, u + w, v + h, u, v + h ) # noqa - r.tex_coords = tc - - def make_format(self, size, pos): - if self.fit_num == self.CONTAIN: - self.make_contain(size, pos) - elif self.fit_num == self.FILL: - self.make_fill(size, pos) - elif self.fit_num == self.COVER: - self.make_cover(size, pos) - elif self.fit_num == self.SCALE_DOWN: - self.make_scale_down(size, pos) - - def __init__(self, **kwargs): - super(LImage, self).__init__(**kwargs) - - self.silent = False - self.corePos = None - self.coreSize = None - self.source = None - if "source" in kwargs: - self.source = kwargs["source"] - image = KivyImage(source=self.source) - self.texture = image.texture - if "texture" in kwargs: - self.texture = kwargs["texture"] - self.fit_num = self.CONTAIN # o.k. (default) - # self.fit_num = self.FILL # o.k. - # self.fit_num = self.COVER # o.k. - # self.fit_num = self.SCALE_DOWN # o.k. - if "fit_mode" in kwargs: - self.fit_mode = kwargs["fit_mode"] - - # setup canvas. - with self.canvas: - self.color = Color(1.0,1.0,1.0,1.0) # noqa - self.rect = Rectangle(texture=self.texture) - - # save original tex_coords - self.tex_u = self.rect.tex_coords[0] - self.tex_v = self.rect.tex_coords[1] - self.tex_w = self.rect.tex_coords[2] - self.tex_u - self.tex_h = self.rect.tex_coords[5] - self.tex_v - - self.size = self.texture.size - self.size_hint = (1.0, 1.0) - - def on_size(self, a, s): - self.make_format(s, self.pos) - - def on_pos(self, a, p): - self.make_format(self.size, p) - - def on_fit_mode(self, a, m): - print('on_fit_mode', m) - if self.fit_mode == "contain": - self.fit_num = self.CONTAIN - if self.fit_mode == "fill": - self.fit_num = self.FILL - if self.fit_mode == "cover": - self.fit_num = self.COVER - if self.fit_mode == "scale_down": - self.fit_num = self.SCALE_DOWN - - def getHeight(self): - return self.size[1] - - def getWidth(self): - return self.size[0] - - def subsample(self, r): - return LImage(texture=self.texture) - - def on_touch_down(self, touch): - if self.silent: - return False - - # print('LImage: touch_down on %s' % str(touch.pos)) - if self.collide_point(*touch.pos): - if (self.source is not None): - print('LImage match %s' % self.source) - else: - print('LImage match with texture') - return True - return False - - def on_touch_up(self, touch): - if self.silent: - return False - - # print('LImage: touch_up on %s' % str(touch.pos)) - if self.collide_point(*touch.pos): - if (self.source is not None): - print('LImage match %s' % self.source) - else: - print('LImage match with texture') - return True - return False - -# ============================================================================= - - def addAnchorOffset(pos, size, anchor): # print ('MfxCanvas: anchor=%s' % (anchor)) x = pos[0] @@ -449,8 +271,8 @@ def pyth(a, b): cardscale = 1.0 try: cs = canvas.wmain.app.images.cs - print('Cardset:', cs) - print('Cardset:', cs.type) + # print('Cardset:', cs) + # print('Cardset:', cs.type) cardbase = pyth(73, 97) if cs.type == CSI.TYPE_FRENCH: @@ -849,6 +671,9 @@ def on_touch_up(self, touch): return False # ============================================================================= +# Represents a Card as Kivy Window. Will contain an LImage item as child. +# Images are managed in cards.py according to the cards state. Processes +# Events/Action on the card. class LImageItem(BoxLayout, LBase): @@ -894,6 +719,7 @@ def send_event_pressed(self, touch, event): def on_touch_down(self, touch): + print('LCardImage: size = %s' % self.size) if self.collide_point(*touch.pos): for c in self.children: @@ -1587,7 +1413,7 @@ def wm_geometry(self, val): pass def update_idletasks(self): - logging.info("LTkBase: update_idletasks") + # logging.info("LTkBase: update_idletasks") try: if len(EventLoop.event_listeners) > 0: self.in_loop = True @@ -1614,7 +1440,7 @@ def quit(self): stopTouchApp() def interruptSleep(self): - logging.info('LTkBase: interruptSleep') + # logging.info('LTkBase: interruptSleep') self.update_idletasks() # self.sleep_var = 1 return @@ -1639,7 +1465,7 @@ def sleep(self, seconds): self.in_loop = False def waitCondition(self, condition, swallow=False, pickup=False): - logging.info('LTkBase: wait condition start') + # logging.info('LTkBase: wait condition start') while condition(): self.in_loop = True if swallow: # eat picked input up @@ -1650,7 +1476,7 @@ def waitCondition(self, condition, swallow=False, pickup=False): if EventLoop.window: EventLoop.window.mainloop() self.in_loop = False - logging.info('LTkBase: wait condition end') + # logging.info('LTkBase: wait condition end') def waitAnimation(self, swallow=False, pickup=False): self.waitCondition(LAnimationManager.checkRunning, @@ -1977,7 +1803,7 @@ def doSize(self, obj, val): mval = self.mainWindow.size if (val[0] != mval[0] and val[1] != mval[1]): logging.info("LApp: size changed %s - %s (%s)" % (obj, val, mval)) - Clock.schedule_once(self.makeDelayedRebuild(), 0.01) + Clock.schedule_once(self.makeDelayedRebuild(), 0.2) pass def on_start(self): diff --git a/pysollib/kivy/LBase.py b/pysollib/kivy/LBase.py new file mode 100644 index 0000000000..0605ae139e --- /dev/null +++ b/pysollib/kivy/LBase.py @@ -0,0 +1,24 @@ +#!/usr/bin/python +# -*- mode: python; coding: utf-8; -*- +# ============================================================================= +# Copyright (C) 2017-2023 LB +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ============================================================================= +# noqa +# kivy EventDispatcher passes keywords, that to not correspond to properties +# to the base classes. Finally they will reach 'object'. With python3 (but not +# python2) 'object' throws an exception 'takes no parameters' in that a +# situation. We therefore underlay a base class (right outside), which +# swallows up remaining keywords. Thus the keywords do not reach 'object' any +# more. + +class LBase(object): + def __init__(self, **kw): + super(LBase, self).__init__() + +# ============================================================================= diff --git a/pysollib/kivy/LImage.py b/pysollib/kivy/LImage.py new file mode 100644 index 0000000000..91b0d12583 --- /dev/null +++ b/pysollib/kivy/LImage.py @@ -0,0 +1,244 @@ +#!/usr/bin/python +# -*- mode: python; coding: utf-8; -*- +# ============================================================================= +# Copyright (C) 2017-2023 LB +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ============================================================================= + +import math +# import inspect + +from kivy.graphics import Color +from kivy.graphics import Rectangle +from kivy.properties import ObjectProperty +from kivy.properties import StringProperty +from kivy.uix.image import Image as KivyImage +from kivy.uix.widget import Widget + +from pysollib.kivy.LBase import LBase + +# ============================================================================= + + +class LImage(Widget, LBase): + CONTAIN = 0 + FILL = 1 + COVER = 2 + SCALE_DOWN = 3 + TILING = 4 + fit_mode = StringProperty("fill") + texture = ObjectProperty(None, allownone=True) + + def make_scale_down(self, s, p): + r = self.rect + t = self.texture.size + if (t[0] > s[0]) or (t[1] > s[1]): + self.make_contain(s, p) + else: + r.size = t + r.pos = (p[0]+(s[0]-t[0])/2.0, p[1]+(s[1]-t[1])/2.0) + + def make_fill(self, s, p): + self.rect.size = s + self.rect.pos = p + + def make_contain(self, s, p): + taspect = self.texture.size[0]/self.texture.size[1] + waspect = s[0]/s[1] + r = self.rect + if waspect < taspect: + s1 = s[1]*waspect/taspect + r.size = (s[0], s1) + r.pos = (p[0], p[1]+(s[1]-s1)/2.0) + else: + s0 = s[0]/waspect*taspect + r.size = (s0, s[1]) + r.pos = (p[0]+(s[0]-s0)/2.0, p[1]) + + def make_cover(self, s, p): + aspect = self.texture.size[0]/self.texture.size[1] + waspect = self.size[0]/self.size[1] + print ('aspect: ', aspect) # noqa + print ('waspect: ', waspect) # noqa + + # 'clamp_to_edge','repeat','mirrored_repeat' + self.texture.wrap = 'repeat' + print ('wrap: ',self.texture.wrap) # noqa + + # set rect size/pos to window + self.rect.size = s + self.rect.pos = p + + # evaluate original texture coords ? + u = uu = self.tex_u # noqa + v = vv = self.tex_v # noqa + w = ww = self.tex_w + h = hh = self.tex_h + + # in order to center the image in the window + # modify texture coords + if waspect < aspect: + w = ww/aspect*waspect # noqa + u = 0.5 - w/2.0 # noqa + else: + h = hh*aspect/waspect # noqa + v = 0.5 - h/2.0 # noqa + + # and update them. + tc = ( u, v, u + w, v, u + w, v + h, u, v + h ) # noqa + self.rect.tex_coords = tc + + def make_tiling(self, s, p): + # set rect size/pos to window + self.rect.size = s + self.rect.pos = p + + # number of repetitions + t = self.texture + t.wrap = 'repeat' + stepsy = self.size[1] / t.size[1] + stepsx = self.size[0] / t.size[0] + + # set coord parameters. + w = self.tex_w * stepsx + h = self.tex_h * stepsy + u = self.tex_u + v = stepsy - math.floor(stepsy) + self.rect.tex_coords = ( u, v, u + w, v, u + w, v + h, u, v + h ) # noqa + + def make_format(self, size, pos): + if hasattr(self, "rect"): + if self.texture is None: + self.rect.size = size + self.rect.pos = pos + elif self.fit_num == self.CONTAIN: + self.make_contain(size, pos) + elif self.fit_num == self.FILL: + self.make_fill(size, pos) + elif self.fit_num == self.COVER: + self.make_cover(size, pos) + elif self.fit_num == self.SCALE_DOWN: + self.make_scale_down(size, pos) + elif self.fit_num == self.TILING: + self.make_tiling(size, pos) + + def __init__(self, **kwargs): + super(LImage, self).__init__(**kwargs) + + # NOTE: + # properties self.texture and self.fit_mode are + # already set here from the super call either to its + # default value or set from evaluaion of a matching kwargs + # entry. + ''' + print('LImage __init__: ',self) + print('stack[1] = ',inspect.stack()[1].frame) + print('stack[2] = ',inspect.stack()[2].frame) + print('texture=',self.texture) + print('fit_mode=',self.fit_mode) + ''' + self.corePos = None + self.coreSize = None + self.source = None + if "source" in kwargs: + self.source = kwargs["source"] + image = KivyImage(source=self.source) + self.texture = image.texture + + # update fit_num from fit_mode (needs self.fit_num defined) + self.fit_num = self.FILL + self.fit_num_update(self.fit_mode) + + # setup canvas. + self.background = False + if "background" in kwargs: + self.background = kwargs["background"] + + if self.background: + with self.canvas.before: + self.color = Color(1.0,1.0,1.0,1.0) # noqa + self.rect = Rectangle(texture=self.texture) + else: + with self.canvas: + self.color = Color(1.0,1.0,1.0,1.0) # noqa + self.rect = Rectangle(texture=self.texture) + + # save original tex_coords (needs self.rect defined) + self.tex_coord_update(self.texture) + + # initial size is the natural size of the image. + self.size = self.texture.size + + def tex_coord_update(self, texture): + if hasattr(self, "rect"): + self.rect.texture = texture + self.tex_u = self.rect.tex_coords[0] + self.tex_v = self.rect.tex_coords[1] + self.tex_w = self.rect.tex_coords[2] - self.tex_u + self.tex_h = self.rect.tex_coords[5] - self.tex_v + + def fit_num_update(self, fit_mode): + if hasattr(self, "fit_num"): + if fit_mode == "contain": + self.fit_num = self.CONTAIN + if fit_mode == "fill": + self.fit_num = self.FILL + if fit_mode == "cover": + self.fit_num = self.COVER + if fit_mode == "scale_down": + self.fit_num = self.SCALE_DOWN + if fit_mode == "tiling": + self.fit_num = self.TILING + + def on_size(self, a, s): + self.make_format(s, self.pos) + + def on_pos(self, a, p): + self.make_format(self.size, p) + + def on_fit_mode(self, a, m): + self.fit_num_update(self.fit_mode) + self.make_format(self.size, self.pos) + + def on_texture(self, a, texture): + self.tex_coord_update(self.texture) + self.make_format(self.size, self.pos) + + def setColor(self, color): + self.color.rgba = color + + def getHeight(self): + return self.size[1] + + def getWidth(self): + return self.size[0] + + def subsample(self, r): + return LImage(texture=self.texture) + + def on_touch_down(self, touch): + # print('LImage: touch_down on %s' % str(touch.pos)) + if self.collide_point(*touch.pos): + if (self.source is not None): + print('LImage match %s' % self.source) + else: + print('LImage match with texture') + return True + return False + + def on_touch_up(self, touch): + # print('LImage: touch_up on %s' % str(touch.pos)) + if self.collide_point(*touch.pos): + if (self.source is not None): + print('LImage match %s' % self.source) + else: + print('LImage match with texture') + return True + return False + +# ============================================================================= diff --git a/pysollib/kivy/card.py b/pysollib/kivy/card.py index 8ef7ad09eb..747ab0cccb 100644 --- a/pysollib/kivy/card.py +++ b/pysollib/kivy/card.py @@ -22,8 +22,8 @@ # ---------------------------------------------------------------------------# from pysollib.acard import AbstractCard -from pysollib.kivy.LApp import LImage from pysollib.kivy.LApp import LImageItem +from pysollib.kivy.LImage import LImage from pysollib.kivy.tkcanvas import MfxCanvasGroup, MfxCanvasImage diff --git a/pysollib/kivy/fullpicturedialog.py b/pysollib/kivy/fullpicturedialog.py index 5bbda95b7b..83a323c714 100644 --- a/pysollib/kivy/fullpicturedialog.py +++ b/pysollib/kivy/fullpicturedialog.py @@ -25,7 +25,8 @@ from kivy.uix.stacklayout import StackLayout -from pysollib.kivy.LApp import LImage, LTopLevel0 +from pysollib.kivy.LApp import LTopLevel0 +from pysollib.kivy.LImage import LImage from pysollib.mygettext import _ # ************************************************************************ diff --git a/pysollib/kivy/tkcanvas.py b/pysollib/kivy/tkcanvas.py index 92dcc3043a..1ef4667208 100644 --- a/pysollib/kivy/tkcanvas.py +++ b/pysollib/kivy/tkcanvas.py @@ -35,12 +35,12 @@ from pysollib.kivy.LApp import LAnimationManager from pysollib.kivy.LApp import LColorToKivy -from pysollib.kivy.LApp import LImage -from pysollib.kivy.LApp import LImage as Image from pysollib.kivy.LApp import LImageItem from pysollib.kivy.LApp import LLine from pysollib.kivy.LApp import LRectangle from pysollib.kivy.LApp import LText +from pysollib.kivy.LBase import LBase +from pysollib.kivy.LImage import LImage # ************************************************************************ # * canvas items helpers @@ -512,15 +512,15 @@ def addtag(self, tag): # ************************************************************************ -class MfxCanvas(Widget): +class MfxCanvas(Widget, LBase): def __str__(self): return f'' def __init__(self, wmain, *args, **kw): - # super(MfxCanvas, self).__init__(**kw) super(MfxCanvas, self).__init__() + # print('MfxCanvas: __init__()') # self.tags = {} # bei basisklasse widget (ev. nur vorläufig) self.wmain = wmain @@ -714,8 +714,9 @@ def update_widget(self, posorobj, size): r = Rectangle(texture=texture, pos=self.pos, size=self.size) self.canvas.before.add(r) - stsize = (texture.size[0] * self.scale, - texture.size[1] * self.scale) + # stsize = (texture.size[0] * self.scale, + # texture.size[1] * self.scale) + stsize = texture.size stepsy = self.size[1] / stsize[1] stepsx = self.size[0] / stsize[0] @@ -860,7 +861,7 @@ def setTile(self, image, stretch=0, save_aspect=0): print('setTile: %s, %s' % (image, stretch)) if image: try: - self._bg_img = Image(source=image) + self._bg_img = LImage(source=image) self._stretch_bg_image = stretch self._save_aspect_bg_image = save_aspect self.update_widget(self.pos, self.size) diff --git a/pysollib/kivy/tkstats.py b/pysollib/kivy/tkstats.py index f5378bb7e8..02aeac23fb 100644 --- a/pysollib/kivy/tkstats.py +++ b/pysollib/kivy/tkstats.py @@ -40,7 +40,7 @@ # from pysollib.stats import PysolStatsFormatter, ProgressionFormatter # from pysollib.util import * # from tkutil import bind, unbind_destroy, loadImage -from pysollib.kivy.LApp import LImage +from pysollib.kivy.LImage import LImage from pysollib.mfxutil import KwStruct from pysollib.mygettext import _ from pysollib.pysoltk import MfxDialog, MfxMessageDialog diff --git a/pysollib/kivy/tkutil.py b/pysollib/kivy/tkutil.py index e13ccc7b64..893ef8e4a4 100644 --- a/pysollib/kivy/tkutil.py +++ b/pysollib/kivy/tkutil.py @@ -36,8 +36,8 @@ from kivy.core.text import Label as CoreLabel from kivy.graphics.texture import Texture -from pysollib.kivy.LApp import LImage from pysollib.kivy.LApp import LTopLevel0 +from pysollib.kivy.LImage import LImage # ************************************************************************ # * window manager util diff --git a/pysollib/kivy/tkwidget.py b/pysollib/kivy/tkwidget.py index 94504ac43e..c33423354a 100644 --- a/pysollib/kivy/tkwidget.py +++ b/pysollib/kivy/tkwidget.py @@ -37,9 +37,9 @@ from kivy.uix.label import Label from pysollib.kivy.LApp import LBoxLayout -from pysollib.kivy.LApp import LImage from pysollib.kivy.LApp import LScrollView from pysollib.kivy.LApp import LTopLevel +from pysollib.kivy.LImage import LImage from pysollib.kivy.tkcanvas import MfxCanvas from pysollib.kivy.tkutil import bind, unbind_destroy from pysollib.kivy.tkutil import makeToplevel diff --git a/pysollib/kivy/toast.py b/pysollib/kivy/toast.py index 267277a40e..cb06fb54d2 100644 --- a/pysollib/kivy/toast.py +++ b/pysollib/kivy/toast.py @@ -9,7 +9,7 @@ from kivy.uix.label import Label from kivy.uix.widget import Widget -from pysollib.kivy.LApp import LBase +from pysollib.kivy.LBase import LBase # ================================================================ diff --git a/pysollib/kivy/toolbar.py b/pysollib/kivy/toolbar.py index 50527a918b..4ed9cbccc4 100644 --- a/pysollib/kivy/toolbar.py +++ b/pysollib/kivy/toolbar.py @@ -30,8 +30,8 @@ from kivy.uix.image import Image as KivyImage # PySol kivy imports -from pysollib.kivy.LApp import LBase -from pysollib.kivy.LApp import LImage +from pysollib.kivy.LBase import LBase +from pysollib.kivy.LImage import LImage from pysollib.kivy.toast import Toast # PySol imports @@ -317,7 +317,6 @@ def doResize(self, *args): def show(self, on, **kw): side = self.menubar.tkopt.toolbar.get() self.win.setTool(None, side) - print('******** toolbar show', on, side, kw) # size_hint dependent on screen orientation: asp = Window.width/Window.height @@ -358,8 +357,6 @@ def changed_state(self, instance, value): self.redraw() def config(self, w, v): - print('********************* PysolToolbarTk: config %s, %s' % (w, v)) - if w == 'shuffle': self.buttond['shuffle'].shown = v self.buttond['autodrop'].shown = not v @@ -452,7 +449,7 @@ def _busy(self): # return 1 if not self.game or not self.menubar: return 1 - print('_busy:') + # print('_busy:') self.game.stopDemo() self.game.interruptSleep() return self.game.busy