From e7089b04e59ae1cf7a24649ec2ef64af56eb7dce Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Mon, 15 Jun 2015 17:46:22 +0200 Subject: Use absolute package imports. --- parrot_zik/indicator/__init__.py | 25 ++++++++++--------------- parrot_zik/indicator/gtk_wrapping.py | 2 +- parrot_zik/indicator/linux.py | 2 +- parrot_zik/indicator/mac.py | 6 +++--- parrot_zik/indicator/windows.py | 2 +- parrot_zik/interface/base.py | 6 +++--- parrot_zik/interface/version1.py | 8 ++++---- parrot_zik/interface/version2.py | 12 ++++++------ parrot_zik/model/version1.py | 4 ++-- parrot_zik/model/version2.py | 4 ++-- 10 files changed, 33 insertions(+), 38 deletions(-) diff --git a/parrot_zik/indicator/__init__.py b/parrot_zik/indicator/__init__.py index aeda305..4194dde 100644 --- a/parrot_zik/indicator/__init__.py +++ b/parrot_zik/indicator/__init__.py @@ -2,22 +2,17 @@ __all__ = ('SysIndicator', 'Menu', 'MenuItem') import sys -if sys.platform == 'linux2': - import linux - import gtk_wrapping - SysIndicator = linux.LinuxIndicator - Menu = gtk_wrapping.GTKMenu - MenuItem = gtk_wrapping.GTKMenuItem +if sys.platform in ['linux', 'linux2']: + from parrot_zik.indicator.linux import LinuxIndicator as SysIndicator + from parrot_zik.indicator.gtk_wrapping import GTKMenuItem as MenuItem + from parrot_zik.indicator.gtk_wrapping import GTKMenu as Menu elif sys.platform == 'win32': - import gtk_wrapping - import windows - SysIndicator = windows.WindowsIndicator - Menu = gtk_wrapping.GTKMenu - MenuItem = gtk_wrapping.GTKMenuItem + from parrot_zik.indicator.windows import WindowsIndicator as SysIndicator + from parrot_zik.indicator.gtk_wrapping import GTKMenuItem as MenuItem + from parrot_zik.indicator.gtk_wrapping import GTKMenu as Menu elif sys.platform == 'darwin': - import mac - SysIndicator = mac.DarwinIndicator - Menu = mac.NSMenu - MenuItem = mac.NSMenuItem + from parrot_zik.indicator.mac import DarwinIndicator as SysIndicator + from parrot_zik.indicator.mac import NSMenuItem as MenuItem + from parrot_zik.indicator.mac import NSMenu as Menu else: raise Exception('Platform not supported') diff --git a/parrot_zik/indicator/gtk_wrapping.py b/parrot_zik/indicator/gtk_wrapping.py index 9494adc..ce78c1d 100644 --- a/parrot_zik/indicator/gtk_wrapping.py +++ b/parrot_zik/indicator/gtk_wrapping.py @@ -1,6 +1,6 @@ import gtk -from .base import MenuItemBase +from parrot_zik.indicator.base import MenuItemBase class GTKMenu(object): diff --git a/parrot_zik/indicator/linux.py b/parrot_zik/indicator/linux.py index fc0f425..278f781 100644 --- a/parrot_zik/indicator/linux.py +++ b/parrot_zik/indicator/linux.py @@ -2,7 +2,7 @@ import os import gtk -from .base import BaseIndicator +from parrot_zik.indicator.base import BaseIndicator class LinuxIndicator(BaseIndicator): diff --git a/parrot_zik/indicator/mac.py b/parrot_zik/indicator/mac.py index 232e010..ceeacb0 100644 --- a/parrot_zik/indicator/mac.py +++ b/parrot_zik/indicator/mac.py @@ -5,9 +5,9 @@ from Foundation import * from AppKit import * from PyObjCTools import AppHelper -from .base import BaseIndicator -from .base import MenuItemBase -from ..status_app_mac import StatusApp +from parrot_zik.indicator.base import BaseIndicator +from parrot_zik.indicator.base import MenuItemBase +from parrot_zik.status_app_mac import StatusApp class DarwinIndicator(BaseIndicator): diff --git a/parrot_zik/indicator/windows.py b/parrot_zik/indicator/windows.py index 79a4ef3..f10c91a 100644 --- a/parrot_zik/indicator/windows.py +++ b/parrot_zik/indicator/windows.py @@ -3,7 +3,7 @@ import tempfile import gtk import os -from .base import BaseIndicator +from parrot_zik.indicator.base import BaseIndicator class WindowsIndicator(BaseIndicator): diff --git a/parrot_zik/interface/base.py b/parrot_zik/interface/base.py index 1611874..225e53f 100644 --- a/parrot_zik/interface/base.py +++ b/parrot_zik/interface/base.py @@ -1,6 +1,6 @@ -from .. import resource_manager -from ..indicator import MenuItem -from ..model.base import BatteryStates +from parrot_zik import resource_manager +from parrot_zik.indicator import MenuItem +from parrot_zik.model.base import BatteryStates RECONNECT_FREQUENCY = 5000 diff --git a/parrot_zik/interface/version1.py b/parrot_zik/interface/version1.py index 1af71ec..6ddd1b5 100644 --- a/parrot_zik/interface/version1.py +++ b/parrot_zik/interface/version1.py @@ -1,7 +1,7 @@ -from .. import resource_manager -from ..indicator import MenuItem -from ..interface.base import ParrotZikBaseInterface -from ..model.version1 import ParrotZikVersion1 +from parrot_zik import resource_manager +from parrot_zik.indicator import MenuItem +from parrot_zik.interface.base import ParrotZikBaseInterface +from parrot_zik.model.version1 import ParrotZikVersion1 class ParrotZikVersion1Interface(ParrotZikBaseInterface): diff --git a/parrot_zik/interface/version2.py b/parrot_zik/interface/version2.py index c348bb4..74fdcc9 100644 --- a/parrot_zik/interface/version2.py +++ b/parrot_zik/interface/version2.py @@ -1,11 +1,11 @@ import functools -from .. import resource_manager -from ..indicator import MenuItem, Menu -from .base import ParrotZikBaseInterface -from ..model.version2 import ParrotZikVersion2 -from ..model.version2 import NoiseControlTypes -from ..model.version2 import Rooms +from parrot_zik import resource_manager +from parrot_zik.indicator import MenuItem, Menu +from parrot_zik.interface.base import ParrotZikBaseInterface +from parrot_zik.model.version2 import ParrotZikVersion2 +from parrot_zik.model.version2 import NoiseControlTypes +from parrot_zik.model.version2 import Rooms class ParrotZikVersion2Interface(ParrotZikBaseInterface): diff --git a/parrot_zik/model/version1.py b/parrot_zik/model/version1.py index b39684f..f0197e9 100644 --- a/parrot_zik/model/version1.py +++ b/parrot_zik/model/version1.py @@ -1,5 +1,5 @@ -from .base import ParrotZikBase -from ..resource_manager import Version1ResourceManager +from parrot_zik.model.base import ParrotZikBase +from parrot_zik.resource_manager import Version1ResourceManager class ParrotZikVersion1(ParrotZikBase): diff --git a/parrot_zik/model/version2.py b/parrot_zik/model/version2.py index d90d79d..11b4d51 100644 --- a/parrot_zik/model/version2.py +++ b/parrot_zik/model/version2.py @@ -1,5 +1,5 @@ -from .base import ParrotZikBase -from ..resource_manager import Version2ResourceManager +from parrot_zik.model.base import ParrotZikBase +from parrot_zik.resource_manager import Version2ResourceManager class ParrotZikVersion2(ParrotZikBase): -- cgit v1.2.1