Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
result = []
if os.path.isfile(asciidoc_file):
options = ''
for line in open(asciidoc_file):
mo = re.search(r'^//\s*a2x:', line)
if mo:
options += ' ' + line[mo.end():].strip()
parse_options()
return result
#####################################################################
# Application class
#####################################################################
class A2X(AttrDict):
'''
a2x options and conversion functions.
'''
def execute(self):
'''
Process a2x command.
'''
self.process_options()
# Append configuration file options.
self.asciidoc_opts += ' ' + ASCIIDOC_OPTS
self.dblatex_opts += ' ' + DBLATEX_OPTS
self.fop_opts += ' ' + FOP_OPTS
self.xsltproc_opts += ' ' + XSLTPROC_OPTS
# Execute to_* functions.
self.__getattribute__('to_'+self.format)()