Commit 0e98f01b authored by Romain Bignon's avatar Romain Bignon

bnp_list.py script to display comptes list

parent 2493d6ca
#!/usr/bin/env python2.5
# -*- coding: utf-8 -*-
"""
Copyright(C) 2009 Romain Bignon
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""
import sys
from optparse import OptionParser
from bnporc.browser import BNPorc
def getparser():
parser = OptionParser(usage="%prog [options]")
parser.add_option('-u', '--username', help="Compte ID", type="str")
parser.add_option('-p', '--password', help="Compte password", type="str")
return parser
if __name__ == '__main__':
parser = getparser()
options, arguments = parser.parse_args()
if arguments:
parser.print_help()
sys.exit(1)
bnp = BNPorc(options.username, options.password)
comptes = bnp.get_comptes_list()
print ' Compte Solde À venir '
print '+---------------------+--------------+-------------+'
for compte in comptes:
print ' %-20s %11.2f %11.2f' % (compte['label'],
compte['solde'],
compte['avenir'])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment