From: Marc-Andre Laperle Date: Mon, 3 Oct 2016 01:07:55 +0000 (-0400) Subject: Add script to convert html download stats to CSV X-Git-Url: http://git.efficios.com/?p=deliverable%2Ftracecompass.git;a=commitdiff_plain;h=f5ab42b3cd0c97a3f51db38d4d3c3da6124978bb Add script to convert html download stats to CSV Useful to see stats of dowloaded RCPs. Converts results from this page to CSV: https://dev.eclipse.org/committers/committertools/stats.php Change-Id: I15c95c4f7dad5486ac0f20182aa400d1ef4d860c Signed-off-by: Marc-Andre Laperle Reviewed-on: https://git.eclipse.org/r/82341 Reviewed-by: Hudson CI Reviewed-by: Jonathan Rajotte Julien --- diff --git a/releng/scripts/html_rcp_download_stats_to_csv.py b/releng/scripts/html_rcp_download_stats_to_csv.py new file mode 100644 index 0000000000..32fab825c6 --- /dev/null +++ b/releng/scripts/html_rcp_download_stats_to_csv.py @@ -0,0 +1,33 @@ +############################################################################### +# Copyright (c) 2016 Ericsson +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################### + +#args: filename + +# Parses the HTML of download stats and converts it to CSV +# +# Example usage: +# 1. Login to eclipse.org with your acount and open this page: +#https://dev.eclipse.org/committers/committertools/stats.php?filename=/tracecompass/releases/%trace-compass% +# 2. Save this page as HTML +# 3. python html_rcp_download_stats_to_csv.py page.html > out.csv + +# Example html content +# /tracecompass/releases/1.0.0/rcp/trace-compass-1.0.0-20150610-1449-linux.gtk.x86_64.tar.gz +# 3 +# ... +# /tracecompass/releases/1.0.0/rcp/trace-compass-1.0.0-20150610-1449-win32.win32.x86_64.zip +# 5 + + +import sys, re +fileContent = open(sys.argv[1]).read() +matchObject = re.finditer(".*releases/(\d+.\d+.\d+)/.*trace-compass-\d+\.\d+\.\d+-\d+-\d+-(.*)\..*\.(.*)\.(tar|zip).*\..*\n.*right\">(\d+).*", fileContent) +for m in matchObject: + print(m.group(1) + "," + m.group(2) + "," + m.group(3) + "," + m.group(5)) +