Coverage for pychlv / __init__.py: 100%
23 statements
« prev ^ index » next coverage.py v7.14.0, created at 2026-07-17 14:31 -0400
« prev ^ index » next coverage.py v7.14.0, created at 2026-07-17 14:31 -0400
2# -*- coding: utf-8 -*-
4u'''A pure Python implementation of the U{SwissTopo<https://www.SwissTopo.admin.CH/en/
5the-swiss-coordinates-system>} I{LandesVermessung 1995 (LV95)} and I{-1903 (LV03)}
6local projections and conversions from and to I{WGS84 or Bessel1841 geodetic} lat-,
7longitude and height.
8'''
9import os.path as os_path
10import sys
12# _isfrozen = getattr(_sys, 'frozen', False)
13pychlv_abspath = os_path.dirname(os_path.abspath(__file__)) # _sys._MEIPASS + '/pychlv'
14_pychlv_ = __package__ or os_path.basename(pychlv_abspath)
16# setting __path__ should ...
17__path__ = [pychlv_abspath]
18try: # ... make this import work, ...
19 import pychlv.__pygeodesy as _ # noqa: F401
20except ImportError: # ... if it doesn't, extend sys.path to include
21 # this very directory such that all public and private sub-modules
22 # can be imported (by epydoc, checked by PyChecker, etc.)
23 if pychlv_abspath not in sys.path:
24 sys.path.insert(0, pychlv_abspath) # XXX __path__[0]
26try: # PYCHOK pygeodesy
27 from pychlv.__pygeodesy import * # noqa: F403
28except (AttributeError, ImportError) as x:
29 raise AssertionError(str(x))
31from pychlv.chlvs import * # noqa: F403
32from pychlv.chlvTuples import * # noqa: F403
35def _all__init__(*names): # deleted below
36 from pychlv.__pygeodesy import _all__all__ # PYCHOK ...
37 _all__all__.extend(names)
38 _all__all__[:] = sorted(_all__all__) # set(_all__all__)
39 return _all__all__
42def _versions(): # in .__main__, .v_self, .test/bases
43 # Get the pychlv, pygeodesy, Python ... versions (C{str}).
44 from pychlv.__pygeodesy import _SPACE_, _versions as _pygeodesy_versions # PYCHOK ...
45 v = __version__.replace('.0', '.')
46 l_ = [_pychlv_, v] + _pygeodesy_versions(None)
47 return _SPACE_.join(l_) # PYCHOK shadows?
50__all__ = _all__init__('pychlv_abspath')
51__version__ = '26.07.17'
52# del _all__init__
54# **) MIT License
55#
56# Copyright (C) 2026-2026 -- mrJean1 at Gmail -- All Rights Reserved.
57#
58# Permission is hereby granted, free of charge, to any person obtaining a
59# copy of this software and associated documentation files (the "Software"),
60# to deal in the Software without restriction, including without limitation
61# the rights to use, copy, modify, merge, publish, distribute, sublicense,
62# and/or sell copies of the Software, and to permit persons to whom the
63# Software is furnished to do so, subject to the following conditions:
64#
65# The above copyright notice and this permission notice shall be included
66# in all copies or substantial portions of the Software.
67#
68# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
69# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
71# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
72# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
73# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
74# OTHER DEALINGS IN THE SOFTWARE.