{ "info": { "author": "David Link", "author_email": "dvlink@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", "Topic :: Software Development :: Libraries" ], "description": "**Vweb** is a Simple Python Website Frame work.\n\nSource: https://github.com/dlink/vweb\n\nIt has been created over a time to address reoccuring requirements for building simple websites. It is Python CGI, but can be used with Cherrypy. It is not MVC. It consists of the following modules:\n\n### Modules\n\n* **HtmlPage** - Super class that controlls the processing and display of webpages\n\n* **html** - HTML Abstraction layer for generating HTML\n\n* **HtmlTable** - HTML Table Abstraction layer for generating HTML Tables\n\n* **htmlify** - Some utilities\n\n* **examples** - Examples\n\n### Details\n\n##### HtmlPage\n\nHtmlPage is a Web Page that your code subclasses. It consists primarily of\n\n* A Constructor **__init__()** which you override, which allows you to dynamically build the HTML HEADER with Title, Javascript, CSS, auto_refesh, output_format (html, csv)\n\n* A **process()** method which you overide for handling incoming GET and POST parameters.\n\n* A **getHtmlContent()** method which you overrid for generating HTML BODY\n\n* Debugging GET and POST Variables, as well as user defined DEBUG message.\n\nHere is Hello World:\n\n from htmlpage import HtmlPage\n class HelloWorld(HtmlPage):\n def __init__(self):\n HtmlPage.__init__(self, \"Hello World\")\n def getHtmlContent(self):\n return '
Hello, World!
'\n if __name__ == '__main__':\n HelloWorld().go()\n\nSee Other [Examples](https://github.com/dlink/vweb/tree/master/examples)\n\n__html__\n\n**html** is a libary module of simple one-to-one python equivalent names for each HTML tag. It is used to generate html in python, rather than using templates like Genshi, or PHP.\n\nThe following examples ...\n\n b('hi')\n p(font('some text', color='green'))\n a('Chapter 2', href='chapter2.html')\n div(center(column_chooser), id='columnChooser', class_='widget')\n \nReturns these string:\n\n hi\ntext
\n Chapter 2\n \n\n__HtmlTable__\n\n**HtmlTable** is an Abstraction layer for HTML TABLES, (and it rocks the house). It was inspired by perl's HTML:Table. \n\nBy treating tables as Python objects similar to a list of lists, uses can work more freely and creatively, leaving the output of the HTML TABLE to the getTable() method.\n\nThis example \u2026\n\n from htmltable import HtmlTable\n \n # Create table - Many parameter options exist.\n table = HtmlTable()\n \n # Header\n table.addHeader(['No.', 'President'])\n \n # Table Body\n table.addRow([1, 'George Washington']) \n table.addRow([2, 'John Adams']) \n \n # Format adjustments\n table.setColAlign(2, 'right')\n \n # Outputing the results\n print table.getTable()\n\nOutput the following\n\n| No. | \nPresident | \n
|---|---|
| 1 | \nGeorge Washington | \n
| 2 | \nJohn Adams | \n