download.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 from __future__ import print_function
3 
4 # https://opcfoundation.org/UA/schemas/OPC%20UA%20Schema%20Files%20Readme.xls
5 
6 resources = [
7  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.Types.xsd',
8  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.Services.wsdl',
9  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.Endpoints.wsdl',
10  'https://opcfoundation.org/UA/schemas/DI/1.00/Opc.Ua.Di.Types.xsd',
11  'https://opcfoundation.org/UA/schemas/ADI/1.00/Opc.Ua.Adi.Types.xsd',
12 
13  'https://opcfoundation.org/UA/schemas/1.03/SecuredApplication.xsd',
14 
15  'https://opcfoundation.org/UA/schemas/1.03/UANodeSet.xsd',
16  'https://opcfoundation.org/UA/schemas/1.03/UAVariant.xsd',
17  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.xml',
18  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part3.xml',
19  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part4.xml',
20  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part5.xml',
21  'https://opcfoundation.org/UA/schemas/Opc.Ua.NodeSet2.Part8.xml',
22  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part9.xml',
23  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part10.xml',
24  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part11.xml',
25  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part13.xml',
26  'https://opcfoundation.org/UA/schemas/DI/1.00/Opc.Ua.Di.NodeSet2.xml',
27  'https://opcfoundation.org/UA/schemas/ADI/1.00/Opc.Ua.Adi.NodeSet2.xml',
28 
29  'https://opcfoundation.org/UA/schemas/1.03/OPCBinarySchema.xsd',
30  'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.Types.bsd',
31  'https://opcfoundation.org/UA/schemas/DI/1.00/Opc.Ua.Di.Types.bsd',
32  'https://opcfoundation.org/UA/schemas/ADI/1.00/Opc.Ua.Adi.Types.bsd',
33 
34  'https://opcfoundation.org/UA/schemas/1.03/AttributeIds.csv',
35  'https://opcfoundation.org/UA/schemas/1.03/StatusCodes.csv',
36  'https://opcfoundation.org/UA/schemas/1.03/NodeIds.csv',
37 ]
38 
39 import os
40 
41 try:
42  from urllib.request import urlopen
43  from urllib.parse import urlparse
44  from urllib.request import build_opener
45 except ImportError:
46  from urlparse import urlparse
47  from urllib import urlopen
48  from urllib2 import build_opener
49 
50 opener = build_opener()
51 opener.addheaders = [('User-agent', 'Mozilla/5.0')]
52 
53 for url in resources:
54  fname = os.path.basename(url)
55  print('downloading', fname, '... ', end='')
56  try:
57  open(fname, 'wb+').write(opener.open(url).read())
58  print('OK')
59  except Exception as e:
60  print('FAILED ({0})'.format(e))


ros_opcua_impl_python_opcua
Author(s): Denis Štogl , Daniel Draper
autogenerated on Tue Jan 19 2021 03:12:43