-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2631 from mitya57/metainfo
Add AppStream metainfo file
- Loading branch information
Showing
5 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import markdown | ||
import re | ||
import sys | ||
import xml.etree.ElementTree as ET | ||
|
||
[changelog_file, xml_template_file, xml_output_file] = sys.argv[1:] | ||
|
||
with open(changelog_file) as fp: | ||
md_text = fp.read() | ||
|
||
html_content = markdown.markdown(md_text) | ||
html_root = ET.fromstring(f"<root>{html_content}</root>") | ||
release_re = re.compile(r"(?P<version>[\d.]+) (?P<type>[a-z]+) \((?P<date>\d{4}-\d{2}-\d{2})\)") | ||
|
||
tree = ET.parse(xml_template_file) | ||
releases = tree.getroot().find("releases") | ||
release_elem = None | ||
|
||
for elem in html_root: | ||
if elem.tag == "h2": | ||
if elem.text[0].isdecimal(): | ||
match = release_re.match(elem.text) | ||
release = match.groupdict() | ||
if release["type"] == "beta": | ||
release["type"] = "development" | ||
release_elem = ET.SubElement(releases, "release", release) | ||
elif elem.tag == "ul" and release_elem is not None: | ||
for child_elem in elem.iter(): | ||
# https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description | ||
if child_elem.tag == "strong": | ||
child_elem.tag = "em" | ||
desc_elem = ET.SubElement(release_elem, "description") | ||
desc_elem.append(elem) | ||
|
||
ET.indent(tree) | ||
tree.write(xml_output_file, encoding="utf-8", xml_declaration=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<component type="desktop-application"> | ||
<id>io.github.elfmz.far2l</id> | ||
|
||
<name>far2l</name> | ||
<summary>Linux port of FAR v2</summary> | ||
<categories> | ||
<category>Utility</category> | ||
<category>FileManager</category> | ||
<category>System</category> | ||
<category>FileTools</category> | ||
</categories> | ||
<url type="homepage">https://github.com/elfmz/far2l</url> | ||
<developer id="io.github.elfmz"> | ||
<name>elfmz</name> | ||
</developer> | ||
<content_rating type="oars-1.1"/> | ||
|
||
<metadata_license>CC0-1.0</metadata_license> | ||
<project_license>GPL-2.0 and BSD-3-Clause</project_license> | ||
|
||
<description> | ||
<p> | ||
This is a clone of FAR manager for Windows, similar, but more powerful than Norton Commander/Midnight Commander. | ||
</p> | ||
<p> | ||
Plug-ins that are currently working: | ||
</p> | ||
<ul> | ||
<li>align</li> | ||
<li>autowrap</li> | ||
<li>calc</li> | ||
<li>colorer</li> | ||
<li>compare</li> | ||
<li>drawline</li> | ||
<li>editcase</li> | ||
<li>editorcomp</li> | ||
<li>filecase</li> | ||
<li>incsrch</li> | ||
<li>inside</li> | ||
<li>multiarc</li> | ||
<li>NetRocks (SFTP/SCP/FTP/FTPS/SMB/NFS/WebDAV)</li> | ||
<li>python</li> | ||
<li>SimpleIndent</li> | ||
<li>tmppanel</li> | ||
</ul> | ||
</description> | ||
|
||
<launchable type="desktop-id">far2l.desktop</launchable> | ||
|
||
<releases/> | ||
</component> |