summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorMeistache <crie.fernanda@gmail.com>2015-02-22 14:15:36 -0300
committerMeistache <crie.fernanda@gmail.com>2015-02-22 14:15:36 -0300
commitbd6b97110b2e73bcdb3ad83c6b605e10bc75736a (patch)
tree27ddc4a6011b0d8639a3a9a97cc66232408cf372 /utils.py
parent576f092fda4d3b89f9cf6fd3de96e280a0d8b775 (diff)
downloadmanamarket-bd6b97110b2e73bcdb3ad83c6b605e10bc75736a.tar.gz
manamarket-bd6b97110b2e73bcdb3ad83c6b605e10bc75736a.tar.bz2
manamarket-bd6b97110b2e73bcdb3ad83c6b605e10bc75736a.tar.xz
manamarket-bd6b97110b2e73bcdb3ad83c6b605e10bc75736a.zip
Storage finally working - may enter on test
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 542b7af..6273bef 100644
--- a/utils.py
+++ b/utils.py
@@ -13,6 +13,7 @@ import time
import mutex
import threading
from net.packet_out import *
+from threading import _Timer
allowed_chars = "abcdefghijklmnoprstquvwxyzABCDEFGHIJKLMNOPRSTQUVWXYZ1234567890-_+=!@$%^&*();'<>,.?/~`| "
@@ -138,5 +139,18 @@ class Broadcast:
self.Active = False
self.shop_broadcast.join()
+class CustomTimer(_Timer):
+ def __init__(self, interval, function, args=[], kwargs={}):
+ self._original_function = function
+ super(CustomTimer, self).__init__(interval, self._do_execute, args, kwargs)
+ self._result = None
+
+ def _do_execute(self, *a, **kw):
+ self._result = self._original_function(*a, **kw)
+
+ def join(self):
+ super(CustomTimer, self).join()
+ return self._result
+
if __name__ == '__main__':
print "Do not run this file directly. Run main.py"