|
8 | 8 |
|
9 | 9 | from __future__ import annotations |
10 | 10 |
|
11 | | -__all__ = [ |
12 | | - "__version__" |
13 | | - |
14 | | -] |
| 11 | +import logging |
15 | 12 |
|
| 13 | +from .__main__ import main |
16 | 14 | from .__version__ import __version__ |
17 | | -from ._doctest_runner import _test |
| 15 | +from ._doctest_runner import _replace_remote_url |
| 16 | +from .classes import Field, ShapeRecord, ShapeRecords, Shapes |
| 17 | +from .constants import ( |
| 18 | + FIRST_RING, |
| 19 | + INNER_RING, |
| 20 | + MISSING, |
| 21 | + MULTIPATCH, |
| 22 | + MULTIPOINT, |
| 23 | + MULTIPOINTM, |
| 24 | + MULTIPOINTZ, |
| 25 | + NODATA, |
| 26 | + NULL, |
| 27 | + OUTER_RING, |
| 28 | + PARTTYPE_LOOKUP, |
| 29 | + POINT, |
| 30 | + POINTM, |
| 31 | + POINTZ, |
| 32 | + POLYGON, |
| 33 | + POLYGONM, |
| 34 | + POLYGONZ, |
| 35 | + POLYLINE, |
| 36 | + POLYLINEM, |
| 37 | + POLYLINEZ, |
| 38 | + REPLACE_REMOTE_URLS_WITH_LOCALHOST, |
| 39 | + RING, |
| 40 | + SHAPETYPE_LOOKUP, |
| 41 | + SHAPETYPENUM_LOOKUP, |
| 42 | + TRIANGLE_FAN, |
| 43 | + TRIANGLE_STRIP, |
| 44 | +) |
| 45 | +from .exceptions import GeoJSON_Error, RingSamplingError, ShapefileException |
| 46 | +from .geometric_calculations import bbox_overlap |
| 47 | +from .helpers import _Array, fsdecode_if_pathlike |
| 48 | +from .reader import Reader |
| 49 | +from .shapes import ( |
| 50 | + SHAPE_CLASS_FROM_SHAPETYPE, |
| 51 | + MultiPatch, |
| 52 | + MultiPoint, |
| 53 | + MultiPointM, |
| 54 | + MultiPointZ, |
| 55 | + NullShape, |
| 56 | + Point, |
| 57 | + PointM, |
| 58 | + PointM_shapeTypes, |
| 59 | + PointZ, |
| 60 | + PointZ_shapeTypes, |
| 61 | + Polygon, |
| 62 | + PolygonM, |
| 63 | + PolygonZ, |
| 64 | + Polyline, |
| 65 | + PolylineM, |
| 66 | + PolylineZ, |
| 67 | + Shape, |
| 68 | + _CanHaveBBox_shapeTypes, |
| 69 | + _HasM, |
| 70 | + _HasM_shapeTypes, |
| 71 | + _HasZ, |
| 72 | + _HasZ_shapeTypes, |
| 73 | +) |
| 74 | +from .types import ( |
| 75 | + FIELD_TYPE_ALIASES, |
| 76 | + BBox, |
| 77 | + BinaryFileStreamT, |
| 78 | + BinaryFileT, |
| 79 | + Coord, |
| 80 | + Coords, |
| 81 | + FieldType, |
| 82 | + FieldTypeT, |
| 83 | + MBox, |
| 84 | + Point2D, |
| 85 | + Point3D, |
| 86 | + PointMT, |
| 87 | + PointsT, |
| 88 | + PointT, |
| 89 | + PointZT, |
| 90 | + ReadableBinStream, |
| 91 | + ReadSeekableBinStream, |
| 92 | + ReadWriteSeekableBinStream, |
| 93 | + RecordValue, |
| 94 | + RecordValueNotDate, |
| 95 | + WriteableBinStream, |
| 96 | + WriteSeekableBinStream, |
| 97 | + ZBox, |
| 98 | +) |
| 99 | +from .writer import Writer |
18 | 100 |
|
19 | | -import logging |
20 | | -import sys |
21 | | -# import io |
22 | | -# import os |
23 | | -# import tempfile |
24 | | -# import time |
25 | | -# import zipfile |
26 | | -# from collections.abc import Container, Iterable, Iterator, Reversible, Sequence |
27 | | -# from datetime import date |
28 | | -# from os import PathLike |
29 | | -# from struct import Struct, calcsize, error, pack, unpack |
30 | | -# from types import TracebackType |
31 | | -# from typing import ( |
32 | | -# IO, |
33 | | -# Any, |
34 | | -# Final, |
35 | | -# Generic, |
36 | | -# Literal, |
37 | | -# NamedTuple, |
38 | | -# NoReturn, |
39 | | -# Optional, |
40 | | -# Protocol, |
41 | | -# SupportsIndex, |
42 | | -# TypedDict, |
43 | | -# TypeVar, |
44 | | -# Union, |
45 | | -# cast, |
46 | | -# overload, |
47 | | -# ) |
| 101 | +__all__ = [ |
| 102 | + "__version__", |
| 103 | + "NULL", |
| 104 | + "POINT", |
| 105 | + "POLYLINE", |
| 106 | + "POLYGON", |
| 107 | + "MULTIPOINT", |
| 108 | + "POINTZ", |
| 109 | + "POLYLINEZ", |
| 110 | + "POLYGONZ", |
| 111 | + "MULTIPOINTZ", |
| 112 | + "POINTM", |
| 113 | + "POLYLINEM", |
| 114 | + "POLYGONM", |
| 115 | + "MULTIPOINTM", |
| 116 | + "MULTIPATCH", |
| 117 | + "SHAPETYPE_LOOKUP", |
| 118 | + "REPLACE_REMOTE_URLS_WITH_LOCALHOST", |
| 119 | + "SHAPETYPENUM_LOOKUP", |
| 120 | + "TRIANGLE_STRIP", |
| 121 | + "TRIANGLE_FAN", |
| 122 | + "OUTER_RING", |
| 123 | + "INNER_RING", |
| 124 | + "FIRST_RING", |
| 125 | + "RING", |
| 126 | + "PARTTYPE_LOOKUP", |
| 127 | + "MISSING", |
| 128 | + "NODATA", |
| 129 | + "Reader", |
| 130 | + "Writer", |
| 131 | + "fsdecode_if_pathlike", |
| 132 | + "_Array", |
| 133 | + "Shape", |
| 134 | + "NullShape", |
| 135 | + "Point", |
| 136 | + "Polyline", |
| 137 | + "Polygon", |
| 138 | + "MultiPoint", |
| 139 | + "MultiPointM", |
| 140 | + "MultiPointZ", |
| 141 | + "PolygonM", |
| 142 | + "PolygonZ", |
| 143 | + "PolylineM", |
| 144 | + "PolylineZ", |
| 145 | + "MultiPatch", |
| 146 | + "PointM", |
| 147 | + "PointZ", |
| 148 | + "SHAPE_CLASS_FROM_SHAPETYPE", |
| 149 | + "PointM_shapeTypes", |
| 150 | + "PointZ_shapeTypes", |
| 151 | + "_CanHaveBBox_shapeTypes", |
| 152 | + "_HasM", |
| 153 | + "_HasM_shapeTypes", |
| 154 | + "_HasZ", |
| 155 | + "_HasZ_shapeTypes", |
| 156 | + "Point2D", |
| 157 | + "Point3D", |
| 158 | + "PointMT", |
| 159 | + "PointZT", |
| 160 | + "Coord", |
| 161 | + "Coords", |
| 162 | + "PointT", |
| 163 | + "PointsT", |
| 164 | + "BBox", |
| 165 | + "MBox", |
| 166 | + "ZBox", |
| 167 | + "WriteableBinStream", |
| 168 | + "ReadableBinStream", |
| 169 | + "WriteSeekableBinStream", |
| 170 | + "ReadSeekableBinStream", |
| 171 | + "ReadWriteSeekableBinStream", |
| 172 | + "BinaryFileT", |
| 173 | + "BinaryFileStreamT", |
| 174 | + "FieldTypeT", |
| 175 | + "FieldType", |
| 176 | + "FIELD_TYPE_ALIASES", |
| 177 | + "RecordValueNotDate", |
| 178 | + "RecordValue", |
| 179 | + "ShapefileException", |
| 180 | + "RingSamplingError", |
| 181 | + "GeoJSON_Error", |
| 182 | + "Field", |
| 183 | + "Shapes", |
| 184 | + "ShapeRecord", |
| 185 | + "ShapeRecords", |
| 186 | + "bbox_overlap", |
| 187 | + "main", |
| 188 | + "_replace_remote_url", |
| 189 | +] |
48 | 190 |
|
49 | | -# Create named logger |
50 | 191 | logger = logging.getLogger(__name__) |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | -def main() -> None: |
65 | | - """ |
66 | | - Doctests are contained in the file 'README.md', and are tested using the built-in |
67 | | - testing libraries. |
68 | | - """ |
69 | | - failure_count = _test() |
70 | | - sys.exit(failure_count) |
71 | | - |
72 | | - |
73 | | -if __name__ == "__main__": |
74 | | - main() |
|
0 commit comments