Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(89)  |  Call(71)  |  Derive(0)  |  Import(18)
makes a string xml valid

        def xmlify(string):
    """
        makes a string xml valid
    """
    return re.sub(r'([&<>])', lambda m: xml_escapes[m.group()], strip_tags(string))
        


src/b/a/baas-0.2.2/baas/plugins/example.py   baas(Download)
# -*- coding: utf-8 -*-
# Copyright 2009 Martin Borho <martin@borho.net>
# GPL - see License.txt for details
from baas.core.plugins import Plugin
from baas.core.helpers import strip_tags, xmlify
    def render_wave(self, data, title):
        #Would be the title
        result = " <br/><br/>" #<b>%s</b><br/>" % self.xmlify(title)
        result += "<b>%s</b>" % xmlify(data)
        return result

src/b/a/baas-HEAD/baas/plugins/example.py   baas(Download)
# -*- coding: utf-8 -*-
# Copyright 2009 Martin Borho <martin@borho.net>
# GPL - see License.txt for details
from baas.core.plugins import Plugin
from baas.core.helpers import strip_tags, xmlify
    def render_wave(self, data, title):
        #Would be the title
        result = " <br/><br/>" #<b>%s</b><br/>" % self.xmlify(title)
        result += "<b>%s</b>" % xmlify(data)
        return result

src/b/a/baas-0.2.2/baas/plugins/music.py   baas(Download)
from baas.core.yqlapi import YQLApi
from baas.core.plugins import Plugin
from baas.core.helpers import strip_tags, xmlify, htmlentities_decode
 
class Music (Plugin):
    def render_wave(self, response, title):
        '''
        renders the result for wave responses
        '''
        result = " <br/><br/><b>%s</b><br/>" % xmlify(title)
        if response:
            if response.get('Artist'):
                artists = response.get('Artist')
                for row in artists:
                    title = xmlify(row['name'])
                for row in artists:
                    title = xmlify(row['name'])
                    result += '<a href="%s">%s</a><br/><br/>' % (xmlify(row['name']), title)
            elif  response.get('Release'):
                releases = self._extract_hits(response, 'Release')
                for row in releases:
                    artist = self._get_artist(row)
                    result += '<a href="%s">%s</a> (%s) by <a href="%s">%s</a><br/><br/>\n' % (xmlify(row.get('url')), xmlify(row.get('title')), \

src/b/a/baas-HEAD/baas/plugins/music.py   baas(Download)
from baas.core.yqlapi import YQLApi
from baas.core.plugins import Plugin
from baas.core.helpers import strip_tags, xmlify, htmlentities_decode
 
class Music (Plugin):
    def render_wave(self, response, title):
        '''
        renders the result for wave responses
        '''
        result = " <br/><br/><b>%s</b><br/>" % xmlify(title)
        if response:
            if response.get('Artist'):
                artists = response.get('Artist')
                for row in artists:
                    title = xmlify(row['name'])
                for row in artists:
                    title = xmlify(row['name'])
                    result += '<a href="%s">%s</a><br/><br/>' % (xmlify(row['name']), title)
            elif  response.get('Release'):
                releases = self._extract_hits(response, 'Release')
                for row in releases:
                    artist = self._get_artist(row)
                    result += '<a href="%s">%s</a> (%s) by <a href="%s">%s</a><br/><br/>\n' % (xmlify(row.get('url')), xmlify(row.get('title')), \

src/b/a/baas-0.2.2/baas/plugins/twingly.py   baas(Download)
from urllib import quote_plus
from baas.core.plugins import Plugin
from baas.core.helpers import strip_tags, xmlify, htmlentities_decode, load_feed
 
class Twingly(Plugin):
    def render_wave_blog(self, data, title):
        '''
        renders the blog result for wave responses
        '''
        result = " <br/><br/><b>%s</b><br/>" % xmlify(title)
        if data:
            for row in data:
                result += '<a href="%s">%s</a><br/>' % (xmlify(row["link"]), xmlify(row["title"]))
                desc = row["summary"] if len(row["summary"]) > 0 else None
                if desc:
                    result += "%s<br/>" % xmlify(htmlentities_decode(desc))
                result += '<br/>'
        else:

src/b/a/baas-HEAD/baas/plugins/twingly.py   baas(Download)
from urllib import quote_plus
from baas.core.plugins import Plugin
from baas.core.helpers import strip_tags, xmlify, htmlentities_decode, load_feed
 
class Twingly(Plugin):
    def render_wave_blog(self, data, title):
        '''
        renders the blog result for wave responses
        '''
        result = " <br/><br/><b>%s</b><br/>" % xmlify(title)
        if data:
            for row in data:
                result += '<a href="%s">%s</a><br/>' % (xmlify(row["link"]), xmlify(row["title"]))
                desc = row["summary"] if len(row["summary"]) > 0 else None
                if desc:
                    result += "%s<br/>" % xmlify(htmlentities_decode(desc))
                result += '<br/>'
        else:

src/b/a/baas-0.2.2/baas/plugins/maemo.py   baas(Download)
from urllib import urlencode, quote_plus
from baas.core.plugins import Plugin
from baas.core.helpers import strip_tags, xmlify, htmlentities_decode, load_url
 
try:
    def render_wave(self, hits, title):
        '''
        renders the result for wave responses
        '''
        result = " <br/><br/><b>%s</b><br/>" % xmlify(title)
                if row.get('publisher'):
                    title = "%s: %s" % (row.get('publisher'), title)
                title = xmlify(htmlentities_decode(title))
                result += '<a href="%s">%s</a><br/><br/>' % (xmlify(row['unescapedUrl']), title)
        else:

src/b/a/baas-0.2.2/baas/plugins/gsearch.py   baas(Download)
from urllib import urlencode, quote_plus
from baas.core.plugins import Plugin
from baas.core.helpers import strip_tags, xmlify, htmlentities_decode, load_url
 
try:
    def render_wave(self, hits, title):
        '''
        renders the result for wave responses
        '''
        result = " <br/><br/><b>%s</b><br/>" % xmlify(title)
                if row.get('publisher'):
                    title = "%s: %s" % (row.get('publisher'), title)
                title = xmlify(htmlentities_decode(title))
                result += '<a href="%s">%s</a><br/><br/>' % (xmlify(row['unescapedUrl']), title)
        else:

src/b/a/baas-HEAD/baas/plugins/maemo.py   baas(Download)
from urllib import urlencode, quote_plus
from baas.core.plugins import Plugin
from baas.core.helpers import strip_tags, xmlify, htmlentities_decode, load_url
 
try:
    def render_wave(self, hits, title):
        '''
        renders the result for wave responses
        '''
        result = " <br/><br/><b>%s</b><br/>" % xmlify(title)
                if row.get('publisher'):
                    title = "%s: %s" % (row.get('publisher'), title)
                title = xmlify(htmlentities_decode(title))
                result += '<a href="%s">%s</a><br/><br/>' % (xmlify(row['unescapedUrl']), title)
        else:

src/b/a/baas-HEAD/baas/plugins/gsearch.py   baas(Download)
from urllib import urlencode, quote_plus
from baas.core.plugins import Plugin
from baas.core.helpers import strip_tags, xmlify, htmlentities_decode, load_url
 
try:
    def render_wave(self, hits, title):
        '''
        renders the result for wave responses
        '''
        result = " <br/><br/><b>%s</b><br/>" % xmlify(title)
                if row.get('publisher'):
                    title = "%s: %s" % (row.get('publisher'), title)
                title = xmlify(htmlentities_decode(title))
                result += '<a href="%s">%s</a><br/><br/>' % (xmlify(row['unescapedUrl']), title)
        else:

  1 | 2  Next