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

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)
strip(s, color=False) -> str

Strips the : from the start of a string
and optionally also strips all colors if
color is True.

        def strip(s, color=False):
    """strip(s, color=False) -> str

    Strips the : from the start of a string
    and optionally also strips all colors if
    color is True.
    """

    if len(s) > 0:
        if s[0] == ":":
            s = s[1:]
    if color:
        s = s.replace("\x01", "")
        s = s.replace("\x02", "")
    return s
        


src/k/d/kdb-1.0.2/kdb/plugins/web/__init__.py   kdb(Download)
 
 
from circuits.protocols.irc import strip
from circuits import handler, task, Component
from circuits.web import Server, Controller, JSONRPC, Static
                value = yield self.call(event, "commands")
                yield "\n".join(
                    escape(strip(msg))
                    for msg in wrapvalue(command, event, value.value)
                )

src/c/i/circuits-3.0.0.dev/tests/protocols/test_irc.py   circuits(Download)
#!/usr/bin/env python
 
from circuits import handler, Event, Component
from circuits.protocols.irc import strip, sourceJoin, sourceSplit, IRC
 
def test_strip():
    s = ":\x01\x02test\x02\x01"
    s = strip(s)
    assert s == "\x01\x02test\x02\x01"
 
    s = ":\x01\x02test\x02\x01"
    s = strip(s, color=True)