Merge branch 'cleanup' into develop
This commit is contained in:
commit
ec7ecc24d7
@ -138,13 +138,6 @@ class Lexer:
|
|||||||
|
|
||||||
self.backup()
|
self.backup()
|
||||||
|
|
||||||
# NextItem returns the next item from the input.
|
|
||||||
# Called by the parser, not in the lexing goroutine.
|
|
||||||
# def next_item(self) -> Item:
|
|
||||||
# item: Item = self.items.get()
|
|
||||||
# self.lastPos = item.pos
|
|
||||||
# return item
|
|
||||||
|
|
||||||
def scan_number(self) -> bool:
|
def scan_number(self) -> bool:
|
||||||
digits = "0123456789"
|
digits = "0123456789"
|
||||||
|
|
||||||
@ -253,7 +246,6 @@ def lex_filename(lex: Lexer) -> Optional[Callable[[Lexer], Optional[Callable]]]:
|
|||||||
if lex.sbrace_depth < 0:
|
if lex.sbrace_depth < 0:
|
||||||
return errorf(lex, "unexpected right brace " + r)
|
return errorf(lex, "unexpected right brace " + r)
|
||||||
elif is_symbol(r):
|
elif is_symbol(r):
|
||||||
# L.backup()
|
|
||||||
lex.emit(ItemType.Symbol)
|
lex.emit(ItemType.Symbol)
|
||||||
else:
|
else:
|
||||||
return errorf(lex, "unrecognized character in action: " + r)
|
return errorf(lex, "unrecognized character in action: " + r)
|
||||||
|
@ -417,7 +417,6 @@ def parse(p: Parser) -> Optional[Callable[[Parser], Optional[Callable]]]:
|
|||||||
if item.typ == filenamelexer.ItemType.Number:
|
if item.typ == filenamelexer.ItemType.Number:
|
||||||
likely_year = False
|
likely_year = False
|
||||||
if p.firstItem and p.first_is_alt:
|
if p.firstItem and p.first_is_alt:
|
||||||
# raise Exception("fuck you")
|
|
||||||
p.alt = True
|
p.alt = True
|
||||||
return parse_issue_number
|
return parse_issue_number
|
||||||
|
|
||||||
|
@ -15,11 +15,9 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import locale
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import platform
|
|
||||||
import re
|
import re
|
||||||
import unicodedata
|
import unicodedata
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
@ -34,25 +32,6 @@ class UtilsVars:
|
|||||||
already_fixed_encoding = False
|
already_fixed_encoding = False
|
||||||
|
|
||||||
|
|
||||||
def get_actual_preferred_encoding() -> str:
|
|
||||||
preferred_encoding = locale.getpreferredencoding()
|
|
||||||
if platform.system() == "Darwin":
|
|
||||||
preferred_encoding = "utf-8"
|
|
||||||
return preferred_encoding
|
|
||||||
|
|
||||||
|
|
||||||
# def fix_output_encoding() -> None:
|
|
||||||
# if not UtilsVars.already_fixed_encoding:
|
|
||||||
# # this reads the environment and inits the right locale
|
|
||||||
# locale.setlocale(locale.LC_ALL, "")
|
|
||||||
|
|
||||||
# # try to make stdout/stderr encodings happy for unicode printing
|
|
||||||
# preferred_encoding = get_actual_preferred_encoding()
|
|
||||||
# sys.stdout = codecs.getwriter(preferred_encoding)(sys.stdout)
|
|
||||||
# sys.stderr = codecs.getwriter(preferred_encoding)(sys.stderr)
|
|
||||||
# UtilsVars.already_fixed_encoding = True
|
|
||||||
|
|
||||||
|
|
||||||
def get_recursive_filelist(pathlist: List[str]) -> List[str]:
|
def get_recursive_filelist(pathlist: List[str]) -> List[str]:
|
||||||
"""Get a recursive list of of all files under all path items in the list"""
|
"""Get a recursive list of of all files under all path items in the list"""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user