aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevan Franchini <twitch153@gentoo.org>2015-07-21 12:37:53 -0400
committerDevan Franchini <twitch153@gentoo.org>2015-07-21 12:37:53 -0400
commit8133bd98d60e3e1ed38fa75662ae9b070a156336 (patch)
treebafcab803f478461d06daa952ad13024f599e246
parentexternal.py: Adds json DB testing (diff)
downloadlayman-8133bd98d60e3e1ed38fa75662ae9b070a156336.tar.gz
layman-8133bd98d60e3e1ed38fa75662ae9b070a156336.tar.bz2
layman-8133bd98d60e3e1ed38fa75662ae9b070a156336.zip
overlay.py: Adds optional license attribute to overlay object
-rwxr-xr-xlayman/overlays/overlay.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index c6a0cee..8f31a76 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -237,6 +237,11 @@ class Overlay(object):
else:
self.priority = 50
+ if 'license' in overlay:
+ self.license = encode(overlay['license'])
+ else:
+ self.license = None
+
if 'homepage' in overlay:
self.homepage = encode(overlay['homepage'])
else:
@@ -352,6 +357,11 @@ class Overlay(object):
else:
self.priority = 50
+ if '@license' in json:
+ self.license = encode(json['@license'])
+ else:
+ self.license = None
+
if 'homepage' in json:
self.homepage = encode(json['homepage'])
else:
@@ -486,6 +496,11 @@ class Overlay(object):
else:
self.priority = 50
+ if 'license' in xml.attrib:
+ self.license = encode(xml.attrib['license'])
+ else:
+ self.license = None
+
h = xml.find('homepage')
l = xml.find('link')
@@ -641,6 +656,8 @@ class Overlay(object):
repo['@quality'] = self.quality
if self.status != None:
repo['@status'] = self.status
+ if self.license != None:
+ repo['@license'] = self.license
repo['name'] = self.name
repo['description'] = []
for i in self.descriptions:
@@ -677,6 +694,8 @@ class Overlay(object):
repo.attrib['status'] = self.status
repo.attrib['quality'] = self.quality
repo.attrib['priority'] = str(self.priority)
+ if self.license != None:
+ repo.attrib['license'] = self.license
name = ET.Element('name')
name.text = self.name
repo.append(name)