8"""Command line to print ROOT files contents on ps,pdf or png,gif..."""
14description =
"Print ROOT files contents on ps,pdf or pictures files"
16DIRECTORY_HELP =
"put output files in a subdirectory named DIRECTORY."
17DIVIDE_HELP =
"divide the canvas ont the format 'x','y' (ex: 2,2)"
18DRAW_HELP =
"specify draw option"
19FORMAT_HELP =
"specify output format (ex: pdf, png)."
20OUTPUT_HELP =
"merge files in a file named OUTPUT (only for ps and pdf)."
21SIZE_HELP =
"specify canvas size on the format 'width'x'height' (ex: 600x400)"
22STYLE_HELP =
"specify a C file name which define a style"
23VERBOSE_HELP =
"print informations about the running"
24RECURSIVE_HELP =
"Traverse file recursively entering any TDirectory."
27- rootprint example.root:hist
28 Create a pdf file named 'hist.pdf' which contain the histogram 'hist'.
30- rootprint -d histograms example.root:hist
31 Create a pdf file named 'hist.pdf' which contain the histogram 'hist' and put it in the directory 'histograms' (create it if not already exists).
33- rootprint -f png example.root:hist
34 Create a png file named 'hist.png' which contain the histogram 'hist'.
36- rootprint -o histograms.pdf example.root:hist*
37 Create a pdf file named 'histograms.pdf' which contain all histograms whose name starts with 'hist'. It works also with postscript.
43 parser.prog =
'rootprint'
44 parser.add_argument(
"-d",
"--directory", help=DIRECTORY_HELP)
45 parser.add_argument(
"--divide", help=DIVIDE_HELP)
46 parser.add_argument(
"-D",
"--draw", default=
"", help=DRAW_HELP)
47 parser.add_argument(
"-f",
"--format", help=FORMAT_HELP)
48 parser.add_argument(
"-o",
"--output", help=OUTPUT_HELP)
49 parser.add_argument(
"-s",
"--size", help=SIZE_HELP)
50 parser.add_argument(
"-S",
"--style", help=STYLE_HELP)
51 parser.add_argument(
"-v",
"--verbose", action=
"store_true", help=VERBOSE_HELP)
52 parser.add_argument(
"-r",
"--recursive", action=
"store_true", help=RECURSIVE_HELP)
63 divideOption = optDict[
"divide"], drawOption = optDict[
"draw"], \
64 formatOption = optDict[
"format"], \
65 outputOption = optDict[
"output"], sizeOption = optDict[
"size"], \
66 styleOption = optDict[
"style"], verboseOption = optDict[
"verbose"], \
67 recursiveOption = optDict[
"recursive"])
68if __name__ ==
"__main__":
rootPrint(sourceList, directoryOption=None, divideOption=None, drawOption="", formatOption=None, outputOption=None, sizeOption=None, styleOption=None, verboseOption=False, recursiveOption=False)
getSourceListOptDict(parser, wildcards=True)
Get the list of tuples and the dictionary with options.
getParserFile(theHelp, theEpilog="")
Get a commandline parser with the defaults of the commandline utils and a list of source files.