comparison farol/main.py @ 164:4d8218fbe686

merged
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 30 Dec 2014 14:34:48 +0100
parents 07210df10edd 5df0bef667ea
children 000114da182d
comparison
equal deleted inserted replaced
163:1d63a532ccce 164:4d8218fbe686
108 use_cases=[('Create a security advisory and publish as CVRF', 100), 108 use_cases=[('Create a security advisory and publish as CVRF', 100),
109 ('Edit a security advisory in CVRF format', 100)] 109 ('Edit a security advisory in CVRF format', 100)]
110 ) 110 )
111 111
112 def download_url(url): 112 def download_url(url):
113 request = urllib2.Request(url)
114 request.add_header('User-Agent',
115 app.config.get('USER_AGENT',
116 'Farol %s / FarolLuz %s' % (
117 __version__, farolluz.__version__)))
113 proxy_host = app.config.get('PROXY_HOST', '') 118 proxy_host = app.config.get('PROXY_HOST', '')
114 if proxy_host: 119 if proxy_host:
115 proxy = urllib2.ProxyHandler({'http': proxy_host, 'https': proxy_host}) 120 proxy = urllib2.ProxyHandler({'http': proxy_host, 'https': proxy_host})
116 opener = urllib2.build_opener(proxy) 121 opener = urllib2.build_opener(proxy)
117 urllib2.install_opener(opener) 122 urllib2.install_opener(opener)

http://farol.wald.intevation.org