aboutsummaryrefslogtreecommitdiff
path: root/parrot_zik/utils.py
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-05-10 22:35:26 +0200
committerneodarz <neodarz@neodarz.net>2019-05-10 22:42:01 +0200
commit12c9474218f835a9443def9b685241db5454ef40 (patch)
tree32981b097c4a396253176e6eb5d11c9ed5067c27 /parrot_zik/utils.py
parent52cda61eeaee8d6575936c28348d0b095e9af830 (diff)
downloadpyParrotZikTCP-12c9474218f835a9443def9b685241db5454ef40.tar.xz
pyParrotZikTCP-12c9474218f835a9443def9b685241db5454ef40.zip
Remove pyGTK crap
Diffstat (limited to 'parrot_zik/utils.py')
-rw-r--r--parrot_zik/utils.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/parrot_zik/utils.py b/parrot_zik/utils.py
deleted file mode 100644
index 86f52cd..0000000
--- a/parrot_zik/utils.py
+++ /dev/null
@@ -1,32 +0,0 @@
-import functools
-from threading import Lock
-
-import gtk
-
-
-class repeat(object):
- def __init__(self, f):
- self.f = f
- self.id = None
- self.lock = Lock()
-
- def __call__(self, cls):
- self.f(cls)
-
- def start(self, cls, frequency):
- self.lock.acquire()
- if not self.id:
- @functools.wraps(self.f)
- def run():
- self.f(cls)
- return True
- self.id = gtk.timeout_add(frequency, run)
- self.lock.release()
-
- def stop(self):
- self.lock.acquire()
- if self.id:
- gtk.timeout_remove(self.id)
- self.id = None
- self.lock.release()
-