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.02/Opc.Ua.Types.xsd',
00008   'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.Services.wsdl',
00009   'https://opcfoundation.org/UA/schemas/1.02/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.02/SecuredApplication.xsd',
00014 
00015   'https://opcfoundation.org/UA/schemas/1.02/UANodeSet.xsd',
00016   'https://opcfoundation.org/UA/schemas/1.02/UAVariant.xsd',
00017   'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.xml',
00018   'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part3.xml',
00019   'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part4.xml',
00020   'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part5.xml',
00021   'https://opcfoundation.org/UA/schemas/Opc.Ua.NodeSet2.Part8.xml',
00022   'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part9.xml',
00023   'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part10.xml',
00024   'https://opcfoundation.org/UA/schemas/1.02/Opc.Ua.NodeSet2.Part11.xml',
00025   'https://opcfoundation.org/UA/schemas/1.02/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.02/OPCBinarySchema.xsd',
00030   'https://opcfoundation.org/UA/schemas/1.02/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.02/AttributeIds.csv',
00035   'https://opcfoundation.org/UA/schemas/1.02/StatusCode.csv',
00036   'https://opcfoundation.org/UA/schemas/1.02/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))
00061 


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Sat Jun 8 2019 18:24:40