|
14 | 14 | patch_all() |
15 | 15 |
|
16 | 16 | # pylint: disable=wrong-import-position,wrong-import-order |
| 17 | +import sys |
17 | 18 | import collections |
18 | 19 | import glob |
19 | 20 | import os |
|
25 | 26 | import time |
26 | 27 |
|
27 | 28 | import beautifier |
28 | | -from globals import MYDIR, PATH_TLDR_PAGES, PATH_CHEAT_PAGES, PATH_CHEAT_SHEETS, COLOR_STYLES, REDISHOST |
| 29 | +from globals import MYDIR, PATH_TLDR_PAGES, PATH_CHEAT_PAGES, PATH_CHEAT_SHEETS, PATH_LATENZ, \ |
| 30 | + COLOR_STYLES, REDISHOST |
29 | 31 | from adapter_learnxiny import get_learnxiny, get_learnxiny_list, is_valid_learnxy |
30 | 32 | from languages_data import LANGUAGE_ALIAS, SO_NAME, rewrite_editor_section_name |
31 | 33 | from colorize_internal import colorize_internal |
@@ -177,6 +179,9 @@ def get_topic_type(topic): # pylint: disable=too-many-locals,too-many-branches,t |
177 | 179 | # let us activate the 'question' feature for all subsections |
178 | 180 | result = 'question' |
179 | 181 |
|
| 182 | + if topic.lower() in ['latencies', 'late.nz', 'latency']: |
| 183 | + result = 'late.nz' |
| 184 | + |
180 | 185 | if result == 'unknown' or result == 'question': |
181 | 186 | print("result = ", result) |
182 | 187 | print(CHEAT_SHEETS_TOPICS) |
@@ -328,11 +333,17 @@ def _get_unknown(topic): |
328 | 333 | %s |
329 | 334 | """ % possible_topics_text |
330 | 335 |
|
| 336 | +def _get_latenz(topic): |
| 337 | + sys.path.append(PATH_LATENZ) |
| 338 | + import latencies |
| 339 | + return latencies.render() |
| 340 | + |
331 | 341 | # pylint: disable=bad-whitespace |
332 | 342 | # |
333 | 343 | # topic_type, function_getter |
334 | 344 | # should be replaced with a decorator |
335 | 345 | TOPIC_GETTERS = ( |
| 346 | + ('late.nz', _get_latenz), |
336 | 347 | ("cheat.sheets", _get_cheat_sheets), |
337 | 348 | ("cheat.sheets dir", _get_cheat_sheets_dir), |
338 | 349 | ("tldr", _get_tldr), |
|
0 commit comments