Beispiel #1
0
	def index(self, url):
		version = ""
		try:
			dl_platform = dl_pat.match(url).groups()[0]
		except AttributeError:
			dl_platform = None
		if dl_platform:
			ext = {"nix": "tar.gz", "win": "zip"}[dl_platform]
			try:
				version = h.get_current_version()
			except Exception as e:
				log.error("Error getting version info: %s" % e)
				return "<h2>Sorry, something didn't work as expected. Please send a nasty email " \
						"expressing your anger to <a href='mailto:[email protected]'>the incompetent guy</a> " \
						"who runs this site.i</h2>"
			pth = "https://github.com/dabodev/dabo/archive/%s.%s" % (version, ext)
		else:
			pth = str(os.path.join(app_globals.CDNBASE, url))
		addr = request.remote_addr
		if version:
			vers = " (%s)" % version
		else:
			vers = version
		log.info("[%s] Download Request: %s%s" % (addr, url, vers))
		redirect(pth)