Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python.announce > #478

Nagare web framework 0.4.0

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <alain.poirier@net-ng.com>
X-Original-To python-announce-list@python.org
Delivered-To python-announce-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'example:': 0.03; '"""': 0.07; 'continuation': 0.07; 'framework.': 0.07; 'linear': 0.07; 'url:pypi': 0.08; 'python': 0.08; 'interacting': 0.09; 'publishers,': 0.09; 'trees': 0.09; 'def': 0.13; 'heavily': 0.15; 'examples': 0.15; '"""a': 0.16; '"guess': 0.16; "'new": 0.16; 'callbacks': 0.16; 'from:addr:net-ng.com': 0.16; 'int(x)': 0.16; 'message-id:@net-ng.com': 0.16; 'multitude': 0.16; 'poirier': 0.16; 'programmatic': 0.16; 'refresh': 0.16; 'reusable': 0.16; 'seaside': 0.16; 'stackless': 0.16; 'workflow': 0.16; 'taste': 0.23; 'generic': 0.24; 'code': 0.25; 'guess': 0.25; 'all,': 0.27; 'import': 0.27; 'server.': 0.27; 'random': 0.28; 'coding': 0.28; 'subject:web': 0.28; 'lists': 0.28; 'elements': 0.28; 'class': 0.29; 'url:wiki': 0.29; 'handling': 0.30; 'components,': 0.30; 'dom': 0.30; 'email name:': 0.30; 'extends': 0.30; 'fork': 0.30; 'objects.': 0.30; 'quickly.': 0.30; 'framework': 0.30; 'translate': 0.30; 'xml': 0.30; 'version': 0.31; 'developers': 0.31; 'components': 0.32; 'in:': 0.32; 'pure': 0.32; 'break': 0.32; 'objects': 0.32; 'source': 0.32; 'thanks': 0.32; 'view,': 0.34; '...': 0.35; 'response': 0.35; 'url:python': 0.36; 'page.': 0.36; 'to:addr:python-announce-list': 0.36; 'charset:us-ascii': 0.36; 'list,': 0.37; 'page': 0.37; 'using': 0.37; 'presentation': 0.37; 'skip:_ 10': 0.37; 'component': 0.38; 'too,': 0.38; 'several': 0.38; 'mailing': 0.38; 'url:org': 0.39; 'define': 0.39; 'plain': 0.39; 'to:addr:python.org': 0.40; 'views': 0.40; 'more': 0.61; 'full': 0.62; 'header:Message-Id:1': 0.62; 'choose': 0.62; 'flow': 0.63; 'world.': 0.63; 'lower': 0.63; 'back,': 0.64; 'association': 0.66; 'direct': 0.66; 'kept': 0.68; 'features:': 0.73; 'links:': 0.73; 'received:91.121': 0.73; 'automatic': 0.74; 'website:': 0.75; 'received:109': 0.78; 'browser.': 0.80; 'algorithm,': 0.84; 'component,': 0.84; 'integrates': 0.84; 'smalltalk': 0.84
From Alain Poirier <alain.poirier@net-ng.com>
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding quoted-printable
Subject Nagare web framework 0.4.0
Date Tue, 17 Jan 2012 18:20:48 +0100
To python-announce-list@python.org
Mime-Version 1.0 (Apple Message framework v1251.1)
X-Mailer Apple Mail (2.1251.1)
X-Spam-Score 1.5
X-Mailman-Approved-At Wed, 18 Jan 2012 17:13:44 +0100
X-BeenThere python-announce-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To python-list@python.org
List-Id Announcement-only list for the Python programming language <python-announce-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-announce-list>
List-Post <mailto:python-announce-list@python.org>
List-Help <mailto:python-announce-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=subscribe>
Approved python-announce-list@python.org
Newsgroups comp.lang.python.announce
Message-ID <mailman.4837.1326903224.27778.python-announce-list@python.org> (permalink)
Lines 138
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1326903224 news.xs4all.nl 6951 [2001:888:2000:d::a6]:52360
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python.announce:478

Show key headers only | View raw


Hi all,

Version 0.4.0 of the Nagare web framework is now released!

About Nagare
============

Nagare is a components based framework: a Nagare application
is a composition of interacting components each one with its
own state and workflow kept on the server. Each component
can have one or several views that are composed to generate
the final web page. This enables the developers to reuse or
write highly reusable components easily and quickly.

Thanks to Stackless Python, Nagare is also a continuation aware
web framework which enables to code a web application like a
desktop application, with no need to split its control flow in
a multitude of controllers and with the automatic handling of
the back, fork and refresh actions from the browser.

Its component model and use of the continuation come from the
famous Seaside Smalltalk framework.

Furthermore Nagare integrates the best tools and standard from
the Python world. For example:

  - WSGI: binds the application to several possible publishers,
  - lxml: generates the DOM trees and brings to Nagare the full
    set of XML features (XSL, XPath, Schemas ...),
  - setuptools: installs, deploys and extends the Nagare framework
    and the Nagare applications too,
  - PEAK Rules: generic methods are heavily used in Nagare, to
    associate views to components, to define security rules, to
    translate Python code to Javascript ...
  - WebOb: for its Request and Response Objects.


To read more about its features:
    http://www.nagare.org/trac/wiki/NagareFeatures

Release info and download page:
    http://pypi.python.org/pypi/nagare

Release info and download page of the examples:
    http://pypi.python.org/pypi/nagare.examples

Release info and download page of the pure web IDE:
    http://www.nagare.org/trac/wiki/NagareIde
    http://pypi.python.org/pypi/nagare.ide

Source and documentation available at the website:
     http://www.nagare.org

Mailing lists - the place to ask questions:
     http://groups.google.com/group/nagare-users


Examples
========

A complete "guess a number" game to taste how easy web coding
becomes using continuations:


  import random
  from nagare import component, util

  class Number(component.Task):
      """A little game to guess a number
      """
      def go(self, comp):
	  """The game algorithm, using continuation for a pure linear Python code
	  
	  In:
	    - ``comp`` -- this component
	  """
	  self.attempt = 1
	  number = random.randint(1, 20)
	  
	  comp.call(util.Confirm('I choose a number between 1 and 20. Try to guess it'))
	  
	  while True:
	      x = comp.call(util.Ask('Try #%d: ' % self.attempt))
	      if not x.isdigit():
		  continue
	      
	      x = int(x)
	      
	      if x > number:
		  comp.call(util.Confirm('Choose a lower number'))
		  
	      if x < number:
		  comp.call(util.Confirm('Choose a greater number'))
		  
	      if x == number:
		  comp.call(util.Confirm('You guessed the number in %d attempts' % self.attempt))
		  break

	      self.attempt += 1


A simple todo list, illustrating the programmatic HTML generation,
the association of view(s) to Python objects and the direct association
of callbacks to HTML form elements and links:

    from nagare import presentation
    from nagare.namespaces import xhtml

    # A plain Python ``TodoList`` class
    class TodoList(object):
	def __init__(self):
	    self.todo = []

	def add_todo(self, msg):
	    self.todo.append(msg)

    # The default HTML view, generated in programmatic HTML
    @presentation.render_for(TodoList)
    def render(self, h, comp, model):
        # ``h`` is a (X)HTML renderer (http://www.nagare.org/trac/wiki/RendererObjects)
	with h.div:
	    for msg in self.todo:
		h << h.blockquote(msg) << h.hr

	with h.form:
	    h << 'New todo:' << h.br
	    h << h.textarea.action(self.add_todo) << h.br
	    h << h.input(type='submit', value='Add')

	return h.root

Enjoy!

A. Poirier

Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread


Thread

Nagare web framework 0.4.0 Alain Poirier <alain.poirier@net-ng.com> - 2012-01-17 18:20 +0100

csiph-web