# Copyright 2015 Curtis Sand
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Flask view objects for the netify app."""

from flask.views import View

from .template import render_template
from .template import HtmlPage


class Views(list):
    def __init__(self):
        super(Views, self).__init__([Index])


class Index(View):
    name = 'index'
    default_route = '/'

    @classmethod
    def register(cls, app, route=None):
        if not route:
            route = cls.default_route
        app.add_url_rule(route, view_func=cls.as_view(cls.name))

    def dispatch_request(self):
        return render_template(HtmlPage(head=None,
                                        body='Hello World').build())

@@ -735,16 +735,75 @@
 (list):%0A
+    %22%22%22A list of view classes available in this module.%22%22%22%0A
     def 
@@ -810,32 +810,32 @@
 __init__(self):%0A
-
         super(Vi
@@ -884,16 +884,42 @@
 (View):%0A
+    %22%22%22The index view.%22%22%22%0A
     name
@@ -1011,16 +1011,74 @@
 =None):%0A
+        %22%22%22Register the view on the flask application.%22%22%22%0A
         
@@ -1195,16 +1195,16 @@
 name))%0A%0A
-
     def 
@@ -1219,32 +1219,110 @@
 _request(self):%0A
+        %22%22%22Handle an incoming request for a route registered to this View.%22%22%22%0A
         return r

add missing docstrings to appease pylint