Skip to content

Commit

Permalink
Merge pull request #182 from cleder/typing
Browse files Browse the repository at this point in the history
Typing
  • Loading branch information
cleder authored Oct 12, 2022
2 parents c9a0481 + cfd9935 commit 2a043bb
Show file tree
Hide file tree
Showing 10 changed files with 1,186 additions and 1,081 deletions.
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ repos:
- id: pretty-format-json
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/ikamensh/flynt/
rev: "0.76"
hooks:
- id: flynt
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
- repo: https://github.com/hakancelikdev/unimport
rev: 0.12.1
hooks:
- id: unimport
args: [--remove, --include-star-import, --ignore-init, --gitignore]
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
Expand Down
46 changes: 24 additions & 22 deletions fastkml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2012 Christian Ledermann
# Copyright (C) 2012 -2022 Christian Ledermann
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
Expand Down Expand Up @@ -27,27 +27,28 @@
from pkg_resources import DistributionNotFound
from pkg_resources import get_distribution

from .atom import Author
from .atom import Contributor
from .atom import Link
from .kml import KML
from .kml import Data
from .kml import Document
from .kml import ExtendedData
from .kml import Folder
from .kml import Placemark
from .kml import Schema
from .kml import SchemaData
from .kml import TimeSpan
from .kml import TimeStamp
from .styles import BalloonStyle
from .styles import IconStyle
from .styles import LabelStyle
from .styles import LineStyle
from .styles import PolyStyle
from .styles import Style
from .styles import StyleMap
from .styles import StyleUrl
from fastkml.atom import Author
from fastkml.atom import Contributor
from fastkml.atom import Link
from fastkml.data import Data
from fastkml.data import ExtendedData
from fastkml.data import Schema
from fastkml.data import SchemaData
from fastkml.gx import GxGeometry
from fastkml.kml import KML
from fastkml.kml import Document
from fastkml.kml import Folder
from fastkml.kml import Placemark
from fastkml.styles import BalloonStyle
from fastkml.styles import IconStyle
from fastkml.styles import LabelStyle
from fastkml.styles import LineStyle
from fastkml.styles import PolyStyle
from fastkml.styles import Style
from fastkml.styles import StyleMap
from fastkml.styles import StyleUrl
from fastkml.times import TimeSpan
from fastkml.times import TimeStamp

try:
__version__ = get_distribution("fastkml").version
Expand All @@ -63,6 +64,7 @@
"TimeStamp",
"ExtendedData",
"Data",
"GxGeometry",
"Schema",
"SchemaData",
"StyleUrl",
Expand Down
3 changes: 1 addition & 2 deletions fastkml/atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from typing import Tuple

from fastkml.base import _XMLObject
from fastkml.config import ATOMNS as NS
from fastkml.helpers import o_from_attr
from fastkml.helpers import o_from_subelement_text
from fastkml.helpers import o_int_from_attr
Expand All @@ -45,8 +46,6 @@
from fastkml.types import Element
from fastkml.types import KmlObjectMap

from .config import ATOMNS as NS

logger = logging.getLogger(__name__)
regex = r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)"
email_match = re.compile(regex).match
Expand Down
5 changes: 2 additions & 3 deletions fastkml/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
from typing import cast

from fastkml import config
from fastkml.helpers import o_from_attr
from fastkml.helpers import o_to_attr
from fastkml.types import Element
from fastkml.types import KmlObjectMap

from .helpers import o_from_attr
from .helpers import o_to_attr

logger = logging.getLogger(__name__)


Expand Down
Loading

0 comments on commit 2a043bb

Please sign in to comment.