Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
"""Called from console script
"""
parser = _createOptionParser(usage=usage)
(options, args) = parser.parse_args()
if options.rules is None:
if len(args) == 2 and options.theme is None:
options.rules, options.theme = args
elif len(args) == 1:
options.rules, = args
else:
parser.error('Wrong number of arguments.')
elif args:
parser.error('Wrong number of arguments.')
if options.trace:
logger.setLevel(logging.DEBUG)
xsl_params = None
def main():
"""Called from console script
"""
op = _createOptionParser(usage=usage)
op.add_option(
'-x',
'--xsl',
metavar='transform.xsl',
help='XSL transform',
dest='xsl',
default=None,
)
op.add_option(
'--path',
metavar='PATH',
help='URI path',
dest='path',
default=None,
)
op.add_option(
def main():
"""Called from console script
"""
parser = _createOptionParser(usage=usage)
parser.add_option(
'-s',
'--stop',
metavar='n',
type='int',
help='Stop preprocessing at stage n',
dest='stop',
default=None,
)
(options, args) = parser.parse_args()
if options.rules is None:
if len(args) == 2 and options.theme is None:
options.rules, options.theme = args
elif len(args) == 1:
options.rules, = args