#!/bin/env python3
# -*- coding: utf-8 -*-
+"""
+@summary: The init module for the DPX admin-tools package.
+
+@author: Frank Brehm
+@contact: frank.brehm@pixelpark.com
+@copyright: © 2023 by Frank Brehm, Berlin
+"""
from __future__ import absolute_import
# Standard modules
# Own modules
import fb_tools.common
-__version__ = '0.8.7'
+__version__ = '0.8.8'
MAX_PORT_NUMBER = (2 ** 16) - 1
DEFAULT_CONFIG_DIR = 'pixelpark'
@return: pretty print string
@rtype: str
"""
-
if not width:
term_size = shutil.get_terminal_size((DEFAULT_TERMINAL_WIDTH, DEFAULT_TERMINAL_HEIGHT))
width = term_size.columns
# import copy
import logging
import re
-import time
import sys
+import time
from functools import cmp_to_key
from pathlib import Path
from .ldap import BaseLdapApplication
from ..xlate import XLATOR
-__version__ = '0.9.2'
+__version__ = '0.9.3'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
+@summary: module for some common used error classes.
+
@author: Frank Brehm
-@summary: module for some common used error classes
"""
# own modules
-from fb_tools.errors import FbError, FbAppError
+from fb_tools.errors import FbAppError, FbError
-__version__ = '0.6.0'
+__version__ = '0.6.1'
# =============================================================================
class PpError(FbError):
- """
- Base error class for all other self defined exceptions.
- """
+ """Base error class for all other self defined exceptions."""
pass
# =============================================================================
class PpAppError(FbAppError):
+ """Base error class for all self defined exceptions in applications."""
pass
# =============================================================================
-if __name__ == "__main__":
+if __name__ == '__main__':
pass
# =============================================================================
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
+@summary: A module for functions to merge different data structures.
+
@author: Frank Brehm
@contact: frank.brehm@pixelpark.com
"""
import itertools
-__version__ = '0.2.0'
+__version__ = '0.2.1'
# =============================================================================
class ZipExhausted(Exception):
+ """A special exception class to be used in izip_longest() on a counter overflow."""
+
pass
# =============================================================================
def izip_longest(*args, **kwds):
- '''
+ """
+ Print the values of iterables alternatively in sequence.
+
+ If one of the iterables is printed fully, the remaining values are filled
+ by the values assigned to fillvalue parameter.
+
Function izip_longest() does not exists anymore in Python3 itertools.
Taken from https://docs.python.org/2/library/itertools.html#itertools.izip_longest
- '''
+ """
# izip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D-
fillvalue = kwds.get('fillvalue')
# =============================================================================
def merge_structure(a, b):
- '''
+ """
+ Merge the given structures in a deep manner.
+
Taken from https://gist.github.com/saurabh-hirani/6f3f5d119076df70e0da
- '''
+ """
if isinstance(a, dict) and isinstance(b, dict):
d = dict(a)
d.update({k: merge_structure(a.get(k, None), b[k]) for k in b})
# =============================================================================
-if __name__ == "__main__":
+if __name__ == '__main__':
pass
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
+@summary: The module for i18n.
+
+It provides translation object, usable from all other modules in this package.
+
@author: Frank Brehm
@contact: frank@brehm-online.com
@copyright: © 2023 by Frank Brehm, Berlin
-@summary: The module for i18n.
- It provides translation object, usable from all other
- modules in this package.
"""
from __future__ import absolute_import, print_function
# Standard modules
-import logging
-import gettext
import copy
-
+import gettext
+import logging
try:
from pathlib import Path
except ImportError:
from pathlib2 import Path
-
from distutils.version import LooseVersion
# Third party modules
LOG = logging.getLogger(__name__)
-__version__ = '0.1.0'
+__version__ = '0.1.1'
__me__ = Path(__file__).resolve()
__module_dir__ = __me__.parent
def format_list(lst, do_repr=False, style='standard', locale=DEFAULT_LOCALE):
"""
Format the items in `lst` as a list.
+
:param lst: a sequence of items to format in to a list
:param locale: the locale
"""
# =============================================================================
-if __name__ == "__main__":
+if __name__ == '__main__':
- print(_("Module directory: {!r}").format(__module_dir__))
- print(_("Base directory: {!r}").format(__base_dir__))
- print(_("Locale directory: {!r}").format(LOCALE_DIR))
- print(_("Locale domain: {!r}").format(DOMAIN))
- print(_("Found .mo-file: {!r}").format(__mo_file__))
+ print(_('Module directory: {!r}').format(__module_dir__))
+ print(_('Base directory: {!r}').format(__base_dir__))
+ print(_('Locale directory: {!r}').format(LOCALE_DIR))
+ print(_('Locale domain: {!r}').format(DOMAIN))
+ print(_('Found .mo-file: {!r}').format(__mo_file__))
# =============================================================================