Passed
Pull Request — master (#372)
by
unknown
02:19
created

client-file   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A read_file() 0 9 2
1
import asyncio
2
from asyncua.client import Client
3
from asyncua.client.ua_file import UaFile
4
5
async def read_file():
6
    """ read file example """
7
8
    url = "opc.tcp://10.0.0.199:4840"
9
    async with Client(url=url) as client:
10
        file_node = client.get_node("ns=2;s=NameOfNode")
11
        ua_file_client = UaFile(file_node)
12
        contents = await ua_file_client.read_file()
13
        print(contents)
14
15
asyncio.run(read_file())
16