Skip to content

Commit

Permalink
Remove support for custom x-kde-os attribute for screenshots
Browse files Browse the repository at this point in the history
This is no longer needed now that appstream has an officially
supported attribute for this.
  • Loading branch information
ingokloecker authored and Ingo Klöcker committed Oct 2, 2023
1 parent 6df5130 commit 4202d58
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions py_appstream/subcomponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,11 @@ def __init__(self):
self.caption = {}
self.thumbnails = []
self.source = None
self.os = ''
self.environment = ''

def parse_tree(self, node, lang_code_func=None):
""" Parse a <screenshot> object """
self.default = node.get('type', '') == 'default'
self.os = node.get('x-kde-os', '')
self.environment = node.get('environment', '')
for c3 in node:
if c3.tag == 'caption':
Expand Down
2 changes: 1 addition & 1 deletion tests/test.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<caption xml:lang="x-test">xx"Mixing color of paint" activityxx</caption>
<image width="1600" height="1040">https://gcompris.net/screenshots_qt/large/color_mix.png</image>
</screenshot>
<screenshot environment="windows" x-kde-os="windows">
<screenshot environment="windows">
<caption>Main view with room list, chat, and room information pane</caption>
<image>https://cdn.kde.org/screenshots/neochat/NeoChat-Windows-Timeline.png</image>
</screenshot>
Expand Down
3 changes: 0 additions & 3 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,11 @@ def test_screenshots(self):
self.assertEqual({'C', 'ca'}, set(screenshots[2].caption.keys()))
# environment attribute
self.assertEqual('windows', self.component.screenshots[4].environment)
# x-kde-os attribute
self.assertEqual('windows', self.component.screenshots[4].os)
# serialization
self.assertIn('source-image', self.obj['Screenshots'][0])
self.assertEqual('https://gcompris.net/screenshots_qt/large/color_mix.png',
self.obj['Screenshots'][3]['source-image']['url'])
self.assertEqual('windows', self.obj['Screenshots'][4]['environment'])
self.assertEqual('windows', self.obj['Screenshots'][4]['os'])

def test_provide(self):
provide = self.component.provides
Expand Down

0 comments on commit 4202d58

Please sign in to comment.