mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
remove unneeded optional
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import string
|
import string
|
||||||
from typing import List, Dict, Optional
|
from typing import List, Dict
|
||||||
|
|
||||||
|
|
||||||
def simple_table_parse(data: List[str]) -> List[Dict]:
|
def simple_table_parse(data: List[str]) -> List[Dict]:
|
||||||
@ -33,7 +33,7 @@ def simple_table_parse(data: List[str]) -> List[Dict]:
|
|||||||
return raw_output
|
return raw_output
|
||||||
|
|
||||||
|
|
||||||
def sparse_table_parse(data: List[str], delim: Optional[str] ='\u2063') -> List[Dict]:
|
def sparse_table_parse(data: List[str], delim: str = '\u2063') -> List[Dict]:
|
||||||
"""
|
"""
|
||||||
Parse tables with missing column data or with spaces in column data.
|
Parse tables with missing column data or with spaces in column data.
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ def sparse_table_parse(data: List[str], delim: Optional[str] ='\u2063') -> List[
|
|||||||
h_end -= 1
|
h_end -= 1
|
||||||
|
|
||||||
# insert custom delimiter
|
# insert custom delimiter
|
||||||
entry = f'{entry[:h_end]}{delim}{entry[h_end + 1:]}'
|
entry = entry[:h_end] + delim + entry[h_end + 1:]
|
||||||
|
|
||||||
# create the entry list from the new custom delimiter
|
# create the entry list from the new custom delimiter
|
||||||
entry_list = entry.split(delim, maxsplit=len(header_list) - 1)
|
entry_list = entry.split(delim, maxsplit=len(header_list) - 1)
|
||||||
|
@ -5,7 +5,7 @@ import locale
|
|||||||
import shutil
|
import shutil
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from textwrap import TextWrapper
|
from textwrap import TextWrapper
|
||||||
from typing import Dict, Iterable, List, Union, Optional
|
from typing import Dict, Iterable, List, Union
|
||||||
|
|
||||||
|
|
||||||
def warning_message(message_lines: List[str]) -> None:
|
def warning_message(message_lines: List[str]) -> None:
|
||||||
@ -76,7 +76,7 @@ def error_message(message_lines: List[str]) -> None:
|
|||||||
print(message, file=sys.stderr)
|
print(message, file=sys.stderr)
|
||||||
|
|
||||||
|
|
||||||
def compatibility(mod_name: str, compatible: List, quiet: Optional[bool] = False) -> None:
|
def compatibility(mod_name: str, compatible: List, quiet: bool = False) -> None:
|
||||||
"""
|
"""
|
||||||
Checks for the parser's compatibility with the running OS
|
Checks for the parser's compatibility with the running OS
|
||||||
platform.
|
platform.
|
||||||
|
Reference in New Issue
Block a user