Commit a64c9f2e authored by Florent Fourcot's avatar Florent Fourcot

Rename BaseApplication to Application

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