Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# The file is already OFX 2 -- return it unaltered, ignoring
# any of the parameters passed to this method.
return text
elif filetype.startswith("OFX"):
if verbose: sys.stderr.write("Converting to OFX/2.0...\n")
# This will throw a ParseException if it is unable to recognize
# the source format.
response = ofx.Response(text, debug=debug)
return response.as_xml(original_format=filetype)
elif filetype == "OFC":
if verbose: sys.stderr.write("Beginning OFC conversion...\n")
converter = ofxtools.OfcConverter(text, fid=fid, org=org, curdef=curdef,
lang=lang, debug=debug)
# This will throw a ParseException if it is unable to recognize
# the source format.
if verbose:
sys.stderr.write("Converting to OFX/1.02...\n\n%s\n\n" %
converter.to_ofx102())
sys.stderr.write("Converting to OFX/2.0...\n")
return converter.to_xml()
elif filetype == "QIF":
if verbose: sys.stderr.write("Beginning QIF conversion...\n")
converter = ofxtools.QifConverter(text, fid=fid, org=org,
bankid=bankid, accttype=accttype,
acctid=acctid, balance=balance,