diff options
author | Marek Siarkowicz <mareksiarkowicz@gmail.com> | 2015-06-15 11:42:11 +0200 |
---|---|---|
committer | Marek Siarkowicz <mareksiarkowicz@gmail.com> | 2015-06-15 12:01:44 +0200 |
commit | 793b4d11fe6e7a188d5594cad5f7861225e0dd58 (patch) | |
tree | 2e399111e7fb2ecc44e13e8dd3fd5b3c62116a6c /parrot_zik | |
parent | 947a9f7d10bc3c54939cfa72dab27b2e64034318 (diff) | |
download | pyParrotZikTCP-793b4d11fe6e7a188d5594cad5f7861225e0dd58.tar.xz pyParrotZikTCP-793b4d11fe6e7a188d5594cad5f7861225e0dd58.zip |
Refactor.
Diffstat (limited to 'parrot_zik')
-rw-r--r-- | parrot_zik/indicator.py | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/parrot_zik/indicator.py b/parrot_zik/indicator.py index 2691113..e121e92 100644 --- a/parrot_zik/indicator.py +++ b/parrot_zik/indicator.py @@ -40,15 +40,11 @@ class BaseIndicator(object): class WindowsIndicator(BaseIndicator): def __init__(self, icon, menu): - self.icon_directory = ( - os.path.dirname(os.path.realpath(sys.argv[0])) + os.path.sep + '..' - + os.path.sep + 'share' + os.path.sep + 'icons' - + os.path.sep +'zik' + os.path.sep) + self.icon_directory = os.path.join( + os.path.dirname(os.path.realpath(sys.argv[0])), '..', 'share', 'icons', 'zik') self.menu_shown = False - sys.stdout = open(tempfile.gettempdir() - + os.path.sep + "zik_tray_stdout.log", "w") - sys.stderr = open(tempfile.gettempdir() - + os.path.sep + "zik_tray_stderr.log", "w") + sys.stdout = open(os.path.join(tempfile.gettempdir(), "zik_tray_stdout.log", "w")) + sys.stderr = open(os.path.join(tempfile.gettempdir(), "zik_tray_stderr.log", "w")) statusicon = gtk.StatusIcon() statusicon.connect("popup-menu", self.gtk_right_click_event) statusicon.set_tooltip("Parrot Zik") @@ -73,14 +69,9 @@ class WindowsIndicator(BaseIndicator): class LinuxIndicator(BaseIndicator): def __init__(self, icon, menu): import appindicator - self.icon_directory = (os.path.sep + 'usr' + os.path.sep + 'share' - + os.path.sep + 'icons' + os.path.sep+'zik' - + os.path.sep) + self.icon_directory = os.path.join('/', 'usr', 'share', 'icons', 'zik') if not os.path.isdir(self.icon_directory): - self.icon_directory = (os.path.dirname(sys.argv[0]) + os.path.sep + '..' - + os.path.sep + 'share' + os.path.sep - + 'icons' + os.path.sep+'zik' - + os.path.sep) + self.icon_directory = os.path.join(os.path.dirname(sys.argv[0]), '..', 'share', 'icons', 'zik') statusicon = appindicator.Indicator( "new-parrotzik-indicator", "indicator-messages", appindicator.CATEGORY_APPLICATION_STATUS) @@ -107,10 +98,8 @@ class LinuxIndicator(BaseIndicator): class DarwinIndicator(BaseIndicator): def __init__(self, icon, menu): - self.icon_directory = ( - os.path.dirname(os.path.realpath(sys.argv[0])) + os.path.sep + '..' + os.path.sep - + 'share' + os.path.sep + 'icons' + os.path.sep + 'zik' - + os.path.sep) + self.icon_directory = os.path.join( + os.path.dirname(os.path.realpath(sys.argv[0])), '..', 'share', 'icons', 'zik') statusicon = StatusApp.sharedApplication() statusicon.initMenu(menu) super(DarwinIndicator, self).__init__(icon, menu, statusicon) |