Rename scripts
This commit is contained in:
@@ -41,8 +41,8 @@ Given A → B, B depends on A
|
||||
```
|
||||
digraph Dependency {
|
||||
"." -> html_root
|
||||
"." -> bundle_download
|
||||
bundle_download -> index_app_names
|
||||
"." -> download_itunes
|
||||
download_itunes -> index_app_names
|
||||
index_app_names -> html_bundle
|
||||
index_app_names -> html_index_apps
|
||||
index_app_names -> html_index_domains
|
||||
@@ -52,7 +52,7 @@ digraph Dependency {
|
||||
index_meta -> html_bundle
|
||||
bundle_combine -> index_domains
|
||||
index_domains -> html_index_domains
|
||||
"." -> tracker_download
|
||||
"." -> download_tracker
|
||||
}
|
||||
```
|
||||
[graphviz](http://www.webgraphviz.com/)
|
||||
@@ -4,7 +4,7 @@ import os
|
||||
import re
|
||||
import sys
|
||||
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
|
||||
@@ -41,7 +41,7 @@ def json_combine(bundle_id):
|
||||
try:
|
||||
ddic[key][1].append(num)
|
||||
except KeyError:
|
||||
ddic[key] = (tracker_download.is_tracker(key), [num])
|
||||
ddic[key] = (download_tracker.is_tracker(key), [num])
|
||||
|
||||
res = {'rec_len': []}
|
||||
pardom = {}
|
||||
|
||||
@@ -4,7 +4,7 @@ import sys
|
||||
import time
|
||||
import math
|
||||
import common_lib as mylib
|
||||
import bundle_download # get_genres
|
||||
import download_itunes # get_genres
|
||||
import bundle_combine # get_evaluated, fname_evaluated
|
||||
import index_app_names # get_name
|
||||
import index_meta # get_rank
|
||||
@@ -113,7 +113,7 @@ def gen_html(bundle_id, obj):
|
||||
</div>'''
|
||||
|
||||
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)
|
||||
obj['tracker'] = list(filter(lambda x: x[2], obj['subdom']))
|
||||
return mylib.template_with_base(f'''
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import sys
|
||||
import common_lib as mylib
|
||||
import bundle_download # app_names
|
||||
import download_itunes # app_names
|
||||
|
||||
_bundle_name_dict = None
|
||||
|
||||
@@ -49,7 +49,7 @@ def process(bundle_ids):
|
||||
load_json_if_not_already()
|
||||
did_change = False
|
||||
for bid in bundle_ids:
|
||||
names = bundle_download.app_names(bid)
|
||||
names = download_itunes.app_names(bid)
|
||||
if not names:
|
||||
mylib.err('index-app-names', 'could not load: {}'.format(bid))
|
||||
continue
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import sys
|
||||
import common_lib as mylib
|
||||
import bundle_combine # get_evaluated
|
||||
import tracker_download # is_tracker
|
||||
import download_tracker # is_tracker
|
||||
|
||||
|
||||
def fname_all():
|
||||
@@ -69,7 +69,7 @@ def insert_in_index(index, bundle_ids):
|
||||
def filter_tracker_only(index):
|
||||
sub_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()):
|
||||
sub_trkr[domain] = ids
|
||||
pardom = mylib.parent_domain(domain)
|
||||
|
||||
14
src/main.py
14
src/main.py
@@ -4,7 +4,8 @@ import sys
|
||||
import traceback
|
||||
import common_lib as mylib
|
||||
import bundle_combine
|
||||
import bundle_download
|
||||
import download_itunes
|
||||
import download_tracker
|
||||
import html_root
|
||||
import html_index_apps
|
||||
import html_bundle
|
||||
@@ -12,7 +13,6 @@ import html_index_domains
|
||||
import index_app_names
|
||||
import index_domains
|
||||
import index_meta
|
||||
import tracker_download
|
||||
|
||||
|
||||
def print_usage_and_exit():
|
||||
@@ -63,11 +63,11 @@ def combine_and_update(bundle_ids, where=None):
|
||||
# special case needed. '*' will force rebuilt index
|
||||
return ['*'] if not where and bundle_ids == ['*'] else ids
|
||||
# 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)
|
||||
# 2. if new apps, update bundle name index
|
||||
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
|
||||
affected = bundle_combine.process(bundle_ids, where=where)
|
||||
affected = star_reset(affected)
|
||||
@@ -111,7 +111,7 @@ def import_update():
|
||||
|
||||
|
||||
def tracker_update():
|
||||
new_trackers = tracker_download.process()
|
||||
new_trackers = download_tracker.process()
|
||||
if new_trackers:
|
||||
combine_and_update(['*'], where=new_trackers)
|
||||
|
||||
@@ -127,9 +127,9 @@ try:
|
||||
import_update()
|
||||
elif cmd == 'tracker':
|
||||
tracker_update()
|
||||
# tracker_download.combine_all()
|
||||
# download_tracker.combine_all()
|
||||
elif cmd == 'icons':
|
||||
if bundle_download.download_missing_icons(force=False):
|
||||
if download_itunes.download_missing_icons(force=False):
|
||||
rebuild_app_index_html()
|
||||
elif cmd == 'index':
|
||||
index_meta.process(['*'])
|
||||
|
||||
@@ -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>
|
||||
<polygon fill="black" stroke="black" points="96.6233,-173.593 86.0396,-174.08 94.617,-180.299 96.6233,-173.593"></polygon>
|
||||
</g>
|
||||
<!-- bundle_download -->
|
||||
<g id="node5" class="node"><title>bundle_download</title>
|
||||
<!-- download_itunes -->
|
||||
<g id="node5" class="node"><title>download_itunes</title>
|
||||
<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>
|
||||
<!-- .->bundle_download -->
|
||||
<g id="edge4" class="edge"><title>.->bundle_download</title>
|
||||
<!-- .->download_itunes -->
|
||||
<g id="edge4" class="edge"><title>.->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>
|
||||
<polygon fill="black" stroke="black" points="226.383,-182.954 216.398,-179.412 221.995,-188.408 226.383,-182.954"></polygon>
|
||||
</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>
|
||||
<polygon fill="black" stroke="black" points="344.005,-188.408 349.602,-179.412 339.617,-182.954 344.005,-188.408"></polygon>
|
||||
</g>
|
||||
<!-- tracker_download -->
|
||||
<g id="node24" class="node"><title>tracker_download</title>
|
||||
<!-- download_tracker -->
|
||||
<g id="node24" class="node"><title>download_tracker</title>
|
||||
<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>
|
||||
<!-- .->tracker_download -->
|
||||
<g id="edge26" class="edge"><title>.->tracker_download</title>
|
||||
<!-- .->download_tracker -->
|
||||
<g id="edge26" class="edge"><title>.->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>
|
||||
<polygon fill="black" stroke="black" points="485.753,-182.246 494.505,-176.275 483.94,-175.484 485.753,-182.246"></polygon>
|
||||
</g>
|
||||
@@ -52,8 +52,8 @@
|
||||
<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>
|
||||
</g>
|
||||
<!-- bundle_download->index_app_names -->
|
||||
<g id="edge6" class="edge"><title>bundle_download->index_app_names</title>
|
||||
<!-- download_itunes->index_app_names -->
|
||||
<g id="edge6" class="edge"><title>download_itunes->index_app_names</title>
|
||||
<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>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Reference in New Issue
Block a user