download.py
Go to the documentation of this file.
1 
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.02/Opc.Ua.Types.xsd',
8  'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.Services.wsdl',
9  'https://opcfoundation.org/UA/schemas/1.02/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.02/SecuredApplication.xsd',
14 
15  'https://opcfoundation.org/UA/schemas/1.02/UANodeSet.xsd',
16  'https://opcfoundation.org/UA/schemas/1.02/UAVariant.xsd', # gone
17  'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.xml',
18  'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part3.xml',
19  'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part4.xml',
20  'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part5.xml',
21  'https://opcfoundation.org/UA/schemas/Opc.Ua.NodeSet2.Part8.xml',
22  'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part9.xml',
23  'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part10.xml',
24  'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part11.xml',
25  'https://opcfoundation.org/UA/schemas/1.02/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.02/OPCBinarySchema.xsd',
30  'https://opcfoundation.org/UA/schemas/1.02/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.02/AttributeIds.csv',
35  'https://opcfoundation.org/UA/schemas/1.02/StatusCode.csv',
36  'https://opcfoundation.org/UA/schemas/1.02/NodeIds.csv',
37 ]
38 
39 import os
40 
41 try:
42  from urllib.request import urlopen
43  from urllib.request import build_opener
44  from urllib.parse import urlparse
45 except ImportError:
46  from urllib import urlopen
47  from urllib2 import build_opener
48  from urlparse import urlparse
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))
61 
FMT_API void print(std::FILE *f, CStringRef format_str, ArgList args)
Definition: format.cc:873
std::string format(CStringRef format_str, ArgList args)
Definition: format.h:3686
bool write(ros_opcua_srvs::Write::Request &req, ros_opcua_srvs::Write::Response &res)
bool read(ros_opcua_srvs::Read::Request &req, ros_opcua_srvs::Read::Response &res)


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:06:04