Exemplo n.º 1
0
def download_thread(thread_id, chan, board, folder, output, condition,
                    dupe_check):
    thread_downloader = downloader.downloader(thread_id, board, chan, output,
                                              folder, True, condition,
                                              dupe_check)
    t = threading.Thread(target=thread_downloader.download)
    t.daemon = True
    t.start()
Exemplo n.º 2
0
 def download_thread(self, thread_id, chan, board, folder, output,
                     condition, dupe_check, tag_list):
     thread_downloader = downloader.downloader(thread_id, board, chan,
                                               output, folder, True,
                                               condition, dupe_check,
                                               tag_list, self.logger)
     t = threading.Thread(target=thread_downloader.download)
     t.daemon = True
     t.start()
Exemplo n.º 3
0
    def download_thread(self, thread_id:int, chan:str, board:str, folder:str, output:str, condition:dict, dupe_check:bool, tag_list:list, throttle:int):
        """
        Create a downloader object with the info passed as paramater and start the download of in a new thread.
        """

        thread_downloader = downloader.downloader(thread_id, board,chan, output, folder, True, condition, dupe_check, tag_list, throttle, self.logger)
        t = threading.Thread(target=thread_downloader.download)
        t.daemon = True
        t.start()
Exemplo n.º 4
0
print('\x1b[6;30;42m' + 'OK' + '\x1b[0m')

print('\x1b[6;30;42m' + 'All test OK for imageboard_info.py' + '\x1b[0m')

print("Testing download.py")

# Creating download object
condition = {
    "ext": False,
    "filename": False,
    "width": False,
    "height": False,
}
download = downloader.downloader(list_of_threads[0], 'a', "4chan", ".",
                                 "testci", True, condition, True,
                                 ["travistag1", "ci:travistag2"],
                                 logging.getLogger())

print("--------------------------------------------------------")
print("!!! download.load not tested yet !!!                   -")
print("--------------------------------------------------------")

print("--------------------------------------------------------")
print("Testing: download.add_to_downloaded_log                -")
print("Testing: download.was_downloaded                       -")
print("--------------------------------------------------------")

os.system("echo " " > test_download_log.txt")
download.add_to_downloaded_log("my_filename")
if 'my_filename' not in open(download.downloaded_log).read():
    print("'my_filename' is not in {0}".format(download.downloaded_log))
Exemplo n.º 5
0
    print("chan_image_subfolder wrong for uboachan")
    exit(1)

if info_uboachan.image_base_url != "https://uboachan.net/":
    print("chan_image_base_url wrong for uboachan")
    exit(1)

print('\x1b[6;30;42m' + 'OK' + '\x1b[0m')

print('\x1b[6;30;42m' + 'All test OK for imageboard_info.py' + '\x1b[0m')

print("Testing download.py")

# Creating download object
condition = {"ext": False, "filename": False, "width": False, "height": False, }
download = downloader.downloader(list_of_threads[0], 'a',"4chan", ".", "testci", True, condition, True, ["travistag1", "ci:travistag2"], logging.getLogger())

print("--------------------------------------------------------")
print("!!! download.load not tested yet !!!                   -")
print("--------------------------------------------------------")

print("--------------------------------------------------------")
print("Testing: download.create_dir                           -")
print("--------------------------------------------------------")

# Creating directory
download.create_dir("test_create_dir")
if not os.path.exists("test_create_dir"):
    print("'test_create_dir' was not created")
    exit(1)
Exemplo n.º 6
0
 def download_thread(self, thread_id, chan, board, folder, output, condition, dupe_check, tag_list):
     thread_downloader = downloader.downloader(thread_id, board,chan, output, folder, True, condition, dupe_check, tag_list, self.logger)
     t = threading.Thread(target=thread_downloader.download)
     t.daemon = True
     t.start()
Exemplo n.º 7
0
    exit(1)

print('\x1b[6;30;42m' + 'OK' + '\x1b[0m')

print('\x1b[6;30;42m' + 'All test OK for imageboard_info.py' + '\x1b[0m')

print("Testing download.py")

# Creating download object
condition = {
    "ext": False,
    "filename": False,
    "width": False,
    "height": False,
}
download = downloader.downloader(list_of_threads[0], 'a', "4chan", ".",
                                 "testci", True, condition, True)

print("--------------------------------------------------------")
print("!!! download.load not tested yet !!!                   -")
print("--------------------------------------------------------")

print("--------------------------------------------------------")
print("Testing: download.create_dir                           -")
print("--------------------------------------------------------")

# Creating directory
download.create_dir("test_create_dir")
if not os.path.exists("test_create_dir"):
    print("'test_create_dir' was not created")
    exit(1)