From cf8342a718f75e2186af7aa19865868c85da0383 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 10 Aug 2020 21:18:56 +0800 Subject: [PATCH] bugfix --- kivyblocks/blocks.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/kivyblocks/blocks.py b/kivyblocks/blocks.py index 6e71e44..9bb033f 100755 --- a/kivyblocks/blocks.py +++ b/kivyblocks/blocks.py @@ -11,6 +11,7 @@ from appPublic.folderUtils import ProgramPath from appPublic.dictObject import DictObject from appPublic.Singleton import SingletonDecorator, GlobalEnv from appPublic.datamapping import keyMapping +from appPublic.registerfunction import RegisterFunction from kivy.config import Config from kivy.metrics import sp,dp,mm @@ -99,17 +100,6 @@ class NotRegistedWidget(Exception): def __expr__(self): return self.__str__() -@SingletonDecorator -class RegistedFunction: - def __init__(self): - self.rf_list = {} - - def register(self,name,func): - self.rf_list[name] = func - - def get(self,name): - return self.rf_list.get(name) - def registerWidget(name,widget): globals()[name] = widget @@ -399,7 +389,7 @@ class Blocks(EventDispatcher): return data def registedfunctionAction(self, widget, desc): - rf = RegistedFunction() + rf = RegisterFunction() name = desc.get('rfname') func = rf.get(name) if func is None: