Ejemplo n.º 1
0
# setting __path__ should make ...
__path__ = [pygeodesy_abspath]
try:  # ... this import work, ...
    import bases as _  # PYCHOK expected
    del _
except ImportError:  # ... if it doesn't, extend
    # sys.path to include this very directory such
    # that all public and private sub-modules can
    # be imported (and checked by PyChecker, etc.)
    import sys
    sys.path.insert(0, pygeodesy_abspath)  # XXX __path__[0]
    del sys

try:  # lazily requires Python 3.7+, see lazily.__doc__
    from lazily import _lazy_import2, LazyImportError
    _, __getattr__ = _lazy_import2('pygeodesy')
except (LazyImportError, NotImplementedError):

    # keep ellipsoidal, spherical and vector modules as sub-modules
    import ellipsoidalKarney  # PYCHOK false
    import ellipsoidalNvector  # PYCHOK false
    import ellipsoidalVincenty  # PYCHOK false
    import geohash
    import nvector  # PYCHOK false
    import sphericalNvector  # PYCHOK false
    import sphericalTrigonometry  # PYCHOK false
    import vector3d  # PYCHOK false

    CrossError = vector3d.CrossError
    crosserrors = vector3d.crosserrors
    Geohash = geohash.Geohash
Ejemplo n.º 2
0
    _lazy_import2 = None
else:
    # setting __path__ should ...
    __path__ = [pygeodesy_abspath]
    try:  # ... make this import work, ...
        import bases as _
    except ImportError:  # ... if it doesn't, extend
        # sys.path to include this very directory such
        # that all public and private sub-modules can
        # be imported (and checked by PyChecker, etc.)
        sys.path.insert(0, pygeodesy_abspath)  # XXX __path__[0]

    try:
        # lazily requires Python 3.7+, see lazily.__doc__
        from lazily import LazyImportError, _lazy_import2
        _, __getattr__ = _lazy_import2(_pygeodesy)  # PYCHOK expected

    except (ImportError, LazyImportError, NotImplementedError):
        _lazy_import2 = None

if not _lazy_import2:  # import and set __all__

    # keep ellipsoidal, epsg, gars, geohash,
    # spherical, vector and wgrs as modules
    import ellipsoidalKarney  # PYCHOK false
    import ellipsoidalNvector  # PYCHOK false
    import ellipsoidalVincenty  # PYCHOK false
    import epsg
    import gars
    import geohash
    import nvector  # PYCHOK false