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

All Samples(22)  |  Call(17)  |  Derive(0)  |  Import(5)

src/c/o/collective.gsa-2.0rc9/collective/gsa/adapters/indexer.py   collective.gsa(Download)
from collective.gsa.interfaces import IContentProvider, IGSASchema
from zope.component import queryMultiAdapter, getUtility
from collective.gsa.utils import safe_unicode
from zope.interface import implements
from collective.gsa.interfaces import IGSAFeedGenerator
 
        if data['content'] is None:
            data['content'] = u"%s - %s" % (safe_unicode(obj.Title()), safe_unicode(obj.Description()))
            data['content_encoding'] = None
 
            txt += u"<metadata>"
            for name, value in mt_data.items():
                txt += u"<meta name=\"%s\" content=\"%s\"/>" % (safe_unicode(name), escape(safe_unicode(value), {'"':'&quot;'}))
            txt += u"</metadata>"
        content = row.get('content')

src/c/o/collective.gsa-2.0rc9/collective/gsa/gsa.py   collective.gsa(Download)
from zope.component import getUtility
 
from collective.gsa.utils import encode_multipart_formdata, safe_unicode, make_cookie
from collective.gsa.config import LIMIT
from logging import getLogger
            access = self.getCredentialsCookie() and 'a' or 'p'
 
        url = u'%s&output=xml_no_dtd&getfields=*&ie=utf8&oe=utf8&filter=0&access=%s' % (safe_unicode(params['q']), access)
        # TODO: better escaping
        url = u'/search?%s' % url.replace(' ','+')
    def prepareRequest(self, xml):
        feedtype = u'incremental'
        datasource = safe_unicode(self.source)
        params = []
 

src/c/o/collective.gsa-2.0rc9/collective/gsa/content_provider.py   collective.gsa(Download)
from zope.component import getMultiAdapter
 
from collective.gsa.utils import safe_unicode
from collective.gsa.interfaces import IContentProvider
 
    def content(self):
        title = self.context.Title()
        description = self.context.Description()
        content = u"%s - %s" % (safe_unicode(title), safe_unicode(description))
        return content, None
            title = self.context.Title()
            description = self.context.Description()
            content = u"%s - %s" % (safe_unicode(title), safe_unicode(description))
 
        return content, None

src/c/o/collective.gsa-2.0rc9/collective/gsa/gsafeeder.py   collective.gsa(Download)
from daemon.runner import DaemonRunner
import time
from collective.gsa.utils import encode_multipart_formdata, \
        safe_unicode
 
 
        with open(filename, "r") as xmlfile:
            xml = safe_unicode(xmlfile.read())
 
        body, headers = self.prepareRequest(xml)
    def prepareRequest(self, xml):
        feedtype = u'incremental'
        datasource = safe_unicode(self.source)
        params = []
 

src/c/o/collective.gsa-2.0rc9/collective/gsa/search.py   collective.gsa(Download)
from collective.gsa.parser import GSAResponse
from collective.gsa.exceptions import GSAUnreachableException
from collective.gsa.utils import safe_unicode
 
logger = getLogger('collective.gsa.search')
        for arg, val in args.items():
            if val and arg in GSA_TAGS.keys():
                prepare_query.append(u"%s=%s" % (GSA_TAGS[arg],safe_unicode(val)))
 
        query = "&".join(prepare_query)