core: add hpi query command (#157)

- restructure query code for cli, some test fixes
- initial query_range implementation

    refactored functions in query some more
    to allow re-use in range_range, select()
    pretty much just calls out to a bunch
    of handlers now
This commit is contained in:
Sean Breckenridge 2021-04-06 09:19:58 -07:00 committed by GitHub
parent b94120deaf
commit fb49243005
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 902 additions and 134 deletions

View file

@ -2,6 +2,8 @@
Some backwards compatibility stuff/deprecation helpers
'''
from types import ModuleType
from typing import Callable
from datetime import datetime
from . import warnings
from .common import LazyLogger
@ -10,6 +12,16 @@ from .common import LazyLogger
logger = LazyLogger('my.core.compat')
fromisoformat: Callable[[str], datetime]
import sys
if sys.version_info[:2] >= (3, 7):
# prevent mypy on py3.6 from complaining...
fromisoformat_real = datetime.fromisoformat
fromisoformat = fromisoformat_real
else:
from .py37 import fromisoformat
def pre_pip_dal_handler(
name: str,
e: ModuleNotFoundError,