From ed54a33e3a878cd03eeab4f403941ff84a356d47 Mon Sep 17 00:00:00 2001 From: Lukas Garberg Date: Thu, 5 Oct 2023 08:50:06 +0200 Subject: [PATCH] www: Remove files related to Pylons --- nipap-www/nipap_www.egg-info/requires.txt | 2 +- nipap-www/nipapwww/lib/base.py | 54 ----------------------- 2 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 nipap-www/nipapwww/lib/base.py diff --git a/nipap-www/nipap_www.egg-info/requires.txt b/nipap-www/nipap_www.egg-info/requires.txt index e4e7cd1c6..560bedd94 100644 --- a/nipap-www/nipap_www.egg-info/requires.txt +++ b/nipap-www/nipap_www.egg-info/requires.txt @@ -1,3 +1,3 @@ Flask -pynipap nipap +pynipap diff --git a/nipap-www/nipapwww/lib/base.py b/nipap-www/nipapwww/lib/base.py deleted file mode 100644 index 5d2b104b9..000000000 --- a/nipap-www/nipapwww/lib/base.py +++ /dev/null @@ -1,54 +0,0 @@ -""" The base Controller API - - Provides the BaseController class for subclassing. -""" -import logging - -from pylons import request, session, url, tmpl_context as c -from pylons.controllers import WSGIController -from pylons.controllers.util import redirect -from pylons.templating import render_jinja2 as render - -from pynipap import AuthOptions -import nipapwww - -log = logging.getLogger(__name__) - -class BaseController(WSGIController): - - requires_auth = True - - - def __before__(self): - """ Perform actions before action method is invoked. - Deals with authentication. - """ - - # Add version to template context - c.www_version = nipapwww.__version__ - - # set authentication options - o = AuthOptions( - { - 'username': session.get('user'), - 'full_name': session.get('full_name'), - 'authoritative_source': 'nipap', - 'readonly': session.get('readonly') - }) - - - # verify that user is logged in - if self.requires_auth and 'user' not in session: - # save path - session['path_before_login'] = request.path_info - session.save() - redirect(url(controller='auth', action='login')) - - - - def __call__(self, environ, start_response): - """Invoke the Controller""" - # WSGIController.__call__ dispatches to the Controller method - # the request is routed to. This routing information is - # available in environ['pylons.routes_dict'] - return WSGIController.__call__(self, environ, start_response)