Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
weboob
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
133
Issues
133
List
Boards
Labels
Milestones
Merge Requests
41
Merge Requests
41
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
6dad6938
Commit
6dad6938
authored
Oct 25, 2012
by
Laurent Bachelier
🐧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
weboob-debug: ability to prefer a shell
parent
92244a4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
weboobdebug.py
weboob/applications/weboobdebug/weboobdebug.py
+11
-5
No files found.
weboob/applications/weboobdebug/weboobdebug.py
View file @
6dad6938
...
...
@@ -19,16 +19,23 @@
import
sys
from
optparse
import
OptionGroup
from
weboob.tools.application.
console
import
Consol
eApplication
from
weboob.tools.application.
base
import
Bas
eApplication
class
WeboobDebug
(
Consol
eApplication
):
class
WeboobDebug
(
Bas
eApplication
):
APPNAME
=
'weboobdebug'
VERSION
=
'0.d'
COPYRIGHT
=
'Copyright(C) 2010-2011 Christophe Benz'
DESCRIPTION
=
"Weboob-Debug is a console application to debug backends."
def
__init__
(
self
,
option_parser
=
None
):
super
(
WeboobDebug
,
self
)
.
__init__
(
option_parser
)
options
=
OptionGroup
(
self
.
_parser
,
'Weboob-Debug options'
)
options
.
add_option
(
'-B'
,
'--bpython'
,
action
=
'store_true'
,
help
=
'Prefer bpython over ipython'
)
self
.
_parser
.
add_option_group
(
options
)
def
load_default_backends
(
self
):
pass
...
...
@@ -41,7 +48,7 @@ class WeboobDebug(ConsoleApplication):
try
:
backend_name
=
argv
[
1
]
except
IndexError
:
print
>>
sys
.
stderr
,
'
Syntax
:
%
s BACKEND'
%
argv
[
0
]
print
>>
sys
.
stderr
,
'
Usage
:
%
s BACKEND'
%
argv
[
0
]
return
1
try
:
backend
=
self
.
weboob
.
load_backends
(
names
=
[
backend_name
])[
backend_name
]
...
...
@@ -53,8 +60,7 @@ class WeboobDebug(ConsoleApplication):
banner
=
'Weboob debug shell
\n
Backend "
%
s" loaded.
\n
Available variables:
\n
'
%
backend_name
\
+
'
\n
'
.
join
([
'
%
s:
%
s'
%
(
k
,
v
)
for
k
,
v
in
locs
.
iteritems
()])
prefer_bpython
=
False
# TODO user-configurable
if
prefer_bpython
:
if
self
.
options
.
bpython
:
funcs
=
[
self
.
bpython
,
self
.
ipython
,
self
.
python
]
else
:
funcs
=
[
self
.
ipython
,
self
.
bpython
,
self
.
python
]
...
...
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