disabled
 p    from abc import ABC

from ..error import EInvokationError
from ..error import EValidationError


class AbstractApplication(ABC):

    def __init__(self, implementation):
        self.implementation = implementation

    def __call__(self, environ, start_response):
        try:
            status = '200 OK'
            type, body = self.implementation.get_response(environ)
        except EInvokationError as e:
            status = '400 Bad Request'
            type = 'text/plain'
            body = str(e)
        except EValidationError as e:
            status = '422 Unprocessable Entity'
            type = 'text/plain'
            body = str(e)
        except Exception as e:
            status = '500 Internal Server Error'
            type = 'text/plain'
            body = str(e)
        start_response(status, [('Content-Type', type)])
        return [body.encode()]
     	**************************************************************************
*                                                                        *
*                   ADDUSER Local System Additions v4.9                  *
*                 Copyright (C) 1999-2013, John Zaitseff                 *
*                                                                        *
**************************************************************************

Welcome to the ADDUSER Local System Additions program!  This program, once
installed as /usr/local/sbin/adduser.local,  works in conjunction with the
Debian adduser(8) command to extend the creation of your user accounts.

As a system administrator, you are often faced with a long list of "things
to  do" when  creating  a new  user  account.  For  example,  if you  have
configured  FTP and  Web  servers, you  would  probably have  to create  a
directory  within their  directories for  the  new user,  possibly copy  a
skeleton "index.html" file  into the proper location, add  the user to the
"ftp" and "www" groups and  so on.  All, naturally, without forgetting any
vital step!

The adduser.local  program automates much  of this for you.   By modifying
the program's  configuration file, /etc/adduser.local.conf,  to match your
local  requirements,  this  program   can  automatically  add  a  user  to
supplementary  groups,  create directories  and  symbolic  links and  copy
skeleton files to the newly-created directories.

Note that once you install this program (and edit the configuration file),
you will never  need to directly run adduser.local:  the Debian adduser(8)
command automatically calls adduser.local with the correct parameters.  If
you like,  however, you CAN  run adduser.local directly (try  the "--help"
parameter for  a brief  command-line summary), such  as for  user accounts
that have already been created.

The adduser.local program  is written in Perl (with  comments!), and comes
with a sample configuration file that is extensively documented.  In fact,
the sample adduser.local.conf file is  probably all you will need to read,
once you  have installed the program.   A number of sample  files are also
included in the "adduser.local.conf.examples" directory --- do what you like
with these.

To  illustrate the  program's simplicity,  the following  lines  have been
taken almost verbatim from the sample configuration file:

    service = web

    user[web]       = www
    addtogroup[web] = true
    homedir[web]    = ""
    subdir[web]     = "doc/users"
    althome[web]    = false
    mkdir[web]      = true
    chgrpdir[web]   = true
    mklink[web]     = true
    linkname[web]   = "public_html"
    skelfile[web]   = "index.html"
    chgrpskel[web]  = true

Assuming adduser(8)  was called for the  user "john", and  the system user
"www" belongs  to the group "www"  and has the  home directory "/home/www"
(in actual fact,  all these values are taken  from the password database),
the following actions are performed by this program:

  - the user "john" is added to the group "www",

  - the directory "/home/www/doc/users/john" is created, owned by the user
    "john" and with group o