-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ba8151
commit 2b16336
Showing
11 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,44 @@ | ||
from .package_data import __version__ | ||
from .core import * | ||
from .core import ( | ||
IDNABidiError, | ||
IDNAError, | ||
InvalidCodepoint, | ||
InvalidCodepointContext, | ||
alabel, | ||
check_bidi, | ||
check_hyphen_ok, | ||
check_initial_combiner, | ||
check_label, | ||
check_nfc, | ||
decode, | ||
encode, | ||
intranges_contain, | ||
ulabel, | ||
uts46_remap, | ||
valid_contextj, | ||
valid_contexto, | ||
valid_label_length, | ||
valid_string_length, | ||
) | ||
|
||
__all__ = [ | ||
"IDNABidiError", | ||
"IDNAError", | ||
"InvalidCodepoint", | ||
"InvalidCodepointContext", | ||
"alabel", | ||
"check_bidi", | ||
"check_hyphen_ok", | ||
"check_initial_combiner", | ||
"check_label", | ||
"check_nfc", | ||
"decode", | ||
"encode", | ||
"intranges_contain", | ||
"ulabel", | ||
"uts46_remap", | ||
"valid_contextj", | ||
"valid_contexto", | ||
"valid_label_length", | ||
"valid_string_length", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import codecs | ||
from typing import Tuple | ||
|
||
class Codec(codecs.Codec): | ||
def encode(self, data: str, errors: str = ...) -> Tuple[bytes, int]: ... | ||
def decode(self, data: bytes, errors: str = ...) -> Tuple[str, int]: ... | ||
|
||
class IncrementalEncoder(codecs.BufferedIncrementalEncoder): | ||
def _buffer_encode( # type: ignore | ||
self, | ||
data: str, | ||
errors: str, | ||
final: bool | ||
) -> Tuple[str, int]: ... | ||
|
||
class IncrementalDecoder(codecs.BufferedIncrementalDecoder): | ||
def _buffer_decode( # type: ignore | ||
self, | ||
data: str, | ||
errors: str, | ||
final: bool | ||
) -> Tuple[str, int]: ... | ||
|
||
class StreamWriter(Codec, codecs.StreamWriter): ... | ||
class StreamReader(Codec, codecs.StreamReader): ... | ||
|
||
def getregentry() -> codecs.CodecInfo: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from typing import Any | ||
|
||
def ToASCII(label: str) -> bytes: ... | ||
def ToUnicode(label: bytes) -> str: ... | ||
def nameprep(s: Any) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from typing import Union | ||
from .intranges import intranges_contain as intranges_contain # noqa | ||
|
||
class IDNAError(UnicodeError): ... | ||
class IDNABidiError(IDNAError): ... | ||
class InvalidCodepoint(IDNAError): ... | ||
class InvalidCodepointContext(IDNAError): ... | ||
|
||
def _combining_class(cp: int) -> int: ... | ||
def _is_script(cp: str, script: str) -> bool: ... | ||
def _punycode(s: str) -> bytes: ... | ||
def _unot(s: int) -> str: ... | ||
def valid_label_length(label: Union[str, bytes]) -> bool: ... | ||
def valid_string_length(label: Union[str, bytes], trailing_dot: bool) -> bool: ... | ||
def check_bidi(label: str, check_ltr: bool = ...) -> bool: ... | ||
def check_initial_combiner(label: str) -> bool: ... | ||
def check_hyphen_ok(label: str) -> bool: ... | ||
def check_nfc(label: str) -> None: ... | ||
def valid_contextj(label: str, pos: int) -> bool: ... | ||
def valid_contexto(label: str, pos: int, exception: bool = False) -> bool: ... | ||
def check_label(label: Union[str, bytes, bytearray]) -> None: ... | ||
def alabel(label: str) -> bytes: ... | ||
def ulabel(label: Union[str, bytes, bytearray]) -> str: ... | ||
def uts46_remap( | ||
domain: str, std3_rules: bool = ..., transitional: bool = ... | ||
) -> str: ... | ||
def encode( | ||
s: Union[str, bytes, bytearray], | ||
strict: bool = False, | ||
uts46: bool = False, | ||
std3_rules: bool = False, | ||
transitional: bool = False, | ||
) -> bytes: ... | ||
def decode( | ||
s: Union[str, bytes, bytearray], | ||
strict: bool = ..., | ||
uts46: bool = ..., | ||
std3_rules: bool = ..., | ||
) -> str: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from typing import Dict, Tuple | ||
|
||
__version__: str | ||
scripts: Dict[str, Tuple[int, ...]] | ||
joining_types: Dict[int, int] | ||
codepoint_classes: Dict[str, Tuple[int, ...]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from typing import List, Tuple | ||
|
||
def intranges_from_list(list_: List[int]) -> Tuple[int, ...]: ... | ||
def _encode_range(start: int, end: int) -> int: ... | ||
def _decode_range(r: int) -> Tuple[int, int]: ... | ||
def intranges_contain(int_: int, ranges: Tuple[int, ...]) -> bool: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__: str |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from typing import Tuple, Union | ||
|
||
__version__: str | ||
uts46data: Tuple[Union[Tuple[int, str], Tuple[int, str, str]], ...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters