mirror of https://github.com/kivy/kivy.git
factory: dont register twice a class with the same name.
This commit is contained in:
parent
7fe67a3ba0
commit
e267815bc8
|
@ -59,6 +59,8 @@ class FactoryBase(object):
|
||||||
'''
|
'''
|
||||||
if cls is None and module is None:
|
if cls is None and module is None:
|
||||||
raise ValueError('You must specify either cls= or module=')
|
raise ValueError('You must specify either cls= or module=')
|
||||||
|
if classname in self.classes:
|
||||||
|
return
|
||||||
self.classes[classname] = {
|
self.classes[classname] = {
|
||||||
'module': module,
|
'module': module,
|
||||||
'cls': cls,
|
'cls': cls,
|
||||||
|
|
Loading…
Reference in New Issue