Filenames + small changes

This commit is contained in:
relikd
2020-09-21 11:55:27 +02:00
parent d59b42ca8e
commit 562048455b
4 changed files with 14 additions and 16 deletions

View File

@@ -77,19 +77,22 @@ def json_combine(bundle_id):
mylib.err('bundle-combine', 'skip: ' + fname)
res['pardom'] = pardom
res['subdom'] = subdom
res['last_date'] = latest
res['last_date'] = int(latest)
return res
def json_evaluate_inplace(obj):
def float3(val):
return int(val * 1000) / 1000
rec_count = len(obj['rec_len'])
time_total = sum(obj['rec_len'])
del(obj['rec_len'])
obj['sum_rec'] = rec_count
obj['sum_logs'] = sum([sum(x[1]) for x in obj['pardom'].values()])
obj['sum_logs_pm'] = obj['sum_logs'] / (time_total or 1) * 60
obj['sum_logs_pm'] = float3(obj['sum_logs'] / (time_total or 1) * 60)
obj['sum_time'] = time_total
obj['avg_time'] = time_total / rec_count
obj['avg_time'] = float3(time_total / rec_count)
def transform(ddic):
res = []
@@ -110,9 +113,9 @@ def json_evaluate_inplace(obj):
obj['pardom'], p_t, p_c = transform(obj['pardom'])
obj['subdom'], s_t, s_c = transform(obj['subdom'])
obj['tracker_percent'] = s_t / (s_c or 1)
obj['avg_logs'] = s_c
obj['avg_logs_pm'] = s_c / (obj['avg_time'] or 1) * 60
obj['tracker_percent'] = float3(s_t / (s_c or 1))
obj['avg_logs'] = float3(s_c)
obj['avg_logs_pm'] = float3(s_c / (obj['avg_time'] or 1) * 60)
def process(bundle_ids, where=None):

View File

@@ -13,7 +13,7 @@ def gen_root():
Information about the research project will be added soon. Stay tuned.
</p>
<a id="get-appcheck" class="no-ul" href="https://testflight.apple.com/join/9jjaFeHO" target="_blank">
<img src="/static/appcheck.svg" alt="app-icon" width="30" height="30">
<img class="app-icon" src="/static/appcheck.svg" alt="app-icon" width="30" height="30">
<p>
Get the iOS App and contribute.<br />
Join the TestFlight Beta.

View File

@@ -7,7 +7,7 @@ _bundle_name_dict = None
def index_fname():
return mylib.path_data_index('bundle_names.json')
return mylib.path_data_index('app_names.json')
def missing():
@@ -50,7 +50,7 @@ def process(bundle_ids):
for bid in bundle_ids:
names = mylib.app_names(bid)
if not names:
mylib.err('index-bundle-names', 'could not load: {}'.format(bid))
mylib.err('index-app-names', 'could not load: {}'.format(bid))
continue
_bundle_name_dict[bid] = names
did_change = True

View File

@@ -7,16 +7,11 @@ import tracker_download
def fname_all():
return mylib.path_data_index('all_domains.json')
return mylib.path_data_index('domains_all.json')
def fname_tracker():
return mylib.path_data_index('tracker_domains.json')
def index_fname(tracker_only=False):
return mylib.path_data_index(
'tracker_domains.json' if tracker_only else 'all_domains.json')
return mylib.path_data_index('domains_tracker.json')
def load_json_from_disk(index_file):