-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
38 lines (28 loc) · 1.38 KB
/
main.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
import shutil
import os
import inspect
import hololinked.serializers
import hololinked.core
def define_env(env):
@env.macro
def thing_id_docstring():
return hololinked.core.Thing.id.doc
@env.macro
def sub_things_docstring(): # does not work, dont know why
return inspect.getdoc(hololinked.core.thing.Thing.sub_things)
@env.macro
def thing_logger_doc():
return hololinked.core.thing.Thing.logger.doc
@env.macro
def thing_FSM_state_doc():
return hololinked.core.thing.Thing.state.doc
# uncomment these while running the first time, then recomment them:
# otherwise mkdocs will reload in an infinite loop.
# source_path = os.path.join(os.path.dirname(hololinked.core.__file__), 'protocols', 'zmq', 'request_message_header_schema.json')
# destination_path = os.path.join('docs', 'api-reference', 'protocols', 'zmq', 'request-message-header-schema.json')
# os.makedirs(os.path.dirname(destination_path), exist_ok=True)
# shutil.copyfile(source_path, destination_path)
# source_path = os.path.join(os.path.dirname(hololinked.core.__file__), 'protocols', 'zmq', 'response_message_header_schema.json')
# destination_path = os.path.join('docs', 'api-reference', 'protocols', 'zmq', 'response-message-header-schema.json.json')
# os.makedirs(os.path.dirname(destination_path), exist_ok=True)
# shutil.copyfile(source_path, destination_path)