From: Frank Brehm Date: Fri, 7 Jul 2017 12:59:32 +0000 (+0200) Subject: Merge branch 'master' into develop X-Git-Tag: 0.1.2~172 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=fa501efd8d6ec9125230a2621afb03454d192c1e;p=pixelpark%2Fadmin-tools.git Merge branch 'master' into develop Conflicts: pp_lib/mk_home_app.py --- fa501efd8d6ec9125230a2621afb03454d192c1e diff --cc pp_lib/ldap_app.py index fc3b4c5,91c655d..90961ef --- a/pp_lib/ldap_app.py +++ b/pp_lib/ldap_app.py @@@ -24,8 -31,16 +24,10 @@@ from ldap3 import SUBTRE from ldap3.core.exceptions import LDAPPasswordIsMandatoryError + from ldap3.utils.log import set_library_log_detail_level, ERROR, BASIC, PROTOCOL, NETWORK, EXTENDED + # Own modules -from .global_version import __version__ as __global_version__ - -from .errors import FunctionNotImplementedError, PpAppError - -from .common import pp, terminal_can_colors, to_bytes, to_bool - -from .merge import merge_structure +from .common import pp, to_bool from .cfg_app import PpCfgAppError, PpConfigApplication diff --cc pp_lib/mk_home_app.py index 1956928,8b4a60f..4cac7bd --- a/pp_lib/mk_home_app.py +++ b/pp_lib/mk_home_app.py @@@ -27,7 -40,7 +27,7 @@@ from .common import p from .ldap_app import PpLdapAppError, PpLdapApplication - __version__ = '0.4.5' -__version__ = '0.4.6' ++__version__ = '0.4.7' LOG = logging.getLogger(__name__) diff --cc pp_lib/quota_check.py index d01d2ed,00a6ee9..0726203 --- a/pp_lib/quota_check.py +++ b/pp_lib/quota_check.py @@@ -31,13 -34,34 +31,30 @@@ import si import yaml # Own modules -from .global_version import __version__ as __global_version__ +from .common import pp, to_str -from .errors import FunctionNotImplementedError, PpAppError +from .homes_admin import PpHomesAdminError, PpHomesAdminApp -from .common import pp, terminal_can_colors, to_bytes, to_bool, to_str - -from .cfg_app import PpCfgAppError, PpConfigApplication - -__version__ = '0.5.4' +__version__ = '0.6.2' LOG = logging.getLogger(__name__) - UTC = datetime.timezone.utc + ZERO = datetime.timedelta(0) + + # A Utc class. + + class Utc(datetime.tzinfo): + """Utc""" + + def utcoffset(self, dt): + return ZERO + + def tzname(self, dt): + return "UTC" + + def dst(self, dt): + return ZERO + + UTC = Utc() + # UTC = datetime.timezone.utc # ============================================================================= @@@ -369,12 -396,9 +386,13 @@@ class PpQuotaCheckApp(PpHomesAdminApp) LOG.info("Writing status data from {!r} ...".format(self.statusfile)) if self.verbose > 2: + # LOG.debug("Status to write:\n{!r}".format(self.status_data)) LOG.debug("Status to write:\n{}".format(pp(self.status_data))) + if self.simulate: + LOG.info("Simulation mode, status file will not be really written.") + return + open_args = {} if six.PY3: open_args['encoding'] = 'utf-8'