Closed vmavromatis closed 6 years ago
it is actually partially solved with #9 the only thing is not solved is the saving the blacklist. I mean in line 34 (blacklist_file.write(urllib.request.urlopen(url).read().decode())
) instead of writing it to a file you could just split on every newline and save as a list. as it is done a few lines later (blacklist = f.read().strip().split('\n')
)
Great job for https://github.com/vmavromatis/absolutely-proprietary/pull/20 :+1:
from @abbidabbi:
why are you reading blacklist.txt again and again for each line of the contents of the installed.txt file? Does python cache filesystem I/O by default? It would look much clearer if you'd read the file just once: https://github.com/vmavromatis/absolutely-proprietary/blob/6a1bef8b0999cb38d7bd807c13572ac6d2d89f35/main.py#L27-L31 And why are you writing the results of pacman -Qq and the blacklist content to files anyway? That could just be kept in memory...
Also, writing each line of matched proprietary packages separately to disgusting.txt doesn't look like a good idea and causes many unnecessary write operations: https://github.com/vmavromatis/absolutely-proprietary/blob/6a1bef8b0999cb38d7bd807c13572ac6d2d89f35/main.py#L37