Custom Query (58 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (4 - 6 of 58)

1 2 3 4 5 6 7 8 9 10 11 12
Ticket Resolution Summary Owner Reporter
#1442 fixed Error in the translation of methods to javascript apoirier apoirier

Reported by apoirier, 7 years ago.

Description

A function can be automatically translated to javascript:

def greet():
   window.alert('Hello world!')

class MyComponent(object):
   pass

@presentation.render_for(MyComponent)
def render(self, h, *args):
   return h.input(type='submit', onclick=greet)

But the translation of a method:

class MyComponent(object):
   def greet(self):
       window.alert('Hello world!')

@presentation.render_for(MyComponent)
def render(self, h, *args):
   return h.input(type='submit', onclick=self.greet)

raises an IndentationError exception:

...
File '/Volumes/data/projects/nagare/dev/src/nagare/core/nagare/namespaces/xhtml.py', line 68 in add_attribute
  xml.add_attribute(self, name, ajax.JS(value))
File '/Volumes/data/projects/nagare/dev/src/nagare/core/nagare/ajax.py', line 339 in __init__
  self.javascript = str2js(src, module)
File '/Volumes/data/projects/nagare/dev/src/nagare/core/nagare/ajax.py', line 300 in str2js
  pyjs.Translator(namespace, compiler.parse(src), output)
File '/opt/stackless-2.6.2/lib/python2.6/compiler/transformer.py', line 51 in parse
  return Transformer().parsesuite(buf)
File '/opt/stackless-2.6.2/lib/python2.6/compiler/transformer.py', line 128 in parsesuite
  return self.transform(parser.suite(text))
IndentationError: unexpected indent (line 1)
#1443 fixed Exception when the default renderer of a WSGIApp is asynchronous apoirier apoirier

Reported by apoirier, 7 years ago.

Description

When the default renderer for a WSGIApp is an asynchronous renderer:

from nagare import wsgi
from nagare.namespaces import xhtml

class WSGIApp(wsgi.WSGIApp):
    renderer_factory = xhtml.AsyncRenderer

a TypeError exception is raised:

File '/Volumes/data/projects/nagare/dev/lib/python2.6/site-packages/WebError-0.10.1-py2.6.egg/weberror/evalexception.py', line 431 in respond
  app_iter = self.application(environ, detect_start_response)
File '/Volumes/data/projects/nagare/dev/src/nagare/core/nagare/wsgi.py', line 483 in __call__
  response = self.on_exception(request, response)
File '/Volumes/data/projects/nagare/dev/src/nagare/core/nagare/wsgi.py', line 465 in __call__
  output = top.wrap(renderer.content_type, renderer, output)
File '/Volumes/data/projects/nagare/dev/src/nagare/core/nagare/top.py', line 55 in wrap
  body.insert(0, head1)
File 'lxml.etree.pyx', line 715 in lxml.etree._Element.insert (src/lxml/lxml.etree.c:32123)
TypeError: Argument 'element' has incorrect type (expected lxml.etree._Element, got str)
#1498 fixed nagare tutorial documentation errors apoirier arif

Reported by arif, 7 years ago.

Description

In Part 1, the application is registered with <NAGARE_HOME>/bin/python setup.py develop and not with /tmp/tutorial/bin/python setup.py develop

In Part 4, the class Application code should not be:

from counter import Counter

class App(object):

def init(self):

self.counter1 = component.Component(Counter()) self.counter2 = component.Component(Counter())

# @presentation.render_for(App) def render(app, h, *args):

h << self.counter1 h << h.hr h << self.counter2

return h.root

# factory app = App

but:

from counter import Counter from nagare import component from nagare import presentation

class App(object):

def init(self):

self.counter1 = component.Component(Counter()) self.counter2 = component.Component(Counter())

# @presentation.render_for(App) def render(app, h, *args):

h << app.counter1 h << h.hr h << app.counter2 return h.root

# factory app = App

1 2 3 4 5 6 7 8 9 10 11 12
Note: See TracQuery for help on using queries.