Completed
Push — master ( ff54bc...5132c4 )
by Olivier
79:15 queued 17:01
created

server-robotics.main()   A

Complexity

Conditions 2

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 8
nop 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
1
import asyncio
2
import logging
3
import sys
4
sys.path.insert(0, "..")
5
from IPython import embed
6
7
8
9
from asyncua import ua, uamethod, Server
10
11
12
13
async def main():
14
    logging.basicConfig(level=logging.INFO)
15
    server = Server()
16
    await server.init()
17
    # import some nodes from xml
18
    await server.import_xml("../schemas/UA-Nodeset/DI/Opc.Ua.Di.NodeSet2.xml")
19
    await server.import_xml("../schemas/UA-Nodeset/Robotics/Opc.Ua.Robotics.NodeSet2.xml")
20
21
    # starting!
22
    async with server:
23
        embed()
24
25
26
if __name__ == "__main__":
27
    asyncio.run(main())
28