diff options
-rw-r--r-- | tirante/__init__.py | 14 | ||||
-rw-r--r-- | tirante/__main__.py | 21 | ||||
-rw-r--r-- | tirante/chim_man.py | 2 | ||||
-rw-r--r-- | tirante/cr_dat.py | 8 | ||||
-rw-r--r-- | tirante/down_man.py | 6 | ||||
-rw-r--r-- | tirante/tests/__init__.py | 22 | ||||
-rw-r--r-- | tirante/tests/basic_tests.py | 71 | ||||
-rw-r--r-- | tirante/up_dat.py | 6 |
8 files changed, 38 insertions, 112 deletions
diff --git a/tirante/__init__.py b/tirante/__init__.py index afe9d9e..91be884 100644 --- a/tirante/__init__.py +++ b/tirante/__init__.py @@ -20,13 +20,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -from .version import __version__ -from .cr_dat import create_database -from .up_dat import update_database -from .down_man import download_manga +from version import __version__ +from cr_dat import create_database +from up_dat import update_database +from down_man import download_manga # If somebody does "from package import *", this is what they will # be able to access: -__all__ = [create_database, - update_database, - download_manga] +__all__ = ['create_database', + 'update_database', + 'download_manga'] diff --git a/tirante/__main__.py b/tirante/__main__.py index be5f1b0..3a639c6 100644 --- a/tirante/__main__.py +++ b/tirante/__main__.py @@ -20,5 +20,24 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ +from cr_dat import create_database + +# Main manga source. +MAIN_URL = 'https://manganelo.com/manga/' +# Manga name. +MANGA_NAME = 'Kimetsu no Yaiba' +# Manga name in the form of how appears in the url. +MANGA_NAME_URL = 'kimetsu_no_yaiba/' + +# PC main file location. +MANGA_DIR = 'E:\\Mangas\\' +# PC main manga data location. +MANGA_DATA_DIR = ''.join(['C:\\Users\\Lorentzeus\\Google Drive\\', + 'Personal\\Python\\tirante\\test_data']) + if __name__ == "__main__": - pass + create_database(main_url=MAIN_URL, + manga_name_url=MANGA_NAME_URL, + manga_name=MANGA_NAME, + manga_dir=MANGA_DIR, + manga_data_dir=MANGA_DATA_DIR) diff --git a/tirante/chim_man.py b/tirante/chim_man.py index d5e171e..bafb368 100644 --- a/tirante/chim_man.py +++ b/tirante/chim_man.py @@ -20,7 +20,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -from .gcil import get_chapter_image_list +from gcil import get_chapter_image_list def chapter_image_list_to_csv(chapter_data): diff --git a/tirante/cr_dat.py b/tirante/cr_dat.py index a49cdaf..37a98af 100644 --- a/tirante/cr_dat.py +++ b/tirante/cr_dat.py @@ -23,10 +23,10 @@ SOFTWARE. import os # Project specific imports. -from .gcl import get_chapters_list -from .ch_man import chapters_list_to_csv -from .ch_man import chapters_csv_to_list -from .chim_man import chapter_image_list_to_csv +from gcl import get_chapters_list +from ch_man import chapters_list_to_csv +from ch_man import chapters_csv_to_list +from chim_man import chapter_image_list_to_csv def create_database(main_url, diff --git a/tirante/down_man.py b/tirante/down_man.py index 1d9a4f4..171a5f2 100644 --- a/tirante/down_man.py +++ b/tirante/down_man.py @@ -23,9 +23,9 @@ SOFTWARE. import os # Project specific imports. -from .ch_man import chapters_csv_to_list -from .chim_man import chapter_image_csv_to_list -from .do_man import download_chapter +from ch_man import chapters_csv_to_list +from chim_man import chapter_image_csv_to_list +from do_man import download_chapter def download_manga(manga_name, diff --git a/tirante/tests/__init__.py b/tirante/tests/__init__.py deleted file mode 100644 index e1d9a32..0000000 --- a/tirante/tests/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -"""MIT License - -Copyright (c) 2019 David Luevano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -"""
\ No newline at end of file diff --git a/tirante/tests/basic_tests.py b/tirante/tests/basic_tests.py deleted file mode 100644 index a8d941c..0000000 --- a/tirante/tests/basic_tests.py +++ /dev/null @@ -1,71 +0,0 @@ -"""MIT License - -Copyright (c) 2019 David Luevano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -""" -from tirante import create_database - -# Main manga source. -MAIN_URL = 'https://manganelo.com/manga/' -# Manga name. -MANGA_NAME = 'Kimetsu no Yaiba' -# Manga name in the form of how appears in the url. -MANGA_NAME_URL = 'kimetsu_no_yaiba/' - -# PC main file location. -MANGA_DIR = 'E:\\Mangas\\' -# PC main manga data location. -MANGA_DATA_DIR = ''.join(['C:\\Users\\Lorentzeus\\Google Drive\\', - 'Personal\\Python\\tirante\\test_data']) - -create_database(main_url=MAIN_URL, - manga_name_url=MANGA_NAME_URL, - manga_name=MANGA_NAME) -# update_database() -# download_manga() - -# print(os.listdir()) - -# chapter_csv_to_df(chapter_csv='kimetsu_no_yaiba.csv') -# download_manga() - -# chapter_list = get_chapters_list() -# for chapter in chapter_list: -# print(chapter) - -# chapters_list_to_csv(chapters_list=chapter_list) - -# os.chdir('data/kimetsu_no_yaiba') -# for image in chapter_image_csv_to_list('chapter_1_cruelty.csv'): -# print(image) - -# chapters_list = chapters_csv_to_list(chapter_csv='kimetsu_no_yaiba.csv') - -# chapter_image_list_to_csv(chapters_list[0]) - - -# first_chapter_img_url_list = get_chapter_image_list(chapter_list[0]) - -# download_image(first_chapter_img_url_list[0]) - - -# os.chdir(MANGA_DIR) - -# download_chapter(first_chapter_img_url_list) diff --git a/tirante/up_dat.py b/tirante/up_dat.py index d2bfb63..5834563 100644 --- a/tirante/up_dat.py +++ b/tirante/up_dat.py @@ -24,9 +24,9 @@ SOFTWARE. import os # Project specific imports. -from .gcl import get_chapters_list -from .ch_man import chapters_csv_to_list -from .chim_man import chapter_image_list_to_csv +from gcl import get_chapters_list +from ch_man import chapters_csv_to_list +from chim_man import chapter_image_list_to_csv def update_database(main_url, |