moved other files to dir
This commit is contained in:
parent
6d895633ee
commit
dd2a1a8eab
@ -1,11 +1,6 @@
|
|||||||
from bookstack import Bookstack
|
from bookstack import Bookstack
|
||||||
from update_films_by_country import get_films_by_country, build_page as build_films_by_country_page, FILMS_BY_COUNTRY_PAGE_ID
|
from wiki_pages import FilmsByCountry, FilmsByReference, FilmsByYear, HiddenThemes, KeywordScores, ViewingsCsv
|
||||||
from wiki_pages import References
|
|
||||||
from update_films_by_year import get_films_by_year, build_page as build_films_by_year_page, FILMS_BY_YEAR_PAGE_ID
|
|
||||||
from update_hidden_themes import get_hidden_themes, build_page as build_hidden_themes_page, HIDDEN_THEMES_PAGE_ID
|
|
||||||
from update_keywords_scores import get_keyword_scores, build_page as build_keyword_scores_page, KEYWORD_SCORES_PAGE_ID
|
|
||||||
from vcinema_utils import VCinemaUtils
|
from vcinema_utils import VCinemaUtils
|
||||||
from update_viewings_csv import update_viewings_csv
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
from progress.bar import IncrementalBar
|
from progress.bar import IncrementalBar
|
||||||
@ -15,7 +10,7 @@ def update_wiki(token_id, token_secret, update_csv, update_films_by_year, update
|
|||||||
update_film_references, update_hidden_themes, update_keyword_scores):
|
update_film_references, update_hidden_themes, update_keyword_scores):
|
||||||
if update_csv:
|
if update_csv:
|
||||||
print("Updating CSV")
|
print("Updating CSV")
|
||||||
update_viewings_csv(token_id, token_secret)
|
ViewingsCsv.update_viewings_csv(token_id, token_secret)
|
||||||
|
|
||||||
print("Getting viewings")
|
print("Getting viewings")
|
||||||
viewings = VCinemaUtils.get_vcinema_viewings(token_id, token_secret)
|
viewings = VCinemaUtils.get_vcinema_viewings(token_id, token_secret)
|
||||||
@ -39,57 +34,57 @@ def update_wiki(token_id, token_secret, update_csv, update_films_by_year, update
|
|||||||
|
|
||||||
with IncrementalBar('Processing viewing data', max=update_page_count, suffix='%(percent).1f%% - %(eta)ds remaining', check_tty=False) as bar:
|
with IncrementalBar('Processing viewing data', max=update_page_count, suffix='%(percent).1f%% - %(eta)ds remaining', check_tty=False) as bar:
|
||||||
if update_films_by_year:
|
if update_films_by_year:
|
||||||
films_by_year = get_films_by_year(viewings)
|
films_by_year = FilmsByYear.get_films_by_year(viewings)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_films_by_country:
|
if update_films_by_country:
|
||||||
films_by_country = get_films_by_country(viewings)
|
films_by_country = FilmsByCountry.get_films_by_country(viewings)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_film_references:
|
if update_film_references:
|
||||||
films_by_reference = References.get_films_by_reference(viewings)
|
films_by_reference = FilmsByReference.get_films_by_reference(viewings)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_hidden_themes:
|
if update_hidden_themes:
|
||||||
hidden_themes = get_hidden_themes(viewings, token_id, token_secret)
|
hidden_themes = HiddenThemes.get_hidden_themes(viewings, token_id, token_secret)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_keyword_scores:
|
if update_keyword_scores:
|
||||||
keyword_scores = get_keyword_scores(viewings)
|
keyword_scores = KeywordScores.get_keywordScores(viewings)
|
||||||
bar.next()
|
bar.next()
|
||||||
|
|
||||||
bar.finish()
|
bar.finish()
|
||||||
|
|
||||||
with IncrementalBar('Generating pages', max=update_page_count, check_tty=False) as bar:
|
with IncrementalBar('Generating pages', max=update_page_count, check_tty=False) as bar:
|
||||||
if update_films_by_year:
|
if update_films_by_year:
|
||||||
films_by_year_page = build_films_by_year_page(films_by_year)
|
films_by_year_page = FilmsByYear.build_page(films_by_year)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_films_by_country:
|
if update_films_by_country:
|
||||||
films_by_country_page = build_films_by_country_page(films_by_country)
|
films_by_country_page = FilmsByCountry.build_page(films_by_country)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_film_references:
|
if update_film_references:
|
||||||
films_by_reference_page = References.build_page(films_by_reference)
|
films_by_reference_page = FilmsByReference.build_page(films_by_reference)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_hidden_themes:
|
if update_hidden_themes:
|
||||||
hidden_themes_page = build_hidden_themes_page(hidden_themes)
|
hidden_themes_page = HiddenThemes.build_page(hidden_themes)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_keyword_scores:
|
if update_keyword_scores:
|
||||||
keyword_scores_page = build_keyword_scores_page(keyword_scores)
|
keyword_scores_page = KeywordScores.build_page(keyword_scores)
|
||||||
bar.next()
|
bar.next()
|
||||||
|
|
||||||
bar.finish()
|
bar.finish()
|
||||||
|
|
||||||
with IncrementalBar('Updating pages', max=update_page_count, check_tty=False) as bar:
|
with IncrementalBar('Updating pages', max=update_page_count, check_tty=False) as bar:
|
||||||
if update_films_by_year:
|
if update_films_by_year:
|
||||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FILMS_BY_YEAR_PAGE_ID, markdown=films_by_year_page)
|
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FilmsByYear.PAGE_ID, markdown=films_by_year_page)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_films_by_country:
|
if update_films_by_country:
|
||||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FILMS_BY_COUNTRY_PAGE_ID, markdown=films_by_country_page)
|
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FilmsByCountry.PAGE_ID, markdown=films_by_country_page)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_film_references:
|
if update_film_references:
|
||||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, References.PAGE_ID, markdown=films_by_reference_page)
|
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FilmsByReference.PAGE_ID, markdown=films_by_reference_page)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_hidden_themes:
|
if update_hidden_themes:
|
||||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, HIDDEN_THEMES_PAGE_ID, markdown=hidden_themes_page)
|
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, HiddenThemes.PAGE_ID, markdown=hidden_themes_page)
|
||||||
bar.next()
|
bar.next()
|
||||||
if update_keyword_scores:
|
if update_keyword_scores:
|
||||||
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, KEYWORD_SCORES_PAGE_ID, markdown=keyword_scores_page)
|
Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, KeywordScores.PAGE_ID, markdown=keyword_scores_page)
|
||||||
bar.next()
|
bar.next()
|
||||||
|
|
||||||
bar.finish()
|
bar.finish()
|
||||||
|
@ -10,7 +10,7 @@ import warnings
|
|||||||
warnings.filterwarnings("ignore")
|
warnings.filterwarnings("ignore")
|
||||||
|
|
||||||
# Page ID of https://wiki.jacknet.io/books/vcinema/page/films-by-country
|
# Page ID of https://wiki.jacknet.io/books/vcinema/page/films-by-country
|
||||||
FILMS_BY_COUNTRY_PAGE_ID = 34
|
PAGE_ID = 34
|
||||||
|
|
||||||
|
|
||||||
def get_films_by_country(viewings):
|
def get_films_by_country(viewings):
|
@ -3,7 +3,7 @@ from collections import OrderedDict
|
|||||||
from vcinema_utils import VCinemaUtils
|
from vcinema_utils import VCinemaUtils
|
||||||
|
|
||||||
# Page ID of https://wiki.jacknet.io/books/vcinema/page/films-by-release-year
|
# Page ID of https://wiki.jacknet.io/books/vcinema/page/films-by-release-year
|
||||||
FILMS_BY_YEAR_PAGE_ID = 24
|
PAGE_ID = 24
|
||||||
|
|
||||||
|
|
||||||
def get_films_by_year(viewings):
|
def get_films_by_year(viewings):
|
@ -3,7 +3,7 @@ from collections import OrderedDict
|
|||||||
from vcinema_utils import VCinemaUtils
|
from vcinema_utils import VCinemaUtils
|
||||||
|
|
||||||
# Page ID of https://wiki.jacknet.io/books/vcinema/page/films-by-reference
|
# Page ID of https://wiki.jacknet.io/books/vcinema/page/films-by-reference
|
||||||
HIDDEN_THEMES_PAGE_ID = 63
|
PAGE_ID = 63
|
||||||
|
|
||||||
|
|
||||||
def get_hidden_themes(viewings, token_id, token_secret):
|
def get_hidden_themes(viewings, token_id, token_secret):
|
@ -7,7 +7,7 @@ from imdb_utils import IMDbUtils
|
|||||||
from vcinema_utils import VCinemaUtils
|
from vcinema_utils import VCinemaUtils
|
||||||
|
|
||||||
# Page ID of https://wiki.jacknet.io/books/vcinema/page/keyword-scores
|
# Page ID of https://wiki.jacknet.io/books/vcinema/page/keyword-scores
|
||||||
KEYWORD_SCORES_PAGE_ID = 23
|
PAGE_ID = 23
|
||||||
|
|
||||||
|
|
||||||
def get_keyword_scores(viewings):
|
def get_keyword_scores(viewings):
|
@ -5,7 +5,7 @@ from bookstack import Bookstack
|
|||||||
from vcinema_utils import VCinemaUtils
|
from vcinema_utils import VCinemaUtils
|
||||||
|
|
||||||
# Page ID of https://wiki.jacknet.io/books/vcinema/page/csv
|
# Page ID of https://wiki.jacknet.io/books/vcinema/page/csv
|
||||||
CSV_PAGE_ID = 11
|
PAGE_ID = 11
|
||||||
|
|
||||||
|
|
||||||
def update_viewings_csv(token_id, token_secret, check_existing=True):
|
def update_viewings_csv(token_id, token_secret, check_existing=True):
|
Loading…
x
Reference in New Issue
Block a user