Skip to content

Commit

Permalink
Moved NocaseDict and internal utility functions into their own submod…
Browse files Browse the repository at this point in the history
…ules

Details:
- For general cleanup, moved class `NocaseDict` into its own submodule
  `_nocasedict.py`. Its unit test cases already had been in a separate
  sub module (`test_nocasedict.py`).
- In order to untangle existing circular import dependencies, as well as
  new ones that were created by the move of NocaseDict, moved the following
  utility functions into a new submodule `_utils.py`:
  - `_stacklevel_above_module()`
  - `_ensure_unicode()`
  - `_ensure_bytes()`
  - `_ensure_bool()`
  - `_hash_name()`
  - `_hash_item()`
  - `_hash_dict()`
- Adjusted any code that imports the moved symbols, to now import them from
  their new submodules. As part of that, several runtime-imports could
  be moved back to become module-level imports.
- Adjusted the documentatzion for the new module structure. This did not
  result in any changes to the generated documentation.

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
  • Loading branch information
andy-maier committed Apr 15, 2018
1 parent 1438d5c commit 6fc3e89
Show file tree
Hide file tree
Showing 24 changed files with 661 additions and 574 deletions.
4 changes: 4 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ Released: not yet

**Enhancements:**

**Cleanup**

* Moved class `NocaseDict` into its own module (Issue #848).

**Known issues:**

* See `list of open issues`_.
Expand Down
7 changes: 7 additions & 0 deletions docs/client/objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ CIM objects

.. automodule:: pywbem.cim_obj

.. _`NocaseDict`:

NocaseDict
^^^^^^^^^^

.. automodule:: pywbem._nocasedict

CIMInstanceName
^^^^^^^^^^^^^^^

Expand Down
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ doc_dependent_files := \
$(package_name)/_subscription_manager.py \
$(package_name)/_valuemapping.py \
$(package_name)/_version.py \
$(package_name)/_nocasedict.py \
$(package_name)/cim_constants.py \
$(package_name)/cim_http.py \
$(package_name)/cim_obj.py \
Expand Down
2 changes: 2 additions & 0 deletions pywbem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
import sys
import logging

from ._utils import * # noqa: F403,F401
from .cim_types import * # noqa: F403,F401
from .cim_constants import * # noqa: F403,F401
from .cim_operations import * # noqa: F403,F401
from ._nocasedict import * # noqa: F403,F401
from .cim_obj import * # noqa: F403,F401
from .tupleparse import * # noqa: F403,F401
from .cim_http import * # noqa: F403,F401
Expand Down

0 comments on commit 6fc3e89

Please sign in to comment.