Files
30-seconds-of-code/website/web/Lib/site-packages/misaka/constants.py
2018-02-22 13:04:08 +05:30

20 lines
406 B
Python

# -*- coding: utf-8 -*-
import sys
from inspect import getmembers
from ._hoedown import lib
def _set_constants():
is_int = lambda n: isinstance(n, int)
for name, value in getmembers(lib, is_int):
if not name.startswith('HOEDOWN_'):
continue
setattr(sys.modules[__name__], name[8:], value)
if not hasattr(sys.modules[__name__], 'EXT_TABLES'):
_set_constants()