Commit 08e7d3ec authored by ntome's avatar ntome

boomoney and weboob-debug: get rid of optparse

parent d57a7379
Pipeline #2077 failed with stages
in 1 minute and 8 seconds
......@@ -32,9 +32,8 @@ import os
import re
import subprocess
import datetime
from optparse import OptionGroup
import shutil
from colorama import init, Fore, Style
from weboob.tools.compat import unicode
......@@ -365,13 +364,12 @@ class Boomoney(Boobank):
def __init__(self):
super(Boobank, self).__init__()
self.importIndex = 0
application_options = OptionGroup(self._parser, 'Boomoney Options')
application_options.add_option('-F', '--force', action='store_true', help='forces the retrieval of transactions (10 maximum), otherwise retrieves only the transactions newer than the previous retrieval date')
application_options.add_option('-A', '--account', help='retrieves only the specified account. By default, all accounts are retrieved')
application_options.add_option('-N', '--noimport', action='store_true', help='no import. Generates the files, but they are not imported in MSMoney. Last import dates are not modified')
application_options.add_option('-D', '--display', action='store_true', help='displays the generated OFX file')
application_options.add_option('-P', '--parallel', action='store_true', help='retrieves all accounts in parallel instead of one by one (experimental)')
self._parser.add_option_group(application_options)
application_options = self._parser.add_argument_group('Boomoney Options')
application_options.add_argument('-F', '--force', action='store_true', help='forces the retrieval of transactions (10 maximum), otherwise retrieves only the transactions newer than the previous retrieval date')
application_options.add_argument('-A', '--account', help='retrieves only the specified account. By default, all accounts are retrieved')
application_options.add_argument('-N', '--noimport', action='store_true', help='no import. Generates the files, but they are not imported in MSMoney. Last import dates are not modified')
application_options.add_argument('-D', '--display', action='store_true', help='displays the generated OFX file')
application_options.add_argument('-P', '--parallel', action='store_true', help='retrieves all accounts in parallel instead of one by one (experimental)')
self.labels = dict()
def print(self, *args):
......
......@@ -19,8 +19,6 @@
from __future__ import print_function
from optparse import OptionGroup
from weboob.tools.application.base import Application
from weboob.browser.elements import generate_table_element
......@@ -34,9 +32,8 @@ class WeboobDebug(Application):
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)
options = self._parser.add_argument_group('Weboob-Debug options')
options.add_argument('-B', '--bpython', action='store_true', help='Prefer bpython over ipython')
def load_default_backends(self):
pass
......
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