-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
__init__.py
52 lines (34 loc) · 1.58 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http:https://www.gnu.org/licenses/.
"""rinohtype
"""
import os
from importlib import import_module
try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
import importlib_metadata
CORE_MODULES = ['annotation', 'attribute', 'color', 'dimension', 'document',
'draw', 'element', 'flowable', 'glossary', 'highlight',
'image', 'index', 'inline', 'layout', 'number', 'paper',
'paragraph', 'reference', 'structure', 'style', 'table',
'template', 'text']
__all__ = CORE_MODULES + ['font', 'fonts', 'frontend', 'backend', 'resource',
'styleds', 'styles', 'stylesheets', 'templates',
'strings', 'language']
DATA_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
__version__ = importlib_metadata.version('rinohtype')
__release_date__ = 'in development'
from . import resource
# create proxies for the core classes/constants at the top level for easy access
for name in CORE_MODULES:
module = import_module('.' + name, __name__)
module_dict, module_all = module.__dict__, module.__all__
globals().update({name: module_dict[name] for name in module_all})
__all__ += module_all
register_template = resource._DISTRIBUTION.register_template
register_typeface = resource._DISTRIBUTION.register_typeface