Skip to content

Commit ba25cdd

Browse files
author
p12
committed
Transform/DDG: move settings to a more prominent location
1 parent f605aaf commit ba25cdd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ddg_parse_html.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ def get_content_el(root_el):
4444
VERSION_CXX11 = 102
4545
VERSION_CXX14 = 103
4646

47+
DESC_CHAR_LIMIT = 200
48+
MAX_PAREN_SIZE = 40
49+
4750
''' Returns the declaration of the feature with name 'name'.
4851
If several declarations with the same name are present, the standard
4952
revision marker is parsed and only the declarations for the latest standard
@@ -133,8 +136,6 @@ def del_all_attrs(el):
133136
200 characters, '...' is appended.
134137
'''
135138
def process_description(el, debug=False):
136-
char_limit = 200
137-
min_paren_size = 40
138139

139140
el = deepcopy(el) # we'll modify the tree
140141
el.tag = 'root'
@@ -187,7 +188,7 @@ def process_description(el, debug=False):
187188
text = desc[last_paren_open:end]
188189
if (text.find('ᚃ') != -1 or
189190
text.find('ᚄ') != -1 or
190-
len(text) > min_paren_size):
191+
len(text) > MAX_PAREN_SIZE):
191192
del_ranges.append((last_paren_open, t.start()+1))
192193

193194
else:
@@ -209,7 +210,7 @@ def process_description(el, debug=False):
209210
open_count = 0
210211
first_dot = -1
211212

212-
curr_limit= char_limit
213+
curr_limit= DESC_CHAR_LIMIT
213214

214215
for t in re.finditer('(<code>|</code>|<i>|</i>|<b>|</b>)', desc):
215216
mt = t.group(1)

0 commit comments

Comments
 (0)