Rename scripts

This commit is contained in:
relikd
2020-09-21 13:33:26 +02:00
parent 8b7c1d51ee
commit 1c87cd336f
9 changed files with 30 additions and 30 deletions

View File

@@ -41,8 +41,8 @@ Given A → B, B depends on A
``` ```
digraph Dependency { digraph Dependency {
"." -> html_root "." -> html_root
"." -> bundle_download "." -> download_itunes
bundle_download -> index_app_names download_itunes -> index_app_names
index_app_names -> html_bundle index_app_names -> html_bundle
index_app_names -> html_index_apps index_app_names -> html_index_apps
index_app_names -> html_index_domains index_app_names -> html_index_domains
@@ -52,7 +52,7 @@ digraph Dependency {
index_meta -> html_bundle index_meta -> html_bundle
bundle_combine -> index_domains bundle_combine -> index_domains
index_domains -> html_index_domains index_domains -> html_index_domains
"." -> tracker_download "." -> download_tracker
} }
``` ```
[graphviz](http://www.webgraphviz.com/) [graphviz](http://www.webgraphviz.com/)

View File

@@ -4,7 +4,7 @@ import os
import re import re
import sys import sys
import common_lib as mylib import common_lib as mylib
import tracker_download # is_tracker import download_tracker # is_tracker
THRESHOLD_PERCENT_OF_LOGS = 0.33 # domain appears in % recordings THRESHOLD_PERCENT_OF_LOGS = 0.33 # domain appears in % recordings
@@ -41,7 +41,7 @@ def json_combine(bundle_id):
try: try:
ddic[key][1].append(num) ddic[key][1].append(num)
except KeyError: except KeyError:
ddic[key] = (tracker_download.is_tracker(key), [num]) ddic[key] = (download_tracker.is_tracker(key), [num])
res = {'rec_len': []} res = {'rec_len': []}
pardom = {} pardom = {}

View File

@@ -4,7 +4,7 @@ import sys
import time import time
import math import math
import common_lib as mylib import common_lib as mylib
import bundle_download # get_genres import download_itunes # get_genres
import bundle_combine # get_evaluated, fname_evaluated import bundle_combine # get_evaluated, fname_evaluated
import index_app_names # get_name import index_app_names # get_name
import index_meta # get_rank import index_meta # get_rank
@@ -113,7 +113,7 @@ def gen_html(bundle_id, obj):
</div>''' </div>'''
name = index_app_names.get_name(bundle_id) name = index_app_names.get_name(bundle_id)
gernes = bundle_download.get_genres(bundle_id) gernes = download_itunes.get_genres(bundle_id)
rank, max_rank = index_meta.get_rank(bundle_id) rank, max_rank = index_meta.get_rank(bundle_id)
obj['tracker'] = list(filter(lambda x: x[2], obj['subdom'])) obj['tracker'] = list(filter(lambda x: x[2], obj['subdom']))
return mylib.template_with_base(f''' return mylib.template_with_base(f'''

View File

@@ -2,7 +2,7 @@
import sys import sys
import common_lib as mylib import common_lib as mylib
import bundle_download # app_names import download_itunes # app_names
_bundle_name_dict = None _bundle_name_dict = None
@@ -49,7 +49,7 @@ def process(bundle_ids):
load_json_if_not_already() load_json_if_not_already()
did_change = False did_change = False
for bid in bundle_ids: for bid in bundle_ids:
names = bundle_download.app_names(bid) names = download_itunes.app_names(bid)
if not names: if not names:
mylib.err('index-app-names', 'could not load: {}'.format(bid)) mylib.err('index-app-names', 'could not load: {}'.format(bid))
continue continue

View File

@@ -3,7 +3,7 @@
import sys import sys
import common_lib as mylib import common_lib as mylib
import bundle_combine # get_evaluated import bundle_combine # get_evaluated
import tracker_download # is_tracker import download_tracker # is_tracker
def fname_all(): def fname_all():
@@ -69,7 +69,7 @@ def insert_in_index(index, bundle_ids):
def filter_tracker_only(index): def filter_tracker_only(index):
sub_trkr = {} sub_trkr = {}
par_trkr = {} par_trkr = {}
for domain, ids in filter(lambda x: tracker_download.is_tracker(x[0]), for domain, ids in filter(lambda x: download_tracker.is_tracker(x[0]),
index['subdom'].items()): index['subdom'].items()):
sub_trkr[domain] = ids sub_trkr[domain] = ids
pardom = mylib.parent_domain(domain) pardom = mylib.parent_domain(domain)

View File

@@ -4,7 +4,8 @@ import sys
import traceback import traceback
import common_lib as mylib import common_lib as mylib
import bundle_combine import bundle_combine
import bundle_download import download_itunes
import download_tracker
import html_root import html_root
import html_index_apps import html_index_apps
import html_bundle import html_bundle
@@ -12,7 +13,6 @@ import html_index_domains
import index_app_names import index_app_names
import index_domains import index_domains
import index_meta import index_meta
import tracker_download
def print_usage_and_exit(): def print_usage_and_exit():
@@ -63,11 +63,11 @@ def combine_and_update(bundle_ids, where=None):
# special case needed. '*' will force rebuilt index # special case needed. '*' will force rebuilt index
return ['*'] if not where and bundle_ids == ['*'] else ids return ['*'] if not where and bundle_ids == ['*'] else ids
# 1. download meta data from iTunes store, incl. app icons # 1. download meta data from iTunes store, incl. app icons
new_ids = bundle_download.process(bundle_ids) new_ids = download_itunes.process(bundle_ids)
new_ids = star_reset(new_ids) new_ids = star_reset(new_ids)
# 2. if new apps, update bundle name index # 2. if new apps, update bundle name index
if len(new_ids) > 0: if len(new_ids) > 0:
index_app_names.process(new_ids) # after bundle_download index_app_names.process(new_ids) # after download_itunes
# 3. re-calculate combined.json and evaluated.json files # 3. re-calculate combined.json and evaluated.json files
affected = bundle_combine.process(bundle_ids, where=where) affected = bundle_combine.process(bundle_ids, where=where)
affected = star_reset(affected) affected = star_reset(affected)
@@ -111,7 +111,7 @@ def import_update():
def tracker_update(): def tracker_update():
new_trackers = tracker_download.process() new_trackers = download_tracker.process()
if new_trackers: if new_trackers:
combine_and_update(['*'], where=new_trackers) combine_and_update(['*'], where=new_trackers)
@@ -127,9 +127,9 @@ try:
import_update() import_update()
elif cmd == 'tracker': elif cmd == 'tracker':
tracker_update() tracker_update()
# tracker_download.combine_all() # download_tracker.combine_all()
elif cmd == 'icons': elif cmd == 'icons':
if bundle_download.download_missing_icons(force=False): if download_itunes.download_missing_icons(force=False):
rebuild_app_index_html() rebuild_app_index_html()
elif cmd == 'index': elif cmd == 'index':
index_meta.process(['*']) index_meta.process(['*'])

View File

@@ -17,13 +17,13 @@
<path fill="none" stroke="black" d="M258.839,-225.772C220.494,-214.302 145.019,-191.724 95.8145,-177.004"></path> <path fill="none" stroke="black" d="M258.839,-225.772C220.494,-214.302 145.019,-191.724 95.8145,-177.004"></path>
<polygon fill="black" stroke="black" points="96.6233,-173.593 86.0396,-174.08 94.617,-180.299 96.6233,-173.593"></polygon> <polygon fill="black" stroke="black" points="96.6233,-173.593 86.0396,-174.08 94.617,-180.299 96.6233,-173.593"></polygon>
</g> </g>
<!-- bundle_download --> <!-- download_itunes -->
<g id="node5" class="node"><title>bundle_download</title> <g id="node5" class="node"><title>download_itunes</title>
<ellipse fill="none" stroke="black" cx="196" cy="-162" rx="80.3504" ry="18"></ellipse> <ellipse fill="none" stroke="black" cx="196" cy="-162" rx="80.3504" ry="18"></ellipse>
<text text-anchor="middle" x="196" y="-157.8" font-family="Times,serif" font-size="14.00">bundle_download</text> <text text-anchor="middle" x="196" y="-157.8" font-family="Times,serif" font-size="14.00">download_itunes</text>
</g> </g>
<!-- .&#45;&gt;bundle_download --> <!-- .&#45;&gt;download_itunes -->
<g id="edge4" class="edge"><title>.-&gt;bundle_download</title> <g id="edge4" class="edge"><title>.-&gt;download_itunes</title>
<path fill="none" stroke="black" d="M266.226,-219.503C254.338,-209.939 238.103,-196.876 224.237,-185.719"></path> <path fill="none" stroke="black" d="M266.226,-219.503C254.338,-209.939 238.103,-196.876 224.237,-185.719"></path>
<polygon fill="black" stroke="black" points="226.383,-182.954 216.398,-179.412 221.995,-188.408 226.383,-182.954"></polygon> <polygon fill="black" stroke="black" points="226.383,-182.954 216.398,-179.412 221.995,-188.408 226.383,-182.954"></polygon>
</g> </g>
@@ -37,13 +37,13 @@
<path fill="none" stroke="black" d="M299.774,-219.503C311.662,-209.939 327.897,-196.876 341.763,-185.719"></path> <path fill="none" stroke="black" d="M299.774,-219.503C311.662,-209.939 327.897,-196.876 341.763,-185.719"></path>
<polygon fill="black" stroke="black" points="344.005,-188.408 349.602,-179.412 339.617,-182.954 344.005,-188.408"></polygon> <polygon fill="black" stroke="black" points="344.005,-188.408 349.602,-179.412 339.617,-182.954 344.005,-188.408"></polygon>
</g> </g>
<!-- tracker_download --> <!-- download_tracker -->
<g id="node24" class="node"><title>tracker_download</title> <g id="node24" class="node"><title>download_tracker</title>
<ellipse fill="none" stroke="black" cx="544" cy="-162" rx="80.1284" ry="18"></ellipse> <ellipse fill="none" stroke="black" cx="544" cy="-162" rx="80.1284" ry="18"></ellipse>
<text text-anchor="middle" x="544" y="-157.8" font-family="Times,serif" font-size="14.00">tracker_download</text> <text text-anchor="middle" x="544" y="-157.8" font-family="Times,serif" font-size="14.00">download_tracker</text>
</g> </g>
<!-- .&#45;&gt;tracker_download --> <!-- .&#45;&gt;download_tracker -->
<g id="edge26" class="edge"><title>.-&gt;tracker_download</title> <g id="edge26" class="edge"><title>.-&gt;download_tracker</title>
<path fill="none" stroke="black" d="M307.554,-226.415C347.777,-215.627 428.818,-193.892 484.722,-178.898"></path> <path fill="none" stroke="black" d="M307.554,-226.415C347.777,-215.627 428.818,-193.892 484.722,-178.898"></path>
<polygon fill="black" stroke="black" points="485.753,-182.246 494.505,-176.275 483.94,-175.484 485.753,-182.246"></polygon> <polygon fill="black" stroke="black" points="485.753,-182.246 494.505,-176.275 483.94,-175.484 485.753,-182.246"></polygon>
</g> </g>
@@ -52,8 +52,8 @@
<ellipse fill="none" stroke="black" cx="196" cy="-90" rx="80.1456" ry="18"></ellipse> <ellipse fill="none" stroke="black" cx="196" cy="-90" rx="80.1456" ry="18"></ellipse>
<text text-anchor="middle" x="196" y="-85.8" font-family="Times,serif" font-size="14.00">index_app_names</text> <text text-anchor="middle" x="196" y="-85.8" font-family="Times,serif" font-size="14.00">index_app_names</text>
</g> </g>
<!-- bundle_download&#45;&gt;index_app_names --> <!-- download_itunes&#45;&gt;index_app_names -->
<g id="edge6" class="edge"><title>bundle_download-&gt;index_app_names</title> <g id="edge6" class="edge"><title>download_itunes-&gt;index_app_names</title>
<path fill="none" stroke="black" d="M196,-143.697C196,-135.983 196,-126.712 196,-118.112"></path> <path fill="none" stroke="black" d="M196,-143.697C196,-135.983 196,-126.712 196,-118.112"></path>
<polygon fill="black" stroke="black" points="199.5,-118.104 196,-108.104 192.5,-118.104 199.5,-118.104"></polygon> <polygon fill="black" stroke="black" points="199.5,-118.104 196,-108.104 192.5,-118.104 199.5,-118.104"></polygon>
</g> </g>

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB