diff options
-rw-r--r-- | src/api/Mouse.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/api/Mouse.py b/src/api/Mouse.py index 7033e68..68211e7 100644 --- a/src/api/Mouse.py +++ b/src/api/Mouse.py @@ -9,13 +9,11 @@ class CMouse(object): mPressed = False mPrevPressed = False - def __new__(self, *args, **kargs): - if (self.mInstance is None): - self.mInstance = object.__new__(self, *args, **kargs) - self.init(self.mInstance) - #else: - # print "Warning: CMouse(): You are not allowed to instantiate it more than once." - return self.mInstance + def __new__(cls, *args, **kargs): + if (cls.mInstance is None): + cls.mInstance = object.__new__(cls, *args, **kargs) + cls.init(cls.mInstance) + return cls.mInstance def inst(self): return self.mInstance |