30 lines
752 B
Python
30 lines
752 B
Python
"""
|
|
|
|
"""
|
|
|
|
import os
|
|
|
|
|
|
def read_hashset_file(filename):
|
|
with open(filename, 'r') as hashfile:
|
|
# TODO: Test for regression
|
|
ltest = list(hashfile.read().splitlines())
|
|
return ltest
|
|
|
|
|
|
def load_hashsets(path, status_callback=None):
|
|
hashsets = {}
|
|
for content in os.listdir(path):
|
|
filename = os.path.join(path, content)
|
|
if os.path.isfile(filename):
|
|
hashset = os.path.basename(filename).split('.')[0]
|
|
if status_callback:
|
|
status_callback.emit('Reading Hashset "{}"...'.format(hashset))
|
|
hashes = read_hashset_file(filename)
|
|
hashsets[hashset] = set(hashes)
|
|
return hashsets
|
|
|
|
|
|
if __name__ == '__main__':
|
|
hashsets = load_hashsets('Hashsets')
|