Skip to content
Snippets Groups Projects
Commit 5cc372ad authored by David Hrbáč's avatar David Hrbáč
Browse files

Pylint

parent 1aca21e1
No related branches found
No related tags found
5 merge requests!368Update prace.md to document the change from qprace to qprod as the default...,!367Update prace.md to document the change from qprace to qprod as the default...,!366Update prace.md to document the change from qprace to qprod as the default...,!323extended-acls-storage-section,!261Fixed search shortcut in matrix form
......@@ -9,13 +9,14 @@ import re
from distutils.version import LooseVersion
def get_data(filename):
'''function to read the data form the input csv file to use in the analysis'''
reader = [] # Just in case the file open fails
reader = [] # Just in case the file open fails
with open(filename, 'rb') as f:
reader = csv.reader(f,delimiter=',')
#returns all the data from the csv file in list form
#f.close() # May need to close the file when done
reader = csv.reader(f, delimiter=',')
# returns all the data from the csv file in list form
# f.close() # May need to close the file when done
return list(reader) # only return the reader when you have finished.
your_list = []
......@@ -28,7 +29,7 @@ your_list += get_data('./scripts/barbora.csv')
counts = dict()
for i in your_list:
counts[i[0]]=counts.get(i[0], 0) + int(i[1])
counts[i[0]] = counts.get(i[0], 0) + int(i[1])
l = ['A', 'S', 'U', 'P', 'D', 'B']
c = []
......@@ -49,23 +50,23 @@ versions = ''
clusters = ''
prev = ''
for m,i in sorted(counts.items()):
#print m
split = m.split('/')
#print split
if len(split) > 1:
a = split[0]
b = split[1]
if split[0] <> prev:
software[a] = {}
software[a][b] = '`' + c[i] + '`'
prev = a
for m, i in sorted(counts.items()):
# print m
split = m.split('/')
# print split
if len(split) > 1:
a = split[0]
b = split[1]
if split[0] <> prev:
software[a] = {}
software[a][b] = '`' + c[i] + '`'
prev = a
packages = {}
for m in sorted(software.items(), key=lambda i: i[0].lower()):
packages[m[0]]=sorted(m[1], key=LooseVersion)[len(m[1])-1]
packages[m[0]] = sorted(m[1], key=LooseVersion)[len(m[1]) - 1]
data = {'total': len(packages), 'projects': packages }
data = {'total': len(packages), 'projects': packages}
print json.dumps(data)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment