source: OpenWorkouts-current/ow/tasks/run.py @ 715671f

current
Last change on this file since 715671f was 715671f, checked in by Borja Lopez <borja@…>, 3 years ago

(#77) Bulk workouts upload:

  • Added methods to extract files from compressed bulk files, then load workouts from those files.
  • Added a task to process/load workouts from "not loaded" bulk files
  • Added full tests coverage
  • Property mode set to 100644
File size: 652 bytes
Line 
1import sys
2
3from ow.tasks.manager import TasksManager
4from ow.tasks.mail import queue_processor
5from ow.tasks.bulk import process_compressed_files
6
7
8def command_line():
9    tasks_manager = TasksManager()
10
11    # "register" the tasks
12    tasks_manager.add_task('send_emails', queue_processor)
13    tasks_manager.add_task('bulk_import', process_compressed_files)
14
15    if len(sys.argv) != 3:
16        tasks_manager.usage(sys.argv[0])
17        sys.exit(1)
18
19    script_name = sys.argv[0]
20    ini_file = sys.argv[1]
21    action = sys.argv[2]
22
23    tasks_manager.run(script_name, ini_file, action)
24
25
26if __name__ == '__main__':
27    command_line()  # pragma no cover
Note: See TracBrowser for help on using the repository browser.