You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2018/10/18 14:39:09 UTC
svn commit: r1844249 - in /poi/site: README.txt
src/documentation/content/xdocs/status.copy_module_from_bugzilla.py
Author: nick
Date: Thu Oct 18 14:39:09 2018
New Revision: 1844249
URL: http://svn.apache.org/viewvc?rev=1844249&view=rev
Log:
Have the status generator say more what it is doing, and more in the readme on how (I think...) to use it
Modified:
poi/site/README.txt
poi/site/src/documentation/content/xdocs/status.copy_module_from_bugzilla.py
Modified: poi/site/README.txt
URL: http://svn.apache.org/viewvc/poi/site/README.txt?rev=1844249&r1=1844248&r2=1844249&view=diff
==============================================================================
--- poi/site/README.txt (original)
+++ poi/site/README.txt Thu Oct 18 14:39:09 2018
@@ -18,8 +18,10 @@ To generate the site for POI:
4. modify documentation files in ./src
-5. fetch the changelog from Bugzilla
- TODO More details on how to do this!
+5. fetch the changelog from Bugzilla, and merge this with the changes file
+ cd src/documentation/content/xdocs
+ python3 status.copy_module_from_bugzilla.py changes.xml status.xml
+ TODO Is this fully correct?
6. run "ant site" - it will generate the complete web site
To build only javadocs run "ant javadocs"
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=1844249&r1=1844248&r2=1844249&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 Thu Oct 18 14:39:09 2018
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,7 +23,8 @@ It'd be far better to have Forrest look
Hopefully this is a one time effort
If a closed bug's component is changed in Bugzilla, this script could be used to keep the changelog in sync.
-requires Python 2.7 or 3.1+
+requires Python 3.1+
+(Python 2.x doesn't do Unicode in CSVs nicely)
"""
import csv, io
@@ -36,6 +37,7 @@ def get_fixesbug_attr(line):
return bugs
def get_bugzilla_bug_to_component():
+ print("Fetching details of POI bugs, please wait...")
bugzilla_bug_to_component = {}
r = requests.get('https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__all__&limit=0&no_redirect=1&product=POI&query_format=advanced&ctype=csv&human=1')
with io.StringIO(r.text) as f:
@@ -58,7 +60,9 @@ def add_module_frombugzilla_attr(line):
line is a string, containing the <action> opening tag
"""
global bugzilla_bug_to_component
- assert 'module' not in line
+ assert 'module' not in line, \
+ "Invalid action line, should not already contain module: %s" % 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(unique(modules))
@@ -66,6 +70,7 @@ def add_module_frombugzilla_attr(line):
return line_with_module_frombugzilla
def add_module_attribute(inputfile, outputfile):
+ print("Generating %s from %s and Bugzilla details"%(outputfile,inputfile))
with open(inputfile, 'r') as infile, open(outputfile, 'w') as outfile:
for line in infile:
if '<action ' in line and ' fixes-bug=' in line and ' module=' not in line:
@@ -81,3 +86,4 @@ if __name__ == '__main__':
else:
bugzilla_bug_to_component = get_bugzilla_bug_to_component()
add_module_attribute(sys.argv[1], sys.argv[2])
+ print("Generation complete!")
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org