Did I find the right examples for you? yes no

All Samples(24)  |  Call(4)  |  Derive(0)  |  Import(20)
unicode(object='') -> unicode object
unicode(string[, encoding[, errors]]) -> unicode object

Create a new Unicode object from the given encoded string.
encoding defaults to the current default string encoding.
errors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'.

src/p/y/python-creole-1.1.1/creole/rest2html/clean_writer.py   python-creole(Download)
 
from creole.exceptions import DocutilsImportError
from creole.py3compat import TEXT_TYPE, PY3
 
try:
 
            if isinstance(value, list):
                value = ' '.join([TEXT_TYPE(x) for x in value])
 
            part = '%s="%s"' % (name.lower(), self.attval(TEXT_TYPE(value)))
        content = unicode(content)
 
    assert isinstance(content, TEXT_TYPE), "rest2html content must be %s, but it's %s" % (TEXT_TYPE, type(content))
 
    settings_overrides = {

src/p/y/python-creole-HEAD/creole/rest2html/clean_writer.py   python-creole(Download)
 
from creole.exceptions import DocutilsImportError
from creole.py3compat import TEXT_TYPE, PY3
 
try:
 
            if isinstance(value, list):
                value = ' '.join([TEXT_TYPE(x) for x in value])
 
            part = '%s="%s"' % (name.lower(), self.attval(TEXT_TYPE(value)))
        content = unicode(content)
 
    assert isinstance(content, TEXT_TYPE), "rest2html content must be %s, but it's %s" % (TEXT_TYPE, type(content))
 
    settings_overrides = {

src/p/y/python-creole-1.1.1/creole/shared/utils.py   python-creole(Download)
import shlex
 
from creole.py3compat import TEXT_TYPE, PY3, repr2
 
 
    See test_creole2html.TestString2Dict()
    """
    if not PY3 and isinstance(raw_content, TEXT_TYPE):
        # shlex.split doesn't work with unicode?!?
        raw_content = raw_content.encode(encoding)

src/p/y/python-creole-HEAD/creole/shared/utils.py   python-creole(Download)
import shlex
 
from creole.py3compat import TEXT_TYPE, PY3, repr2
 
 
    See test_creole2html.TestString2Dict()
    """
    if not PY3 and isinstance(raw_content, TEXT_TYPE):
        # shlex.split doesn't work with unicode?!?
        raw_content = raw_content.encode(encoding)

src/p/y/python-creole-1.1.1/creole/html_parser/parser.py   python-creole(Download)
from creole.html_parser.config import BLOCK_TAGS, IGNORE_TAGS
from creole.html_tools.strip_html import strip_html
from creole.py3compat import TEXT_TYPE, BINARY_TYPE
from creole.shared.document_tree import DocNode, DebugList
from creole.shared.html_parser import HTMLParser
    def _pre_cut(self, data, type, placeholder):
        if self.debugging:
            print("append blockdata: %r" % data)
        assert isinstance(data, TEXT_TYPE), "blockdata is not unicode"
        self.blockdata.append(data)
    def feed(self, raw_data):
        assert isinstance(raw_data, TEXT_TYPE), "feed data must be unicode!"
        data = raw_data.strip()
 
        # cut out <pre> and <tt> areas block tag areas

src/p/y/python-creole-HEAD/creole/html_parser/parser.py   python-creole(Download)
from creole.html_parser.config import BLOCK_TAGS, IGNORE_TAGS
from creole.html_tools.strip_html import strip_html
from creole.py3compat import TEXT_TYPE, BINARY_TYPE
from creole.shared.document_tree import DocNode, DebugList
from creole.shared.html_parser import HTMLParser
    def _pre_cut(self, data, type, placeholder):
        if self.debugging:
            print("append blockdata: %r" % data)
        assert isinstance(data, TEXT_TYPE), "blockdata is not unicode"
        self.blockdata.append(data)
    def feed(self, raw_data):
        assert isinstance(raw_data, TEXT_TYPE), "feed data must be unicode!"
        data = raw_data.strip()
 
        # cut out <pre> and <tt> areas block tag areas

src/p/y/python-creole-1.1.1/creole/creole2html/emitter.py   python-creole(Download)
 
from creole.creole2html.parser import CreoleParser
from creole.py3compat import TEXT_TYPE, repr2
from creole.shared.utils import string2dict
 
            )
 
        if not isinstance(result, TEXT_TYPE):
            msg = "Macro '%s' doesn't return a unicode string!" % macro_name
            if self.verbose > 1:

src/p/y/python-creole-HEAD/creole/creole2html/emitter.py   python-creole(Download)
 
from creole.creole2html.parser import CreoleParser
from creole.py3compat import TEXT_TYPE, repr2
from creole.shared.utils import string2dict
 
            )
 
        if not isinstance(result, TEXT_TYPE):
            msg = "Macro '%s' doesn't return a unicode string!" % macro_name
            if self.verbose > 1:

src/p/y/python-creole-1.1.1/creole/shared/base_emitter.py   python-creole(Download)
from creole.html_parser.config import BLOCK_TAGS
from creole.html_tools.deentity import Deentity
from creole.py3compat import TEXT_TYPE
from creole.shared.markup_table import MarkupTable
from creole.shared.unknown_tags import transparent_unknown_nodes
        for child in node.children:
            content = self.emit_node(child)
            assert isinstance(content, TEXT_TYPE)
            result.append(content)
        return result
        if emit_method:
            content = emit_method(node)
            if not isinstance(content, TEXT_TYPE):
                unicode_error(method_name, emit_method, node, content)
        else:
            content = self._unknown_emit(self, node)
            if not isinstance(content, TEXT_TYPE):

src/p/y/python-creole-HEAD/creole/shared/base_emitter.py   python-creole(Download)
from creole.html_parser.config import BLOCK_TAGS
from creole.html_tools.deentity import Deentity
from creole.py3compat import TEXT_TYPE
from creole.shared.markup_table import MarkupTable
from creole.shared.unknown_tags import transparent_unknown_nodes
        for child in node.children:
            content = self.emit_node(child)
            assert isinstance(content, TEXT_TYPE)
            result.append(content)
        return result
        if emit_method:
            content = emit_method(node)
            if not isinstance(content, TEXT_TYPE):
                unicode_error(method_name, emit_method, node, content)
        else:
            content = self._unknown_emit(self, node)
            if not isinstance(content, TEXT_TYPE):

  1 | 2  Next