download.py
Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 from __future__ import print_function
00003 
00004 # https://opcfoundation.org/UA/schemas/OPC%20UA%20Schema%20Files%20Readme.xls
00005 
00006 resources = [
00007     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.Types.xsd',
00008     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.Services.wsdl',
00009     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.Endpoints.wsdl',
00010     'https://opcfoundation.org/UA/schemas/DI/1.00/Opc.Ua.Di.Types.xsd',
00011     'https://opcfoundation.org/UA/schemas/ADI/1.00/Opc.Ua.Adi.Types.xsd',
00012 
00013     'https://opcfoundation.org/UA/schemas/1.03/SecuredApplication.xsd',
00014 
00015     'https://opcfoundation.org/UA/schemas/1.03/UANodeSet.xsd',
00016     'https://opcfoundation.org/UA/schemas/1.03/UAVariant.xsd',
00017     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.xml',
00018     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part3.xml',
00019     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part4.xml',
00020     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part5.xml',
00021     'https://opcfoundation.org/UA/schemas/Opc.Ua.NodeSet2.Part8.xml',
00022     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part9.xml',
00023     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part10.xml',
00024     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part11.xml',
00025     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.NodeSet2.Part13.xml',
00026     'https://opcfoundation.org/UA/schemas/DI/1.00/Opc.Ua.Di.NodeSet2.xml',
00027     'https://opcfoundation.org/UA/schemas/ADI/1.00/Opc.Ua.Adi.NodeSet2.xml',
00028 
00029     'https://opcfoundation.org/UA/schemas/1.03/OPCBinarySchema.xsd',
00030     'https://opcfoundation.org/UA/schemas/1.03/Opc.Ua.Types.bsd',
00031     'https://opcfoundation.org/UA/schemas/DI/1.00/Opc.Ua.Di.Types.bsd',
00032     'https://opcfoundation.org/UA/schemas/ADI/1.00/Opc.Ua.Adi.Types.bsd',
00033 
00034     'https://opcfoundation.org/UA/schemas/1.03/AttributeIds.csv',
00035     'https://opcfoundation.org/UA/schemas/1.03/StatusCodes.csv',
00036     'https://opcfoundation.org/UA/schemas/1.03/NodeIds.csv',
00037 ]
00038 
00039 import os
00040 
00041 try:
00042     from urllib.request import urlopen
00043     from urllib.parse import urlparse
00044     from urllib.request import build_opener
00045 except ImportError:
00046     from urlparse import urlparse
00047     from urllib import urlopen
00048     from urllib2 import build_opener
00049 
00050 opener = build_opener()
00051 opener.addheaders = [('User-agent', 'Mozilla/5.0')]
00052 
00053 for url in resources:
00054     fname = os.path.basename(url)
00055     print('downloading', fname, '... ', end='')
00056     try:
00057         open(fname, 'wb+').write(opener.open(url).read())
00058         print('OK')
00059     except Exception as e:
00060         print('FAILED ({0})'.format(e))


ros_opcua_impl_python_opcua
Author(s): Denis Štogl , Daniel Draper
autogenerated on Sat Jun 8 2019 18:26:23