<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set sw=3 sts=3 ts=3

"""(Example) Simple Web Hello

Web-based Hello World example. This example is exactly the same as
the helloweb.py example, except that it tries to simplify things by
using more higher abstracted web components from the web components
library.
"""

from circuits.lib.web import Server
from circuits import listener, Component

class HelloWorld(Component):

	channel = "/"

	@listener("index")
	def onINDEX(self, request, response):
		return "Hello World!"

def main():
	server = Server(8000)
	server += HelloWorld()
	server.run()

if __name__ == "__main__":
	main()
<commit_msg>examples/simpleweb.py: Adapted to use new lib.web.Controller greatly simplifying<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set sw=3 sts=3 ts=3

"""(Example) Simple Web Hello

Web-based Hello World example. This example is exactly the same as
the helloweb.py example, except that it tries to simplify things by
using more higher abstracted web components from the web components
library.
"""

from circuits.lib.web import Server, Controller

class HelloWorld(Controller):

	def index(self, request, response, *args, **kwargs):
		return "Hello World!"

server = Server(8000)
server += HelloWorld()
server.run()

{'fraction_non_alphanumeric': 0.11316397228637413, 'fraction_numerical': 0.012317167051578136, 'mean_word_length': 4.6521739130434785, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6775513', 'n_tokens_mistral': 403, 'n_tokens_neox': 383, 'n_words': 151}