Coverage for src/pyrsslocal/helper/subscription_helper.py: 67%

6 statements  

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

1""" 

2@file 

3@brief Various functions about subscriptions 

4""" 

5 

6_example_subscriptions = """ 

7<?xml version="1.0" encoding="UTF-8"?> 

8<opml version="1.0"> 

9<body> 

10 

11<outline text="XD Blog" 

12 title="XD Blog" 

13 type="rss" 

14 xmlUrl="http://www.xavierdupre.fr/blog/xdbrss.xml" 

15 htmlUrl="http://www.xavierdupre.fr/blog/xd_blog.html" /> 

16 

17</body> 

18</opml> 

19""" 

20 

21 

22def write_subscriptions_example(filename=None): 

23 """ 

24 returns an example of a subscriptions file 

25 

26 @param filename if not None, saves the string in that file 

27 @return example 

28 """ 

29 if filename is not None: 

30 with open(filename, "w", encoding="utf8") as f: 

31 f.write(_example_subscriptions) 

32 

33 return _example_subscriptions