Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
#pylint: disable-msg=
"""
File       : mkdqmedanlzr
Author     : Marco Rovere
Description: mkdqmedanlzr code
"""

# system modules
import sys
import argparse

if  sys.version_info < (2, 6):
    raise Exception("This script requires python 2.6 or greater")

# package modules
from FWCore.Skeletons.cms import generate, config_with_parser

def pkg_help():
    "mkdqmedanlzr help function"
    msg  = '\nmkdqmedanlzr script to generate CMS DQMEDAnalyzer code'
    msg += '\nOutput : '
    msg += """
        MyAnalyzer/
        |  plugins/
        |  |-- BuildFile.xml
        |  |-- MyAnalyzer.cc
        |  python/
        |  |-- ExampleConfig_cfg.py
        |  test/
        |  doc/
        """
    return msg

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description=pkg_help(), formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument('-author', '--author', help="Author of the package")
    parser.add_argument('-debug', '--debug', help="Enable debugging", action='store_true', default=False)
    parser.add_argument('subpackage_name', help="Subpackage's name that will host the newly created code")
    parser.add_argument('example', help="Kind of DQM Module to generate", choices=['example_stream', 'example_global'])
    args = parser.parse_args()
    generate(config_with_parser('DQMEDAnalyzer', args))