Commit a64c9f2e authored by Florent Fourcot's avatar Florent Fourcot

Rename BaseApplication to Application

parent 5a1d83b5
#!/usr/bin/python
# -*- coding: utf-8 -*-
from weboob.tools.application.base import BaseApplication
from weboob.tools.application.base import Application
import os
import re
import subprocess
class Weboobmc(BaseApplication):
class Weboobmc(Application):
def __init__(self, count=10):
BaseApplication.__init__(self)
Application.__init__(self)
self.count = int(count)
self._is_default_count = False
......
......@@ -29,7 +29,7 @@ from webob import exc
from wsgiref.simple_server import make_server
from weboob.capabilities.video import CapVideo
from weboob.tools.application.base import BaseApplication
from weboob.tools.application.base import Application
__all__ = ['VideoobWeb']
......@@ -39,7 +39,7 @@ template_lookup = TemplateLookup(directories=[os.path.join(os.path.dirname(__fil
output_encoding='utf-8', encoding_errors='replace')
class VideoobWeb(BaseApplication):
class VideoobWeb(Application):
APPNAME = 'videoob-webserver'
VERSION = '0.j'
COPYRIGHT = 'Copyright(C) 2010-2011 Christophe Benz'
......
......@@ -27,7 +27,7 @@ import optparse
import re
import time
from weboob.tools.application.base import BaseApplication
from weboob.tools.application.base import Application
BASE_PATH = os.path.join(os.path.dirname(__file__), os.pardir)
DEST_DIR = 'man'
......@@ -126,7 +126,7 @@ def main():
print "Loaded %s" % fname
# Find the applications we can handle
for klass in script.__dict__.itervalues():
if inspect.isclass(klass) and issubclass(klass, BaseApplication):
if inspect.isclass(klass) and issubclass(klass, Application):
analyze_application(klass, fname)
finally:
# Cleanup compiled files if needed
......
......@@ -769,7 +769,7 @@ class Boobathon(ReplApplication):
def load_default_backends(self):
"""
Overload a BaseApplication method.
Overload a Application method.
"""
for instance_name, backend_name, params in self.weboob.backends_config.iter_backends():
if backend_name != 'redmine':
......
......@@ -19,7 +19,7 @@
from weboob.capabilities.travel import CapTravel
from weboob.tools.application.base import BaseApplication
from weboob.tools.application.base import Application
from logging import warning
import gtk
......@@ -275,7 +275,7 @@ class MasstransitHildon():
hildon.hildon_gtk_window_set_progress_indicator(self.main_window, 0)
class Masstransit(BaseApplication):
class Masstransit(Application):
"Application Class"
APPNAME = 'masstransit'
VERSION = '1.0'
......
......@@ -20,10 +20,10 @@
from optparse import OptionGroup
from weboob.tools.application.base import BaseApplication
from weboob.tools.application.base import Application
class WeboobDebug(BaseApplication):
class WeboobDebug(Application):
APPNAME = 'weboobdebug'
VERSION = '1.0'
COPYRIGHT = 'Copyright(C) 2010-2011 Christophe Benz'
......
......@@ -37,7 +37,7 @@ from weboob.tools.log import createColoredFormatter, getLogger, settings as log_
from weboob.tools.misc import to_unicode
from .results import ResultsConditionError
__all__ = ['BaseApplication']
__all__ = ['Application']
class MoreResultsAvailable(Exception):
......@@ -72,7 +72,7 @@ class ApplicationStorage(object):
return self.storage.save('applications', self.name)
class BaseApplication(object):
class Application(object):
"""
Base application.
......@@ -136,7 +136,7 @@ class BaseApplication(object):
"""
pass
# ------ BaseApplication methods -------------------------------
# ------ Application methods -------------------------------
def __init__(self, option_parser=None):
self.encoding = self.guess_encoding()
......
......@@ -37,7 +37,7 @@ from weboob.tools.value import Value, ValueBool, ValueFloat, ValueInt, ValueBack
from weboob.tools.misc import to_unicode
from weboob.tools.ordereddict import OrderedDict
from .base import BaseApplication, MoreResultsAvailable
from .base import Application, MoreResultsAvailable
__all__ = ['ConsoleApplication', 'BackendNotGiven']
......@@ -55,7 +55,7 @@ class BackendNotFound(Exception):
pass
class ConsoleApplication(BaseApplication):
class ConsoleApplication(Application):
"""
Base application class for CLI applications.
"""
......@@ -74,7 +74,7 @@ class ConsoleApplication(BaseApplication):
NC = '' # no color
def __init__(self, option_parser=None):
BaseApplication.__init__(self, option_parser)
Application.__init__(self, option_parser)
self.weboob.callbacks['login'] = self.login_cb
self.enabled_backends = set()
......
......@@ -39,7 +39,7 @@ from weboob.tools.value import ValueInt, ValueBool, ValueBackendPassword
from weboob.tools.misc import to_unicode
from weboob.capabilities import UserError
from ..base import BaseApplication, MoreResultsAvailable
from ..base import Application, MoreResultsAvailable
__all__ = ['QtApplication', 'QtMainWindow', 'QtDo', 'HTMLDelegate']
......@@ -140,12 +140,12 @@ class QCallbacksManager(QObject):
return request.answer
class QtApplication(QApplication, BaseApplication):
class QtApplication(QApplication, Application):
def __init__(self):
QApplication.__init__(self, sys.argv)
self.setApplicationName(self.APPNAME)
BaseApplication.__init__(self)
Application.__init__(self)
self.cbmanager = QCallbacksManager(self.weboob, self)
def create_weboob(self):
......@@ -154,7 +154,7 @@ class QtApplication(QApplication, BaseApplication):
def load_backends(self, *args, **kwargs):
while True:
try:
return BaseApplication.load_backends(self, *args, **kwargs)
return Application.load_backends(self, *args, **kwargs)
except VersionsMismatchError as e:
msg = 'Versions of modules mismatch with version of weboob.'
except ConfigError as e:
......
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