Coverage for src/pyrsslocal/helper/subscription_helper.py: 67%
6 statements
« prev ^ index » next coverage.py v7.1.0, created at 2024-04-30 08:45 +0200
« prev ^ index » next coverage.py v7.1.0, created at 2024-04-30 08:45 +0200
1"""
2@file
3@brief Various functions about subscriptions
4"""
6_example_subscriptions = """
7<?xml version="1.0" encoding="UTF-8"?>
8<opml version="1.0">
9<body>
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" />
17</body>
18</opml>
19"""
22def write_subscriptions_example(filename=None):
23 """
24 returns an example of a subscriptions file
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)
33 return _example_subscriptions