aboutsummaryrefslogtreecommitdiff
path: root/parrot_zik/parrot_zik_tray.py
diff options
context:
space:
mode:
authorMarek Siarkowicz <mareksiarkowicz@gmail.com>2015-06-15 13:41:06 +0200
committerMarek Siarkowicz <mareksiarkowicz@gmail.com>2015-06-15 13:41:06 +0200
commitf291feaa8a33645850818f811ba8d7f9eb9d4c31 (patch)
tree29e085ca418110a81aee21c1794a654200301212 /parrot_zik/parrot_zik_tray.py
parent3b4f022722e43d5821f4d2276018242c88cb1ed3 (diff)
downloadpyParrotZikTCP-f291feaa8a33645850818f811ba8d7f9eb9d4c31.tar.xz
pyParrotZikTCP-f291feaa8a33645850818f811ba8d7f9eb9d4c31.zip
Refactor.
Diffstat (limited to '')
-rwxr-xr-xparrot_zik/parrot_zik_tray.py (renamed from parrot_zik/parrot_zik_tray)21
1 files changed, 8 insertions, 13 deletions
diff --git a/parrot_zik/parrot_zik_tray b/parrot_zik/parrot_zik_tray.py
index 0e5b951..35931d7 100755
--- a/parrot_zik/parrot_zik_tray
+++ b/parrot_zik/parrot_zik_tray.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
from parrot_zik.interface.version1 import ParrotZikVersion1Interface
from parrot_zik.interface.version2 import ParrotZikVersion2Interface
from parrot_zik import resource_manager
@@ -72,14 +70,11 @@ class ParrotZikIndicator(SysIndicator):
self.reconnect.start(self, RECONNECT_FREQUENCY)
self.autorefresh.stop()
- def main(self):
- self.reconnect.start(self, RECONNECT_FREQUENCY)
- SysIndicator.main(self)
-
-
-if __name__ == "__main__":
- try:
- indicator = ParrotZikIndicator()
- indicator.main()
- except KeyboardInterrupt:
- pass
+ @classmethod
+ def main(cls):
+ try:
+ indicator = cls()
+ cls.reconnect.start(indicator, RECONNECT_FREQUENCY)
+ super(ParrotZikIndicator, cls).main()
+ except KeyboardInterrupt:
+ pass