优化相关设备的格式显示
This commit is contained in:
parent
b18805aa26
commit
4a3eaf87e8
6 changed files with 67 additions and 142 deletions
|
|
@ -11,14 +11,14 @@ class RSSGenerator:
|
|||
self.link = link
|
||||
self.language = language
|
||||
|
||||
def generate_rss(self, items: List[Dict[str, Any]]) -> str:
|
||||
def generate_rss(self, items: List[Dict[str, Any]], motdTitle: str = None) -> str:
|
||||
"""生成RSS XML"""
|
||||
# 创建根元素
|
||||
rss = ET.Element("rss", version="2.0")
|
||||
channel = ET.SubElement(rss, "channel")
|
||||
|
||||
# 频道信息
|
||||
ET.SubElement(channel, "title").text = self.title
|
||||
ET.SubElement(channel, "title").text = motdTitle or self.title
|
||||
ET.SubElement(channel, "description").text = self.description
|
||||
ET.SubElement(channel, "link").text = self.link
|
||||
ET.SubElement(channel, "language").text = self.language
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue