Coverage for src/pyrsslocal/__main__.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v6.4.2, created at 2023-02-02 02:59 +0100

1# -*- coding: utf-8 -*- 

2""" 

3@file 

4@brief Implements command line ``python -m pyrsslocal <command> <args>``. 

5 

6.. versionadded:: 0.9 

7""" 

8import sys 

9 

10 

11def main(args, fLOG=print): 

12 """ 

13 Implements ``python -m pyrsslocal <command> <args>``. 

14 

15 @param args command line arguments 

16 @param fLOG logging function 

17 """ 

18 from pyquickhelper.cli import cli_main_helper 

19 try: 

20 from .cli.merge_rss import compile_rss_blogs 

21 except ImportError: # pragma: no cover 

22 from pyrsslocal.cli.merge_rss import compile_rss_blogs 

23 

24 fcts = dict(compile_rss_blogs=compile_rss_blogs) 

25 return cli_main_helper(fcts, args=args, fLOG=fLOG) 

26 

27 

28if __name__ == "__main__": 

29 main(sys.argv[1:]) # pragma: no cover