aboutsummaryrefslogtreecommitdiffstats
path: root/doxygen/siphon-process
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-11-01 15:07:32 -0400
committerDave Wallace <dwallacelf@gmail.com>2019-11-05 21:08:27 +0000
commit464e5e0bfebc71c646e5c182535898cc7018236b (patch)
treedb15d3d283afb96b9fa1b84928c2c434bb9bf775 /doxygen/siphon-process
parentea1a65135e01311e31e94b8d0ed0721c9856775d (diff)
docs: fix 'make doxygen' under python3
The 'make doxygen' component has this cool vpp specific customization called siphon. This updates the siphon component so that 'make doxygen' works with python3. Needed-By: https://gerrit.fd.io/r/23159 Type: docs Change-Id: Ie29f1602bf3460b637058acbb0a2f19b128a8824 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'doxygen/siphon-process')
-rwxr-xr-xdoxygen/siphon-process34
1 files changed, 20 insertions, 14 deletions
diff --git a/doxygen/siphon-process b/doxygen/siphon-process
index 698da8828e1..411bf72f0f0 100755
--- a/doxygen/siphon-process
+++ b/doxygen/siphon-process
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (c) 2016 Comcast Cable Communications Management, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,39 +17,45 @@
# The idea is to siphon off certain initializers so that we can better
# auto-document the contents of that initializer.
-import os, sys, argparse, logging
+import argparse
+import logging
+import os
+import sys
+
import siphon
DEFAULT_LOGFILE = None
DEFAULT_LOGLEVEL = "info"
-DEFAULT_SIPHON ="clicmd"
+DEFAULT_SIPHON = "clicmd"
DEFAULT_FORMAT = "markdown"
DEFAULT_OUTPUT = None
DEFAULT_TEMPLATES = os.path.dirname(__file__) + "/siphon_templates"
ap = argparse.ArgumentParser()
ap.add_argument("--log-file", default=DEFAULT_LOGFILE,
- help="Log file [%s]" % DEFAULT_LOGFILE)
+ help="Log file [%s]" % DEFAULT_LOGFILE)
ap.add_argument("--log-level", default=DEFAULT_LOGLEVEL,
- choices=["debug", "info", "warning", "error", "critical"],
- help="Logging level [%s]" % DEFAULT_LOGLEVEL)
+ choices=["debug", "info", "warning", "error", "critical"],
+ help="Logging level [%s]" % DEFAULT_LOGLEVEL)
ap.add_argument("--type", '-t', metavar="siphon_type", default=DEFAULT_SIPHON,
- choices=siphon.process.siphons.keys(),
- help="Siphon type to process [%s]" % DEFAULT_SIPHON)
+ choices=siphon.process.siphons.keys(),
+ help="Siphon type to process [%s]" % DEFAULT_SIPHON)
ap.add_argument("--format", '-f', default=DEFAULT_FORMAT,
- choices=siphon.process.formats.keys(),
- help="Output format to generate [%s]" % DEFAULT_FORMAT)
+ choices=siphon.process.formats.keys(),
+ help="Output format to generate [%s]" % DEFAULT_FORMAT)
ap.add_argument("--output", '-o', metavar="file", default=DEFAULT_OUTPUT,
- help="Output file (uses stdout if not defined) [%s]" % DEFAULT_OUTPUT)
+ help="Output file (uses stdout if not defined) [%s]" %
+ DEFAULT_OUTPUT)
ap.add_argument("--templates", metavar="directory", default=DEFAULT_TEMPLATES,
- help="Path to render templates directory [%s]" % DEFAULT_TEMPLATES)
+ help="Path to render templates directory [%s]" %
+ DEFAULT_TEMPLATES)
ap.add_argument("input", nargs='+', metavar="input_file",
- help="Input .siphon files")
+ help="Input .siphon files")
args = ap.parse_args()
logging.basicConfig(filename=args.log_file,
- level=getattr(logging, args.log_level.upper(), None))
+ level=getattr(logging, args.log_level.upper(), None))
log = logging.getLogger("siphon_process")
# Determine where to send the generated output