/usr/lib/python2.7/dist-packages/ofxclient/util.py is in python-ofxclient 1.3.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | from ofxclient.client import Client
from StringIO import StringIO
def combined_download(accounts, days=60):
"""Download OFX files and combine them into one
It expects an 'accounts' list of ofxclient.Account objects
as well as an optional 'days' specifier which defaults to 60
"""
client = Client(institution=None)
out_file = StringIO()
out_file.write(client.header())
for a in accounts:
ofx = a.download(days=days).read()
stripped = ofx.partition('<OFX>')[2].partition('</OFX>')[0]
out_file.write(stripped)
out_file.write("<OFX>")
out_file.seek(0)
return out_file
|