From b4ff541fd77d4076051e57b748fc5817e0cc1e25 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Mon, 15 Jun 2015 12:41:30 +0200 Subject: Make into proper package. --- parrot_zik/bluetooth_paired_devices.py | 2 +- parrot_zik/indicator.py | 6 +++--- parrot_zik/parrot_zik_model.py | 4 ++-- parrot_zik/resource_manager.py | 2 +- setup.py | 3 ++- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/parrot_zik/bluetooth_paired_devices.py b/parrot_zik/bluetooth_paired_devices.py index eb1ec09..726731c 100644 --- a/parrot_zik/bluetooth_paired_devices.py +++ b/parrot_zik/bluetooth_paired_devices.py @@ -2,7 +2,7 @@ import sys import re import os -from parrot_zik.resource_manager import GenericResourceManager +from .resource_manager import GenericResourceManager if sys.platform == "darwin": from binplist import binplist diff --git a/parrot_zik/indicator.py b/parrot_zik/indicator.py index e121e92..b6b6bea 100644 --- a/parrot_zik/indicator.py +++ b/parrot_zik/indicator.py @@ -41,7 +41,7 @@ class BaseIndicator(object): class WindowsIndicator(BaseIndicator): def __init__(self, icon, menu): self.icon_directory = os.path.join( - os.path.dirname(os.path.realpath(sys.argv[0])), '..', 'share', 'icons', 'zik') + os.path.dirname(os.path.realpath(sys.argv[0])), 'share', 'icons', 'zik') self.menu_shown = False 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")) @@ -71,7 +71,7 @@ class LinuxIndicator(BaseIndicator): import appindicator self.icon_directory = os.path.join('/', 'usr', 'share', 'icons', 'zik') if not os.path.isdir(self.icon_directory): - self.icon_directory = os.path.join(os.path.dirname(sys.argv[0]), '..', 'share', 'icons', 'zik') + self.icon_directory = os.path.join('share', 'icons', 'zik') statusicon = appindicator.Indicator( "new-parrotzik-indicator", "indicator-messages", appindicator.CATEGORY_APPLICATION_STATUS) @@ -99,7 +99,7 @@ class LinuxIndicator(BaseIndicator): class DarwinIndicator(BaseIndicator): def __init__(self, icon, menu): self.icon_directory = os.path.join( - os.path.dirname(os.path.realpath(sys.argv[0])), '..', 'share', 'icons', 'zik') + 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) diff --git a/parrot_zik/parrot_zik_model.py b/parrot_zik/parrot_zik_model.py index e15200f..e6a8bc7 100644 --- a/parrot_zik/parrot_zik_model.py +++ b/parrot_zik/parrot_zik_model.py @@ -1,5 +1,5 @@ -from parrot_zik.resource_manager import Version1ResourceManager -from parrot_zik.resource_manager import Version2ResourceManager +from .resource_manager import Version1ResourceManager +from .resource_manager import Version2ResourceManager class BatteryStates: diff --git a/parrot_zik/resource_manager.py b/parrot_zik/resource_manager.py index 8b63e8c..8a9cd46 100644 --- a/parrot_zik/resource_manager.py +++ b/parrot_zik/resource_manager.py @@ -4,7 +4,7 @@ import sys from BeautifulSoup import BeautifulSoup -from parrot_zik.message import Message +from .message import Message class ResourceManagerBase(object): diff --git a/setup.py b/setup.py index 51a83e1..de72f13 100644 --- a/setup.py +++ b/setup.py @@ -44,5 +44,6 @@ setup( ], packages=['parrot_zik'], - scripts=["parrot_zik/parrot_zik_tray"] + scripts=["parrot_zik/parrot_zik_tray"], + include_package_data=True, ) -- cgit v1.2.1