diff options
| author | Mario Corchero <mcorcherojim@bloomberg.net> | 2021-07-16 11:06:47 +0200 |
|---|---|---|
| committer | Mario Corchero <mcorcherojim@bloomberg.net> | 2021-07-16 17:08:09 +0200 |
| commit | da9ecd07a257cb5d1c7bfa08459b1ccfcabe6d23 (patch) | |
| tree | 20ce3bac3aaedb3695b299b243544b6284dc0011 /dateutil/parser/__init__.py | |
| parent | b21555f3b6afd2a0c660293b21e19b32f1d4f50e (diff) | |
| download | dateutil-git-da9ecd07a257cb5d1c7bfa08459b1ccfcabe6d23.tar.gz | |
Move to src layout
Move the project to the src layout to ensure we are testing on the
generated package rather than the checked out source tree.
Diffstat (limited to 'dateutil/parser/__init__.py')
| -rw-r--r-- | dateutil/parser/__init__.py | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/dateutil/parser/__init__.py b/dateutil/parser/__init__.py deleted file mode 100644 index d174b0e..0000000 --- a/dateutil/parser/__init__.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*- coding: utf-8 -*- -from ._parser import parse, parser, parserinfo, ParserError -from ._parser import DEFAULTPARSER, DEFAULTTZPARSER -from ._parser import UnknownTimezoneWarning - -from ._parser import __doc__ - -from .isoparser import isoparser, isoparse - -__all__ = ['parse', 'parser', 'parserinfo', - 'isoparse', 'isoparser', - 'ParserError', - 'UnknownTimezoneWarning'] - - -### -# Deprecate portions of the private interface so that downstream code that -# is improperly relying on it is given *some* notice. - - -def __deprecated_private_func(f): - from functools import wraps - import warnings - - msg = ('{name} is a private function and may break without warning, ' - 'it will be moved and or renamed in future versions.') - msg = msg.format(name=f.__name__) - - @wraps(f) - def deprecated_func(*args, **kwargs): - warnings.warn(msg, DeprecationWarning) - return f(*args, **kwargs) - - return deprecated_func - -def __deprecate_private_class(c): - import warnings - - msg = ('{name} is a private class and may break without warning, ' - 'it will be moved and or renamed in future versions.') - msg = msg.format(name=c.__name__) - - class private_class(c): - __doc__ = c.__doc__ - - def __init__(self, *args, **kwargs): - warnings.warn(msg, DeprecationWarning) - super(private_class, self).__init__(*args, **kwargs) - - private_class.__name__ = c.__name__ - - return private_class - - -from ._parser import _timelex, _resultbase -from ._parser import _tzparser, _parsetz - -_timelex = __deprecate_private_class(_timelex) -_tzparser = __deprecate_private_class(_tzparser) -_resultbase = __deprecate_private_class(_resultbase) -_parsetz = __deprecated_private_func(_parsetz) |
