changed alphabet string to string module.
changed alphabet string to string module.
This commit is contained in:
parent
e59c0afe79
commit
9e4f5c1879
5
setup.py
5
setup.py
|
@ -5,6 +5,7 @@ from distutils import dir_util
|
||||||
from distutils.util import convert_path
|
from distutils.util import convert_path
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import string
|
||||||
from typing import Dict, NamedTuple, List
|
from typing import Dict, NamedTuple, List
|
||||||
|
|
||||||
FUNCTION_REGEX = r'^def [\w_]*'
|
FUNCTION_REGEX = r'^def [\w_]*'
|
||||||
|
@ -89,10 +90,10 @@ def get_spec(file_name: str) -> SpecObject:
|
||||||
if '`' in row[i]:
|
if '`' in row[i]:
|
||||||
row[i] = row[i][:row[i].find('`')]
|
row[i] = row[i][:row[i].find('`')]
|
||||||
is_constant_def = True
|
is_constant_def = True
|
||||||
if row[0][0] not in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_':
|
if row[0][0] not in string.ascii_uppercase + '_':
|
||||||
is_constant_def = False
|
is_constant_def = False
|
||||||
for c in row[0]:
|
for c in row[0]:
|
||||||
if c not in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789':
|
if c not in string.ascii_uppercase + '_' + string.digits:
|
||||||
is_constant_def = False
|
is_constant_def = False
|
||||||
if is_constant_def:
|
if is_constant_def:
|
||||||
if row[1].startswith('get_generalized_index'):
|
if row[1].startswith('get_generalized_index'):
|
||||||
|
|
Loading…
Reference in New Issue