Allow multiple instances of @PlatformIO

This commit is contained in:
Ivan Kravets committed 2015-09-03 19:04:09 +03:00
1 parent 25c448627e
commit 0d8d5fdb32
9 files changed
+173 -111

No files matched your search

+11
View File
@@ -100,6 +100,17 @@ class memoized(object):
return functools.partial(self.__call__, obj)
def singleton(cls):
""" From PEP-318 http://www.python.org/dev/peps/pep-0318/#examples """
_instances = {}
def get_instance(*args, **kwargs):
if cls not in _instances:
_instances[cls] = cls(*args, **kwargs)
return _instances[cls]
return get_instance
def get_systype():
data = uname()
systype = data[0]