#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
# gen_components
# A simple script to generate (on stdout), the component.html web page
#
# Hashtable of RE's, RM's and Teams keyed by component path.
owners = {}
# Initial HTML for the generated web page.
preamble = """
<html>
<head>
@import '/css/demo_table.css';
@import '/css/ColVis.css';
@import '/css/ColReorder.css';
tr.even:hover, tr.even:hover td.sorting_1 ,
tr.odd:hover, tr.odd:hover td.sorting_1 {
background-color: gold;
}
</style>
<script type='text/javascript' src='js/jquery.js'></script>
<script type='text/javascript' src='js/jquery.dataTables.js'></script>
<script type='text/javascript' src='js/ColReorder.js'></script>
<script type='text/javascript' src='js/ColVis.js'></script>
<script>
$('#components').dataTable({
bPaginate: true,
bFilter: true,
bSort: true,
iDisplayLength: -1,
aLengthMenu: [ [ 10, 50, -1], [ 10, 50, 'All'] ]
});
});
</script>
</head>
<body>
<h1>Userland Components</h1>
<p>
<table align='center' id='components'>
<thead>
<tr>
<th>Component</th>
<th>Version</th>
<th>Gate Path</th>
<th>Package(s)</th>
<th>ARC Case(s)</th>
<th>License(s)</th>
<th>TPNO</th>
<th>BugDB</th>
<th>RE</th>
<th>RM</th>
<th>Team</th>
</tr>
</thead>
<tbody>
"""
# Final HTML for the generated web page.
postamble = """
</tr>
</tbody>
</table>
</body>
</html>
"""
# Return a hashtable of RE's, RM's and Teams keyed by component path.
if debug:
try:
if debug:
owners = {}
return owners
# Return a sorted list of the directories containing one or more .p5m files.
p5m_dirs = []
continue;
# Write out the initial HTML for the components.html web page.
print preamble
# Return the RE, RM and Team for this component.
component_path = ""
if started:
if token == "components":
if debug:
return result
# Generate an HTML table entry for all the information for the component
# in the given directory. This generates a file called 'component-report'
# under the components build directory.
if debug:
targets = "clean component-hook"
template = "cd %s; "
template += "RESPONSIBLE_ENGINEER='%s' "
template += "RESPONSIBLE_MANAGER='%s' "
template += "TEAM='%s' "
template += "gmake COMPONENT_HOOK='gmake %s component-report' %s"
if debug:
# Collect all the .../build/component-report files and write them to stdout.
if debug:
try:
if debug:
# Write out the final HTML for the components.html web page.
print postamble
# Write out a usage message showing valid options to this script.
print >> sys.stderr, \
"""
Usage:
gen-components [OPTION...]
-d, --debug
Turn on debugging
-o, --owners
Location of a file containing a list of RE's /RM's per component
-w --workspace
Location of the Userland workspace
"""
sys.exit(1)
if __name__ == "__main__":
try:
[ "debug", "owners=", "workspace=" ])
usage()
else:
sys.exit(0)