|
1 | 1 | from queue import Queue |
2 | 2 | from threading import Thread |
3 | 3 | from glouton.commands.download.downloadCommandParams import DownloadCommandParams |
4 | | -from glouton.commands.download.payloadDownloadCommand import PayloadDownloadCommand |
| 4 | +from glouton.commands.download.archiveDownloadCommand import ArchiveDownloadCommand |
5 | 5 | from glouton.workers.downloadWorker import DownloadWorker |
6 | 6 | from glouton.workers.moduleWorker import ModuleWorker |
7 | 7 | from glouton.domain.interfaces.downloadable import Downloadable |
8 | 8 | from glouton.shared import threadHelper |
9 | 9 | from threading import Event |
10 | 10 |
|
11 | 11 |
|
12 | | -class PayloadRepo(Downloadable): |
| 12 | +class ArchiveRepo(Downloadable): |
13 | 13 | def __init__(self, working_dir, modules): |
14 | 14 | self.__working_dir = working_dir |
15 | | - self.__payload_commands = Queue() |
16 | | - self.__payload_modules_commands = Queue() |
| 15 | + self.__archive_commands = Queue() |
| 16 | + self.__archive_modules_commands = Queue() |
17 | 17 | self.__modules = modules |
18 | 18 | self.__download_status = Event() |
19 | 19 |
|
20 | 20 | def register_command(self, observation, start_date, end_date): |
21 | 21 | cmd_parameters = DownloadCommandParams( |
22 | 22 | self.__working_dir, self.__create_dir_name('archive', start_date, end_date), self.__modules) |
23 | | - waterfallDownloadCommand = PayloadDownloadCommand( |
24 | | - cmd_parameters, observation, self.__payload_modules_commands) |
25 | | - self.__payload_commands.put(waterfallDownloadCommand) |
| 23 | + waterfallDownloadCommand = ArchiveDownloadCommand( |
| 24 | + cmd_parameters, observation, self.__archive_modules_commands) |
| 25 | + self.__archive_commands.put(waterfallDownloadCommand) |
26 | 26 |
|
27 | 27 | def create_worker(self): |
28 | 28 | threads = [] |
29 | 29 | downloadWorker = DownloadWorker( |
30 | | - self.__payload_commands, self.__download_status) |
| 30 | + self.__archive_commands, self.__download_status) |
31 | 31 | threads.append(threadHelper.create_thread(downloadWorker.execute)) |
32 | 32 | if self.__modules is not None: |
33 | 33 | moduleWorker = ModuleWorker( |
34 | | - self.__payload_modules_commands, self.__download_status) |
| 34 | + self.__archive_modules_commands, self.__download_status) |
35 | 35 | threads.append(threadHelper.create_thread(moduleWorker.execute)) |
36 | 36 |
|
37 | 37 | return threads |
|
0 commit comments