Author: onealj
Date: Mon Aug  7 00:58:14 2017
New Revision: 1804280

URL: http://svn.apache.org/viewvc?rev=1804280&view=rev
Log:
don't add duplicate modules to status.xml

Modified:
    poi/site/src/documentation/content/xdocs/status.copy_module_from_bugzilla.py

Modified: 
poi/site/src/documentation/content/xdocs/status.copy_module_from_bugzilla.py
URL: 
http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/status.copy_module_from_bugzilla.py?rev=1804280&r1=1804279&r2=1804280&view=diff
==============================================================================
--- 
poi/site/src/documentation/content/xdocs/status.copy_module_from_bugzilla.py 
(original)
+++ 
poi/site/src/documentation/content/xdocs/status.copy_module_from_bugzilla.py 
Mon Aug  7 00:58:14 2017
@@ -45,6 +45,13 @@ def get_bugzilla_bug_to_component():
     return bugzilla_bug_to_component
 
 
+def unique(seq):
+    seen = set()
+    for x in seq:
+        if x not in seen:
+            seen.add(x)
+            yield x
+
 def add_module_frombugzilla_attr(line):
     """Add module_frombugzilla="XSSF" to <action ...> tag
 
@@ -54,7 +61,7 @@ def add_module_frombugzilla_attr(line):
     assert 'module-frombugzilla' not in line
     bugs = [x.strip() for x in get_fixesbug_attr(line).split(',')]
     modules = filter(bool, [bugzilla_bug_to_component.get(bug) for bug in 
bugs])
-    module_frombugzilla = ','.join(modules)
+    module_frombugzilla = ','.join(unique(modules))
     line_with_module_frombugzilla = line.replace('>', ' 
module="{}">'.format(module_frombugzilla), 1)
     return line_with_module_frombugzilla
 
@@ -73,4 +80,4 @@ if __name__ == '__main__':
         print('Usage: python changelog.py inputfile outputfile')
     else:
         bugzilla_bug_to_component = get_bugzilla_bug_to_component()
-        add_module_attribute(sys.argv[1], sys.argv[2])
\ No newline at end of file
+        add_module_attribute(sys.argv[1], sys.argv[2])



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org
For additional commands, e-mail: commits-h...@poi.apache.org

Reply via email to