commit:     c11a833333cc5a9e9b0ce885caddef5a3b593fc4
Author:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 10 15:50:27 2016 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Thu Nov 10 15:50:27 2016 +0000
URL:        https://gitweb.gentoo.org/proj/grumpy.git/commit/?id=c11a8333

Normalize subproject inherit-members to True or False during parsing

 backend/lib/sync.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/backend/lib/sync.py b/backend/lib/sync.py
index 7139119..291d701 100644
--- a/backend/lib/sync.py
+++ b/backend/lib/sync.py
@@ -43,8 +43,8 @@ def sync_projects():
                 if 'ref' in elem.attrib:
                     if 'subprojects' not in proj:
                         proj['subprojects'] = []
-                    # subprojects will be a list of (subproject_email, 
inherit-members) tuples where inherit-members is None, 0 or 1 (if dtd is 
followed). TODO: Might change if sync code will want it differently
-                    proj['subprojects'].append((elem.attrib['ref'], 
elem.attrib['inherit-members'] if 'inherit-members' in elem.attrib else None))
+                    # subprojects will be a list of (subproject_email, 
inherit-members) tuples where inherit-members is True or False. TODO: Might 
change if sync code will want it differently
+                    proj['subprojects'].append((elem.attrib['ref'], True if 
('inherit-members' in elem.attrib and elem.attrib['inherit-members'] == '1') 
else False))
                 else:
                     print("Invalid <subproject> tag inside project %s - 
required 'ref' attribute missing" % proj['email'] if 'email' in proj else 
"<unknown>")
             else:

Reply via email to