<commit_before>Easy Web App (for Python)
=========================
Create web applications easily. 

This is a `PyPI package <https://pypi.python.org/pypi/easy-web-app>`_
for the `rest-web-gui <https://github.com/ma-ha/rest-web-ui>`_ framework.

Focus is on *web applications* (not simple web pages). 
A lot of plug-ins are available to get a portal it quickly configured:

- Forms
- Tables / lists
- Content: via MediaWiki API, plain HTML views, or help dialogs
- I/O: control switches/drawer, gauges, graphs, LEDs, displays, ...
- i18n: switch language
- Maps: POIs, routes, traffic, ...
- Page to page navigation with navigation tabs, menus, links and session data
- Source code display
- Security: HTTP Basic authentication or OAuth 
- ...

This is how it may look like:

.. image:: https://raw.githubusercontent.com/ma-ha/easy-web-app/master/examples/demo-screen.png

Check out the `online demos <http://mh-svr.de/pong_dev>`_.

Remark: It is also available as `Node.js API package <https://www.npmjs.com/package/easy-web-app>`_.

Getting started
===============
Prepare:
--------
1. Create a web application project folder, e.g.
   ``mkdir ~/myapp``
2. Create a virtual Python environment for this folder:
   ``virtualenv ~/myapp``
3. Change into the project folder and activate the virtual environment:
   ``cd ~/myapp; source bin\activate``
4. Install this package:
   _TBD_

Create first web app with Python:
---------------------------------
Create a file, e.g. ``firstapp.py``  
  
::

    # Copyright (c) 2016 ma-ha, The MIT License (MIT)
    import webapp

    # initialize portal
    portal = Portal( 8000, { 'title':'Test' } )

    # define a custom web service 
    portal.addURL( '/greet', 'greet' )
    class greet:
        def GET( self ):
            return 'Hello World!'

    # start the web server
    portal.run()

TODOs
-----
- [x] First working *rest-web-ui* integration
- [x] PyPI package
- [x] portal.getPage( name )  
- [ ] portal.addPage( name, page )  
- [ ] page.addView( def [, config]  )
- [ ] page.addColumnsRow( id, width )
- [ ] row.addView( def [, config] )
- [ ] row.addColumnsRow ( id, height )
- [ ] column.addView ( def [, config] )
- [ ] column.addRowsColumn ( id, width )  
- [ ] portal.addPage( pageId [, title] [, viewDef] [, viewConfig] ) incl automatic navigation tabs
- [ ] I/O server and API<commit_msg>update example<commit_after>Easy Web App (for Python)
=========================
Create web applications easily. 

This is a `PyPI package <https://pypi.python.org/pypi/easy-web-app>`_
for the `rest-web-gui <https://github.com/ma-ha/rest-web-ui>`_ framework.

Focus is on *web applications* (not simple web pages). 
A lot of plug-ins are available to get a portal it quickly configured:

- Forms
- Tables / lists
- Content: via MediaWiki API, plain HTML views, or help dialogs
- I/O: control switches/drawer, gauges, graphs, LEDs, displays, ...
- i18n: switch language
- Maps: POIs, routes, traffic, ...
- Page to page navigation with navigation tabs, menus, links and session data
- Source code display
- Security: HTTP Basic authentication or OAuth 
- ...

This is how it may look like:

.. image:: https://raw.githubusercontent.com/ma-ha/easy-web-app/master/examples/demo-screen.png

Check out the `online demos <http://mh-svr.de/pong_dev>`_.

Remark: It is also available as `Node.js API package <https://www.npmjs.com/package/easy-web-app>`_.

Getting started
===============
Prepare:
--------
1. Create a web application project folder, e.g.
   ``mkdir ~/myapp``
2. Create a virtual Python environment for this folder:
   ``virtualenv ~/myapp``
3. Change into the project folder and activate the virtual environment:
   ``cd ~/myapp; source bin\activate``
4. Install this package:
   _TBD_

Create first web app with Python:
---------------------------------
Create a file, e.g. ``firstapp.py``  
  
::

    # Copyright (c) 2016 ma-ha, The MIT License (MIT)
    import webapp
    import easywebapp.page_layout as page

    # create empty page
    mainpage = page.PageLayout()
    
    # initialize portal
    portal = Portal( 8000, mainpage )

    # define a custom web service 
    portal.addURL( '/greet', 'greet' )
    class greet:
        def GET( self ):
            return 'Hello World!'

    # start the web server
    portal.run()

TODOs
-----
- [x] First working *rest-web-ui* integration
- [x] PyPI package
- [ ] configure port from init
- [x] portal.getPage( name )  
- [o] portal.addPage( name, page )  
- [ ] page.addView( def [, config]  )
- [ ] page.addColumnsRow( id, width )
- [ ] row.addView( def [, config] )
- [ ] row.addColumnsRow ( id, height )
- [ ] column.addView ( def [, config] )
- [ ] column.addRowsColumn ( id, width )  
- [ ] portal.addPage( pageId [, title] [, viewDef] [, viewConfig] ) incl automatic navigation tabs
- [ ] I/O server and API
{'fraction_non_alphanumeric': 0.16024844720496895, 'fraction_numerical': 0.005797101449275362, 'mean_word_length': 2.9565929565929565, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, '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': '2421445', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1511, 'n_words': 520}