7
7
###############################################################################
10
Editra Buisness Model Library: MiscUtil
10
Editra Business Model Library: MiscUtil
12
12
Various helper functions
16
16
__author__ = "Cody Precord <cprecord@editra.org>"
17
__cvsid__ = "$Id: miscutil.py 63847 2010-04-03 23:16:28Z CJP $"
18
__revision__ = "$Revision: 63847 $"
17
__cvsid__ = "$Id: miscutil.py 67329 2011-03-28 23:40:48Z CJP $"
18
__revision__ = "$Revision: 67329 $"
20
__all__ = [ 'MinMax', ]
20
__all__ = [ 'MinMax', 'Singleton']
22
22
#-----------------------------------------------------------------------------#
25
25
#-----------------------------------------------------------------------------#
27
class Singleton(type):
28
"""Singleton metaclass for creating singleton classes
29
@note: class being applied to must have a SetupWindow method
32
def __init__(cls, name, bases, dict):
33
super(Singleton, cls).__init__(name, bases, dict)
36
def __call__(cls, *args, **kw):
38
# Not created or has been Destroyed
39
obj = super(Singleton, cls).__call__(*args, **kw)
44
#-----------------------------------------------------------------------------#
27
46
def MinMax(arg1, arg2):
28
47
"""Return an ordered tuple of the minimum and maximum value