From 109fb65f0196597ba250087c1f5a0c40890df55e Mon Sep 17 00:00:00 2001 From: Christophe Benz Date: Tue, 27 Apr 2010 11:31:44 +0200 Subject: [PATCH] remove unused http frontend --- weboob/frontends/http/__init__.py | 0 weboob/frontends/http/application.py | 53 ------------------- weboob/frontends/http/templates/base.mako | 16 ------ weboob/frontends/http/templates/index.mako | 9 ---- weboob/frontends/http/templates/messages.mako | 21 -------- 5 files changed, 99 deletions(-) delete mode 100644 weboob/frontends/http/__init__.py delete mode 100644 weboob/frontends/http/application.py delete mode 100644 weboob/frontends/http/templates/base.mako delete mode 100644 weboob/frontends/http/templates/index.mako delete mode 100644 weboob/frontends/http/templates/messages.mako diff --git a/weboob/frontends/http/__init__.py b/weboob/frontends/http/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/weboob/frontends/http/application.py b/weboob/frontends/http/application.py deleted file mode 100644 index f2fac593..00000000 --- a/weboob/frontends/http/application.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- 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. - -""" - -import os - -from mako.lookup import TemplateLookup -import wee -from wsgiref.simple_server import make_server - -from weboob.capabilities.messages import ICapMessages -from weboob.tools.application import BaseApplication - -class HTTPApplication(BaseApplication): - APPNAME = 'http' - CONFIG = dict(host='localhost', port=8080) - - template_lookup = TemplateLookup(directories=['%s/templates' % os.path.dirname(__file__)], - output_encoding='utf-8', encoding_errors='replace') - - - def main(self, argv): - self.load_config() - self.weboob.load_backends() - self.srv = make_server(self.config.get('host'), self.config.get('port'), wee.make_app()) - self.srv.serve_forever() - - @wee.get('/') - def index(self, request): - template = self.template_lookup.get_template('index.mako') - return template.render().strip() - - @wee.get('/messages') - def messages(self, request): - template = self.template_lookup.get_template('messages.mako') - backends = list(self.weboob.iter_backends(ICapMessages)) - return template.render(backends=backends).strip() diff --git a/weboob/frontends/http/templates/base.mako b/weboob/frontends/http/templates/base.mako deleted file mode 100644 index 0372ecad..00000000 --- a/weboob/frontends/http/templates/base.mako +++ /dev/null @@ -1,16 +0,0 @@ -## -*- coding: utf-8 -*- - -<%def name="title()" filter="trim"> -weboob - - - - - - ${self.title()} - - - - ${next.body()} - - diff --git a/weboob/frontends/http/templates/index.mako b/weboob/frontends/http/templates/index.mako deleted file mode 100644 index f26a7950..00000000 --- a/weboob/frontends/http/templates/index.mako +++ /dev/null @@ -1,9 +0,0 @@ -## -*- coding: utf-8 -*- - -<%inherit file="base.mako"/> - -<%def name="body()"> - - diff --git a/weboob/frontends/http/templates/messages.mako b/weboob/frontends/http/templates/messages.mako deleted file mode 100644 index eff70330..00000000 --- a/weboob/frontends/http/templates/messages.mako +++ /dev/null @@ -1,21 +0,0 @@ -## -*- coding: utf-8 -*- - -<%inherit file="base.mako"/> - -<%def name="title()" filter="trim"> -weboob / messages - - -<%def name="body()"> - % for (name, backend) in backends: -

${name}

- - % endfor -