All Samples(632) | Call(595) | Derive(0) | Import(37)
rfind(s, sub [,start [,end]]) -> int Return the highest index in s where substring sub is found, such that sub is contained within s[start,end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
def rfind(s, *args):
"""rfind(s, sub [,start [,end]]) -> int
Return the highest index in s where substring sub is found,
such that sub is contained within s[start,end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
"""
return s.rfind(*args)
r = string.find(text, "\n", i, i+cols)
j = r
if r == -1:
j = string.rfind(text, " ", i, i+cols)
if j == -1:
r = string.find(text, "\n", i+cols)
if r == -1: r = ltext
src/d/j/django-navbar-0.3.0/examples/dbgp/_logging/__init__.py django-navbar(Download)
def _fixupParents(self, alogger):
"""
Ensure that there are either loggers or placeholders all the way
from the specified logger to the root of the logger hierarchy.
"""
name = alogger.name
i = string.rfind(name, ".")
else:
assert isinstance(obj, PlaceHolder)
obj.append(alogger)
i = string.rfind(name, ".", 0, i - 1)
if not rv:
rv = self.root
alogger.parent = rv
src/c/l/clearsilver-0.10.1/clearsilver/python/examples/trans/trans.py clearsilver(Download)
def handleFile(self, file):
if file in self.ignore_files: return []
for a_re in self.ignore_patterns:
if re.match(a_re,file):
return []
fpath = self.root + '/' + file
x = string.rfind(file, '.')
if reason[0] != 17:
raise
do_hdf = 0
x = string.rfind(file, '.')
if x != -1 and file[x:] == '.hdf':
do_hdf = 1
ofs = []
src/c/l/clearversion-HEAD/trunk/clearVersion/etc/subversion/hooks/examples/mailer.py clearversion(Download)
if change.item_kind == svn.core.svn_node_dir:
dirs[path] = None
else:
idx = string.rfind(path, '/')
if idx == -1:
dirs[''] = None
else:
src/c/l/clearversion-HEAD/clearVersion/etc/subversion/hooks/examples/mailer.py clearversion(Download)
if change.item_kind == svn.core.svn_node_dir:
dirs[path] = None
else:
idx = string.rfind(path, '/')
if idx == -1:
dirs[''] = None
else:
src/b/o/boodler-HEAD/core/branch/rel_1_6_1/src/boodle/sample.py boodler(Download)
else:
raise SampleError('file not readable: ' + sname)
dotpos = string.rfind(sname, '.')
if (dotpos >= 0):
suffix = sname[dotpos : ]
else:
src/b/o/boodler-HEAD/core/branch/rel_1_6_0/src/boodle/sample.py boodler(Download)
else:
raise SampleError('file not readable: ' + sname)
dotpos = string.rfind(sname, '.')
if (dotpos >= 0):
suffix = sname[dotpos : ]
else:
src/b/o/boodler-HEAD/core/branch/dev_1_x/src/boodle/sample.py boodler(Download)
else:
raise SampleError('file not readable: ' + sname)
dotpos = string.rfind(sname, '.')
if (dotpos >= 0):
suffix = sname[dotpos : ]
else:
src/b/o/boodler-HEAD/core/branch/rel_1_5_3/boodle/sample.py boodler(Download)
else:
raise SampleError('file not readable: ' + sname)
dotpos = string.rfind(sname, '.')
if (dotpos >= 0):
suffix = sname[dotpos : ]
else:
src/m/e/mechanoid-0.6.9/mechanoid/cookiejar/DefaultCookiePolicy.py mechanoid(Download)
req_host, erhn = self.common.eff_request_host(request) domain = cookie.domain if self.strict_domain and (string.count(domain, ".") >= 2): i = string.rfind(domain, ".") j = string.rfind(domain, ".", 0, i) if j == 0: # domain like .foo.bar tld = domain[i+1:]
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next