How to use the changelog.PreemptiveBasicAuthHandler function in changelog

To help you get started, we’ve selected a few changelog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MinecraftForge / MinecraftForge / changelog.py View on Github external
def getBuildInfo(url, current_version=None):
	handler = PreemptiveBasicAuthHandler()
	handler.add_password(None, 'jenkins.minecraftforge.net:81', 'console_script', 'fd584bffa72fcac12181f37f80001200')
	file = urllib2.build_opener(handler).open(url)
	data = file.read()
	file.close()
	data = ast.literal_eval(data)['allBuilds']
	data = sorted(data, key=lambda key: key['number'], reverse=False)
	
	items = []
	output = []
	
	for build in data:
		build['actions'] = filter(lambda act: act is not None, build['actions'])
		build['actions'] = filter(lambda act: 'text' in act, build['actions'])
		build['actions'] = filter(lambda act: not ' ' in act['text'], build['actions'])
		if len(build['actions']) == 0:
			build['version'] = current_version