Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
weboob
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
178
Issues
178
List
Boards
Labels
Milestones
Merge Requests
49
Merge Requests
49
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
weboob
weboob
Commits
8bb58b6f
Commit
8bb58b6f
authored
Apr 14, 2010
by
Christophe Benz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move boobank useful code into weboob.frontends.boobank
parent
2f452599
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
59 deletions
+107
-59
scripts/boobank
scripts/boobank
+1
-58
scripts/monfric
scripts/monfric
+1
-1
weboob/frontends/boobank/__init__.py
weboob/frontends/boobank/__init__.py
+22
-0
weboob/frontends/boobank/boobank.py
weboob/frontends/boobank/boobank.py
+83
-0
No files found.
scripts/boobank
View file @
8bb58b6f
...
...
@@ -20,64 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""
from
__future__
import
with_statement
import
sys
import
weboob
from
weboob.capabilities.bank
import
ICapBank
,
AccountNotFound
from
weboob.tools.application
import
ConsoleApplication
class
Boobank
(
ConsoleApplication
):
APPNAME
=
'boobank'
def
main
(
self
,
argv
):
self
.
weboob
.
load_backends
(
ICapBank
)
return
self
.
process_command
(
*
argv
[
1
:])
@
ConsoleApplication
.
command
(
'List every available accounts'
)
def
command_list
(
self
):
accounts
=
[]
for
name
,
backend
,
in
self
.
weboob
.
iter_backends
():
try
:
for
account
in
backend
.
iter_accounts
():
accounts
.
append
(
'
%17
s
%-20
s
%11.2
f
%11.2
f'
%
(
account
.
id
,
account
.
label
,
account
.
balance
,
account
.
coming
))
except
weboob
.
tools
.
browser
.
BrowserIncorrectPassword
:
print
>>
sys
.
stderr
,
'Error: Incorrect password for backend
%
s'
%
name
return
1
if
len
(
accounts
):
print
' ID Account Balance Coming '
print
'+-----------------+---------------------+--------------+-------------+'
print
'
\n
'
.
join
(
accounts
)
else
:
print
'No accounts found'
@
ConsoleApplication
.
command
(
'Display all future operations'
)
def
command_coming
(
self
,
id
):
operations
=
[]
found
=
0
for
name
,
backend
in
self
.
weboob
.
iter_backends
():
try
:
account
=
backend
.
get_account
(
id
)
except
AccountNotFound
:
if
found
==
0
:
found
=
-
1
else
:
found
=
1
for
operation
in
backend
.
iter_operations
(
account
):
operations
.
append
(
'
%8
s
%-50
s
%11.2
f'
%
(
operation
.
date
,
operation
.
label
,
operation
.
amount
))
if
found
<
0
:
print
>>
sys
.
stderr
,
"Error: account
%
s not found"
%
id
return
1
else
:
if
operations
:
print
' Date Label Amount '
print
'+----------+----------------------------------------------------+-------------+'
print
'
\n
'
.
join
(
operations
)
else
:
print
'No coming operations for ID=
%
s'
%
id
from
weboob.frontends.boobank
import
Boobank
if
__name__
==
'__main__'
:
Boobank
.
run
()
scripts/monfric
View file @
8bb58b6f
...
...
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""
from
weboob.frontends.boobank
.monfric
import
MonFric
from
weboob.frontends.boobank
import
MonFric
if
__name__
==
'__main__'
:
MonFric
.
run
()
weboob/frontends/boobank/__init__.py
View file @
8bb58b6f
# -*- coding: utf-8 -*-
"""
Copyright(C) 2010 Christophe Benz
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.
"""
from
.boobank
import
Boobank
from
.monfric
import
MonFric
weboob/frontends/boobank/boobank.py
0 → 100644
View file @
8bb58b6f
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ft=python et softtabstop=4 cinoptions=4 shiftwidth=4 ts=4 ai
"""
Copyright(C) 2009-2010 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.
"""
from
__future__
import
with_statement
import
sys
import
weboob
from
weboob.capabilities.bank
import
ICapBank
,
AccountNotFound
from
weboob.tools.application
import
ConsoleApplication
class
Boobank
(
ConsoleApplication
):
APPNAME
=
'boobank'
def
main
(
self
,
argv
):
self
.
weboob
.
load_backends
(
ICapBank
)
return
self
.
process_command
(
*
argv
[
1
:])
@
ConsoleApplication
.
command
(
'List every available accounts'
)
def
command_list
(
self
):
accounts
=
[]
for
name
,
backend
,
in
self
.
weboob
.
iter_backends
():
try
:
for
account
in
backend
.
iter_accounts
():
accounts
.
append
(
'
%17
s
%-20
s
%11.2
f
%11.2
f'
%
(
account
.
id
,
account
.
label
,
account
.
balance
,
account
.
coming
))
except
weboob
.
tools
.
browser
.
BrowserIncorrectPassword
:
print
>>
sys
.
stderr
,
'Error: Incorrect password for backend
%
s'
%
name
return
1
if
len
(
accounts
):
print
' ID Account Balance Coming '
print
'+-----------------+---------------------+--------------+-------------+'
print
'
\n
'
.
join
(
accounts
)
else
:
print
'No accounts found'
@
ConsoleApplication
.
command
(
'Display all future operations'
)
def
command_coming
(
self
,
id
):
operations
=
[]
found
=
0
for
name
,
backend
in
self
.
weboob
.
iter_backends
():
try
:
account
=
backend
.
get_account
(
id
)
except
AccountNotFound
:
if
found
==
0
:
found
=
-
1
else
:
found
=
1
for
operation
in
backend
.
iter_operations
(
account
):
operations
.
append
(
'
%8
s
%-50
s
%11.2
f'
%
(
operation
.
date
,
operation
.
label
,
operation
.
amount
))
if
found
<
0
:
print
>>
sys
.
stderr
,
"Error: account
%
s not found"
%
id
return
1
else
:
if
operations
:
print
' Date Label Amount '
print
'+----------+----------------------------------------------------+-------------+'
print
'
\n
'
.
join
(
operations
)
else
:
print
'No coming operations for ID=
%
s'
%
id
if
__name__
==
'__main__'
:
Boobank
.
run
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment