diff options
author | Michal Minar <miminar@redhat.com> | 2013-07-30 14:24:49 +0200 |
---|---|---|
committer | Michal Minar <miminar@redhat.com> | 2013-07-30 15:23:35 +0200 |
commit | 2a2bc8a4e9498024c8a85ce2813e7d0f9c5677a0 (patch) | |
tree | 1eaab563e14fd7f11880b540417eb2a879536bb8 /src | |
parent | 3026b7f6476743d862e6caa7816c56017108ee6d (diff) | |
download | openlmi-providers-2a2bc8a4e9498024c8a85ce2813e7d0f9c5677a0.tar.gz openlmi-providers-2a2bc8a4e9498024c8a85ce2813e7d0f9c5677a0.tar.xz openlmi-providers-2a2bc8a4e9498024c8a85ce2813e7d0f9c5677a0.zip |
openlmi-python: split python package
Split the openlmi-python package to 2:
* openlmi-python-base
- lmi namespace
- functionality for any OpenLMI related python code
- contains packages 'lmi' and 'lmi.base'
* openlmi-python-providers
- common functionality for OpenLMI providers
- contains 'lmi.providers'
Diffstat (limited to 'src')
-rw-r--r-- | src/python/lmi/base/BaseConfiguration.py (renamed from src/python/lmi/common/BaseConfiguration.py) | 3 | ||||
-rw-r--r-- | src/python/lmi/base/__init__.py | 24 | ||||
-rw-r--r-- | src/python/lmi/base/singletonmixin.py (renamed from src/python/lmi/common/singletonmixin.py) | 0 | ||||
-rw-r--r-- | src/python/lmi/providers/IndicationManager.py (renamed from src/python/lmi/common/IndicationManager.py) | 4 | ||||
-rw-r--r-- | src/python/lmi/providers/JobManager.py (renamed from src/python/lmi/common/JobManager.py) | 8 | ||||
-rw-r--r-- | src/python/lmi/providers/TimerManager.py (renamed from src/python/lmi/common/TimerManager.py) | 5 | ||||
-rw-r--r-- | src/python/lmi/providers/__init__.py (renamed from src/python/lmi/common/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/lmi/providers/cmpi_logging.py (renamed from src/python/lmi/common/cmpi_logging.py) | 0 | ||||
-rw-r--r-- | src/python/setup.py | 4 |
9 files changed, 37 insertions, 11 deletions
diff --git a/src/python/lmi/common/BaseConfiguration.py b/src/python/lmi/base/BaseConfiguration.py index f54de03..8790acf 100644 --- a/src/python/lmi/common/BaseConfiguration.py +++ b/src/python/lmi/base/BaseConfiguration.py @@ -32,7 +32,8 @@ import ConfigParser import logging import os import socket -from lmi.common.singletonmixin import Singleton + +from lmi.base.singletonmixin import Singleton def convert_value(section, option, convert_func, value): """ diff --git a/src/python/lmi/base/__init__.py b/src/python/lmi/base/__init__.py new file mode 100644 index 0000000..c3b443f --- /dev/null +++ b/src/python/lmi/base/__init__.py @@ -0,0 +1,24 @@ +# Software Management Providers +# +# Copyright (C) 2012-2013 Red Hat, Inc. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Authors: Michal Minar <miminar@redhat.com> +# + +""" +Common utilities for OpenLMI python projects. +""" diff --git a/src/python/lmi/common/singletonmixin.py b/src/python/lmi/base/singletonmixin.py index c252676..c252676 100644 --- a/src/python/lmi/common/singletonmixin.py +++ b/src/python/lmi/base/singletonmixin.py diff --git a/src/python/lmi/common/IndicationManager.py b/src/python/lmi/providers/IndicationManager.py index 0467227..0b0e132 100644 --- a/src/python/lmi/common/IndicationManager.py +++ b/src/python/lmi/providers/IndicationManager.py @@ -28,8 +28,8 @@ import re import socket import threading -import lmi.common.cmpi_logging as cmpi_logging -from lmi.common import singletonmixin +from lmi.base import singletonmixin +from lmi.providers import cmpi_logging RE_FILTER_NAME = re.compile(r'^(?P<prefix>lmi:' r'(?P<class_name>[a-z0-9_]+):)(?P<filter_id>.*)$', re.IGNORECASE) diff --git a/src/python/lmi/common/JobManager.py b/src/python/lmi/providers/JobManager.py index 5ee59a9..24c909c 100644 --- a/src/python/lmi/common/JobManager.py +++ b/src/python/lmi/providers/JobManager.py @@ -46,13 +46,13 @@ from datetime import datetime, timedelta import threading from Queue import Queue import pywbem -import lmi.common.cmpi_logging as cmpi_logging -import lmi.common -from lmi.common.IndicationManager import IndicationManager from pywbem.cim_provider2 import CIMProvider2 import socket import traceback +from lmi.providers import cmpi_logging, parse_instance_id +from lmi.providers.IndicationManager import IndicationManager + @cmpi_logging.trace_function def register_filters(job_clsname, indication_manager=None): """ @@ -862,7 +862,7 @@ class JobManager(object): """ if classname is None: classname = self.job_classname - the_id = lmi.common.parse_instance_id(instance_id, classname) + the_id = parse_instance_id(instance_id, classname) if not the_id.isdigit(): return None return self.jobs.get(the_id, None) diff --git a/src/python/lmi/common/TimerManager.py b/src/python/lmi/providers/TimerManager.py index 01e53b8..76b2f5b 100644 --- a/src/python/lmi/common/TimerManager.py +++ b/src/python/lmi/providers/TimerManager.py @@ -50,10 +50,11 @@ it may be already being scheduled / called. """ import ctypes -import lmi.common.singletonmixin as singletonmixin import threading import Queue -import lmi.common.cmpi_logging as cmpi_logging + +from lmi.base import singletonmixin +from lmi.providers import cmpi_logging class TimerException(Exception): pass diff --git a/src/python/lmi/common/__init__.py b/src/python/lmi/providers/__init__.py index baebcdb..baebcdb 100644 --- a/src/python/lmi/common/__init__.py +++ b/src/python/lmi/providers/__init__.py diff --git a/src/python/lmi/common/cmpi_logging.py b/src/python/lmi/providers/cmpi_logging.py index a97e4ab..a97e4ab 100644 --- a/src/python/lmi/common/cmpi_logging.py +++ b/src/python/lmi/providers/cmpi_logging.py diff --git a/src/python/setup.py b/src/python/setup.py index b36d455..89c7461 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -5,9 +5,9 @@ setup( author='Michal Minar', author_email='miminar@redhat.com', url='https://fedorahosted.org/openlmi/', - version='0.3', + version='0.4', namespace_packages = ['lmi'], - packages = ['lmi', 'lmi.common'], + packages = ['lmi', 'lmi.base', 'lmi.providers'], classifiers=[ 'license :: osi approved :: gnu lesser general public license v2 or later (lgplv2+)', 'operating system :: posix :: linux', |