Did I find the right examples for you? yes no

All Samples(67)  |  Call(57)  |  Derive(0)  |  Import(10)

src/a/k/Akara-2.0.0a4/demo/etc/MoinMoin/action/atom_rc.py   Akara(Download)
from MoinMoin.wikixml.util import RssGenerator
 
from amara.writers.struct import structencoder, E, E_CURSOR, NS, ROOT, RAW
from amara.namespaces import ATOM_NAMESPACE
 
            )
        )
        f.send(E((ATOM_NAMESPACE, u'id'), full_url(request, page).encode(config.charset))),
        f.send(E((ATOM_NAMESPACE, u'title'), cfg.sitename.encode(config.charset))),
        f.send(E((ATOM_NAMESPACE, u'link'), {u'href': request.url_root.encode(config.charset)})),
        f.send(E((ATOM_NAMESPACE, u'summary'), ('RecentChanges at %s' % cfg.sitename).encode(config.charset))),

src/a/k/Akamu-0.7/lib/demo/musicbrainz.py   Akamu(Download)
import json, os, cgi, urllib, re
from pprint import pprint
from amara.writers.struct import structwriter, E, ROOT
from cStringIO import StringIO
from akara import module_config as config, request
    w = structwriter(indent=u"yes", stream=src)
    w.feed(ROOT(
        E(u'Music',{u'artist': ' / '.join(names)},
          E(u'Tracks',
            (
                E(u'Track',{u'name':trackLabel}) for trackLabel in tracks
 
    w.feed(ROOT(
        E(u'Root',
          E(u'Artists',
            (

src/a/k/Akamu-0.7/lib/demo/gsp_validator.py   Akamu(Download)
from amara.lib.util                 import *
from amara.xslt                     import transform
from amara.writers.struct           import structwriter, E, NS, ROOT, RAW
from akara.services                 import simple_service, service
from akara                          import response
        if message:
            return E(
                (TEST_NS,u'Result'),attrs,message
            )
        else:
            return E(
                (TEST_NS,u'Result'),attrs
                ROOT(
                    E(
                        (TEST_NS,u'Results'),
                        (elem for elem in validator.runTests())
                    )

src/a/k/Akara-2.0.0a4/lib/demo/moinrest.py   Akara(Download)
import amara
from amara import bindery
from amara.writers.struct import structencoder, E, NS, ROOT, RAW
from amara.bindery.html import parse as htmlparse
from amara.bindery.model import examplotron_model, generate_metadata
            output.feed(
            ROOT(
                E((u'attachments'),
                    (E(u'attachment', {u'href': unicode(t)}) for t in targets)
                )
            output.feed(
            ROOT(
                E((u'history'),
                    (E(u'rev', {u'id': unicode(r['rev']), u'editor': unicode(r['editor']), u'date': unicode(r['date']).replace(' ', 'T')}) for r in revs)
                )

src/a/k/Akamu-0.7/lib/demo/wheezy.py   Akamu(Download)
from akara.services import simple_service
from cStringIO import StringIO
from amara.writers.struct import structwriter, E, NS, ROOT
from amara.lib import U
from akara import request
    w.feed(
        ROOT(
            E((XHTML_NS,u'html'),
                E((XHTML_NS,u'body'),
                    E((XHTML_NS,u'p'),u'Testing')

src/a/k/Akamu-0.7/lib/demo/xslt.py   Akamu(Download)
from akara.services import simple_service
from cStringIO import StringIO
from amara.writers.struct import structwriter, E, NS, ROOT
from amara.lib import U
from akara import request
    w.feed(
        ROOT(
            E(u'Patient',{ u'name' : U(name),
                           u'gender' : u'Male'}
            )

src/a/k/Akamu-0.7/lib/demo/protocol.py   Akamu(Download)
def ReverseTransform(graph):
    from rdflib import Namespace, RDF
    from amara.writers.struct import structwriter, E, ROOT
    from cStringIO import StringIO
    FOAF = Namespace("http://xmlns.com/foaf/0.1/")
        return attr
    for person in graph.subjects(RDF.type,FOAF.Person):
        w.feed(ROOT(E(u'Patient',attributes(person))))
    return src.getvalue()
 

src/a/k/Akara-2.0.0a4/demo/etc/MoinMoin/formatter/application_xml.py   Akara(Download)
 
from amara import tree
from amara.writers.struct import structwriter, E, NS, ROOT, RAW
from amara.bindery.html import markup_fragment
from amara.lib import inputsource

src/a/m/Amara-2.0.0/test/writers/test_struct.py   Amara(Download)
import amara
from amara.lib import treecompare
from amara.writers.struct import structwriter, structencoder, E, NS, ROOT, RAW, E_CURSOR
#from amara import tree
#from amara import bindery
def test_coroutine_example1():
    EXPECTED = """<a><b attr1="val1"><c>1</c><c>2</c><c>3</c></b></a>"""
    output = structencoder()
    f = output.cofeed(ROOT(E(u'a', E_CURSOR(u'b', {u'attr1': u'val1'}))))
    f.send(E(u'c', u'1'))
    f.send(E(u'c', u'2'))
    f.send(E(u'c', u'3'))

src/a/k/Akamu-0.7/test/test_diglot.py   Akamu(Download)
from amara.namespaces import *
from amara import tree
from amara.writers.struct import structwriter, E, NS, ROOT
from amara.lib import U
 
        w.feed(
            ROOT(
                E(u'Patient',{ u'name' : u'Chimezie Ogbuji', u'gender' : u'Male'})
            )
        )
        w.feed(
            ROOT(
                E(u'Patient',{ u'name' : u'Uche Ogbuji', u'gender' : u'Male'})
            )
        )
        w.feed(
            ROOT(
                E(u'Patient',{ u'name' : u'Uche Ogbuji'})
            )
        )
        w.feed(
            ROOT(
                E(u'Patient',{ u'name' : u'Ejike Ogbuji'})
            )
        )