<commit_before>#!/usr/bin/env python

# ROOT command line tools: rootprint
# Author: <NAME>
# Mail: <EMAIL>
# Date: 20/08/15

"""Command line to print ROOT files contents on ps,pdf or png,gif..."""

import cmdLineUtils
import sys

# Help strings
COMMAND_HELP = "Print ROOT files contents on ps,pdf or pictures files"

DIRECTORY_HELP = "put output files in a subdirectory named DIRECTORY."
DIVIDE_HELP = "divide the canvas ont the format 'x'.'y' (ex: 2.2)"
DRAW_HELP = "specify draw option"
FORMAT_HELP = "specify output format (ex: pdf, png)."
OUTPUT_HELP = "merge files in a file named OUTPUT (only for ps and pdf)."
SIZE_HELP = "specify canvas size on the format 'width'x'height' (ex: 600x400)"
STYLE_HELP = "specify a C file name which define a style"
VERBOSE_HELP = "print informations about the running"

EPILOG = """Examples:
- rooprint example.root:hist
  Create a pdf file named 'hist.pdf' which contain the histogram 'hist'.

- rooprint -d histograms example.root:hist
  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).

- rooprint -f png example.root:hist
  Create a png file named 'hist.png' which contain the histogram 'hist'.

- rooprint -o histograms.pdf example.root:hist*
  Create a pdf file named 'histograms.pdf' which contain all histograms whose name starts with 'hist'. It works also with postscript.
"""

def execute():
    # Collect arguments with the module argparse
    parser = cmdLineUtils.getParserFile(COMMAND_HELP, EPILOG)
    parser.add_argument("-d", "--directory", help=DIRECTORY_HELP)
    parser.add_argument("--divide", help=DIVIDE_HELP)
    parser.add_argument("-D", "--draw", default="",  help=DRAW_HELP)
    parser.add_argument("-f", "--outputFormat", help=FORMAT_HELP)
    parser.add_argument("-o", "--output", help=OUTPUT_HELP)
    parser.add_argument("-s", "--size", help=SIZE_HELP)
    parser.add_argument("-S", "--style", help=STYLE_HELP)
    parser.add_argument("-v", "--verbose", action="store_true", help=VERBOSE_HELP)

    # Put arguments in shape
    sourceList, optDict = cmdLineUtils.getSourceListOptDict(parser)

    # Process rootPrint
    return cmdLineUtils.rootPrint(sourceList, directory = optDict["directory"], \
                                  divide = optDict["divide"], draw = optDict["draw"], \
                                  outputFormat = optDict["outputFormat"], \
                                  output = optDict["output"], size = optDict["size"], \
                                  style = optDict["style"], verbose = optDict["verbose"])

sys.exit(execute())
<commit_msg>Disable the divide option for the moment<commit_after>#!/usr/bin/env python

# ROOT command line tools: rootprint
# Author: <NAME>
# Mail: <EMAIL>
# Date: 20/08/15

"""Command line to print ROOT files contents on ps,pdf or png,gif..."""

import cmdLineUtils
import sys

# Help strings
COMMAND_HELP = "Print ROOT files contents on ps,pdf or pictures files"

DIRECTORY_HELP = "put output files in a subdirectory named DIRECTORY."
DIVIDE_HELP = "divide the canvas ont the format 'x','y' (ex: 2,2)"
DRAW_HELP = "specify draw option"
FORMAT_HELP = "specify output format (ex: pdf, png)."
OUTPUT_HELP = "merge files in a file named OUTPUT (only for ps and pdf)."
SIZE_HELP = "specify canvas size on the format 'width'x'height' (ex: 600x400)"
STYLE_HELP = "specify a C file name which define a style"
VERBOSE_HELP = "print informations about the running"

EPILOG = """Examples:
- rooprint example.root:hist
  Create a pdf file named 'hist.pdf' which contain the histogram 'hist'.

- rooprint -d histograms example.root:hist
  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).

- rooprint -f png example.root:hist
  Create a png file named 'hist.png' which contain the histogram 'hist'.

- rooprint -o histograms.pdf example.root:hist*
  Create a pdf file named 'histograms.pdf' which contain all histograms whose name starts with 'hist'. It works also with postscript.
"""

def execute():
    # Collect arguments with the module argparse
    parser = cmdLineUtils.getParserFile(COMMAND_HELP, EPILOG)
    parser.add_argument("-d", "--directory", help=DIRECTORY_HELP)
    #parser.add_argument("--divide", help=DIVIDE_HELP)
    parser.add_argument("-D", "--draw", default="",  help=DRAW_HELP)
    parser.add_argument("-f", "--outputFormat", help=FORMAT_HELP)
    parser.add_argument("-o", "--output", help=OUTPUT_HELP)
    parser.add_argument("-s", "--size", help=SIZE_HELP)
    parser.add_argument("-S", "--style", help=STYLE_HELP)
    parser.add_argument("-v", "--verbose", action="store_true", help=VERBOSE_HELP)

    # Put arguments in shape
    sourceList, optDict = cmdLineUtils.getSourceListOptDict(parser)

    # Process rootPrint
    return cmdLineUtils.rootPrint(sourceList, directory = optDict["directory"], \
                                  #divide = optDict["divide"], draw = optDict["draw"], \
                                  draw = optDict["draw"], \
                                  outputFormat = optDict["outputFormat"], \
                                  output = optDict["output"], size = optDict["size"], \
                                  style = optDict["style"], verbose = optDict["verbose"])

sys.exit(execute())

{'fraction_non_alphanumeric': 0.12265028847943421, 'fraction_numerical': 0.005211241392145915, 'mean_word_length': 3.470881863560732, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5490828', 'n_tokens_mistral': 1679, 'n_tokens_neox': 1614, 'n_words': 518}