This section of the WebBot site provides an overview of variuos features of the WebBot framework. However, to get more in depth usage guides you will want to look at the individual libraries WebBot uses to enable dynamic web page development.
WebBot strives to provide a directory structure that makes it easy and clear where changes are made. In case the layout itself was not self evident - below is a definition of every folder used by WebBot:
[AppName] /
[AppName] /Pages/
[AppName] /Pages/[PageURL]/
[AppName] /WebBot/
[AppName] /static/
[AppName] /static/images/
[AppName] /static/js/
[AppName] /static/sass/
[AppName] /static/stylesheets
instantly create_webbot_page
It will ask you for the python name of your new page (which will double as it's URL) and a general description of your page. Using this information it will create your new page accessible from [AppURL]/[PageName].
Each page in WebBot is placed in its own directory and has its definition split into a minimum of two files: The view file(Template.wui) and control file (Servlet.py).
pip install GuiBuilder
easy_install GuiBuilder
guiBuilder [AppDirectory]/Pages/[PageName]/Template.wui
'''
The Home Page for your App
'''
import logging as log
from WebBot import Page, PageControls
from WebElements import UITemplate
class Home(Page):
class ContentControl(PageControls.TemplateControl):
template = UITemplate.fromFile("Pages/Home/Template.wui")
def initUI(self, ui, request):
'''
The initial setup of the interface (such as dynamically adding widgets that are not present in the
view) should be done here.
'''
pass
def setUIData(self, ui, request):
'''
Any data populating that occurs as a result of the data in the request should be done here.
'''
pass
def processPost(self, ui, request):
'''
Any unique processing that needs to be done on a post should be done here.
Note: There is corresponding process(Get|Delete|Put) methods.
'''
pass
def validPost(self, ui, request):
'''
Any validation of post data should occur here: with true being returned only if the data
is valid.
Note: There is corresponding valid(Get|Delete|Put) methods.
'''
return True
WebBot is designed to make editing the appearance of your app as quick and DRY(Don't Repeat Yourself) as possible. Toward this goal WebBot comes with a base stylesheet, that defines good defaults for most HTML objects and WebElement widgets.
Additionally WebBot takes advantage of Compass / Sass to allow you to write more succinct style definitions where they are needed.
Once you have compasss installed on your system you can modify the Site.sass file located in [AppName]/static/sass/. After you have made the necessary modifications to your apps style definition run the following from [AppName]/static/:
compass compile