# Path: turbulenz_tools/utils/xml_json.py
# def xml2json(xml_string, strip=True, indent=0, convert_types=False):
#     """Convert an XML string into a JSON string."""
#     elem = ElementTree.fromstring(xml_string)
#     return elem2json(elem, strip=strip, indent=indent, convert_types=convert_types)
# 
# Path: turbulenz_tools/tools/stdtool.py
# def simple_options(parser_fn, version, dependencies, input_required=True):
#     parser = parser_fn()
#     (options, args) = parser.parse_args()
# 
#     if options.output_version:
#         standard_output_version(version, dependencies, getattr(options, 'output', None))
#         exit(0)
# 
#     if input_required:
#         # Not all tools have an input file, so we print help for no args as well.
#         try:
#             if options.input is None:
#                 print "ERROR: no input files specified"
#                 parser.print_help()
#                 exit(1)
#         except AttributeError:
#             if len(args) == 0:
#                 print "ERROR: no input files specified"
#                 parser.print_help()
#                 exit(1)
# 
#     # Not all tools have a metrics option.
#     try:
#         metrics = options.metrics
#     except AttributeError:
#         metrics = False
# 
#     if options.silent:
#         logging.basicConfig(level=logging.CRITICAL)
#     elif options.verbose or metrics:
#         logging.basicConfig(level=logging.INFO)
#     else:
#         logging.basicConfig(level=logging.WARNING)
# 
#     return (options, args, parser)


import logging
from re import sub
from optparse import OptionParser, OptionGroup, TitledHelpFormatter
from turbulenz_tools.utils.xml_json import xml2json
from turbulenz_tools.tools.stdtool import simple_options
#!/usr/bin/env python
# Copyright (c) 2010-2013 Turbulenz Limited




__version__ = '1.0.0'
__dependencies__ = ['turbulenz_tools.utils.xml_json']

LOG = logging.getLogger(__name__)

def _parser():
    usage = "usage: %prog [options] -i source.xml -o output.json"
    description = "Convert XML assets into a structured JSON asset."

    parser = OptionParser(description=description, usage=usage, formatter=TitledHelpFormatter())
    parser.add_option("--version", action="store_true", dest="output_version", default=False,

# Path: turbulenz_tools/utils/xml_json.py
# def xml2json(xml_string, strip=True, indent=0, convert_types=False):
#     """Convert an XML string into a JSON string."""
#     elem = ElementTree.fromstring(xml_string)
#     return elem2json(elem, strip=strip, indent=indent, convert_types=convert_types)
# 
# Path: turbulenz_tools/tools/stdtool.py
# def simple_options(parser_fn, version, dependencies, input_required=True):
#     parser = parser_fn()
#     (options, args) = parser.parse_args()
# 
#     if options.output_version:
#         standard_output_version(version, dependencies, getattr(options, 'output', None))
#         exit(0)
# 
#     if input_required:
#         # Not all tools have an input file, so we print help for no args as well.
#         try:
#             if options.input is None:
#                 print "ERROR: no input files specified"
#                 parser.print_help()
#                 exit(1)
#         except AttributeError:
#             if len(args) == 0:
#                 print "ERROR: no input files specified"
#                 parser.print_help()
#                 exit(1)
# 
#     # Not all tools have a metrics option.
#     try:
#         metrics = options.metrics
#     except AttributeError:
#         metrics = False
# 
#     if options.silent:
#         logging.basicConfig(level=logging.CRITICAL)
#     elif options.verbose or metrics:
#         logging.basicConfig(level=logging.INFO)
#     else:
#         logging.basicConfig(level=logging.WARNING)
# 
#     return (options, args, parser)


# Path: turbulenz_tools/tools/xml2json.py
import logging
from re import sub
from optparse import OptionParser, OptionGroup, TitledHelpFormatter
from turbulenz_tools.utils.xml_json import xml2json
from turbulenz_tools.tools.stdtool import simple_options

#!/usr/bin/env python
# Copyright (c) 2010-2013 Turbulenz Limited




__version__ = '1.0.0'
__dependencies__ = ['turbulenz_tools.utils.xml_json']

LOG = logging.getLogger(__name__)

def _parser():
    usage = "usage: %prog [options] -i source.xml -o output.json"
    description = "Convert XML assets into a structured JSON asset."

    parser = OptionParser(description=description, usage=usage, formatter=TitledHelpFormatter())
    parser.add_option("--version", action="store_true", dest="output_version", default=False,

                      help="output version number")