Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def dump_rendered(self, req, fp, item, index, rendered):
body = rendered.split(to_binary('rdf:Description'))[1]
fp.write(to_binary('\n'))
def dump_rendered(self, req, fp, item, index, rendered):
body = rendered.split(to_binary('rdf:Description'))[1]
fp.write(to_binary('\n'))
def dump_rendered(self, req, fp, item, index, rendered):
header, body = rendered.split(to_binary('\n\n'), 1)
if index == 0:
fp.write(header)
fp.write(to_binary('\n\n'))
fp.write(body)
def dump_rendered(self, req, fp, item, index, rendered):
header, body = rendered.split(to_binary('\n\n'), 1)
if index == 0:
fp.write(header)
fp.write(to_binary('\n\n'))
fp.write(body)
def _delatex(s):
try:
t = to_binary(s, encoding='latin1')
result = t.decode('latex+latin1')
except UnicodeEncodeError:
result = string
u_result = text_type(result)
return u_result
def __str__(self):
pairs = [
(to_binary('ctx_ver'), to_binary('Z39.88-2004')),
(to_binary('rft_val_fmt'),
to_binary('info:ofi/fmt:kev:mtx:') + _encoded(self.mtx)),
(to_binary('rfr_id'), to_binary('info:sid/') + _encoded(self.sid))]
for pair in self:
pairs.append((_encoded(pair[0]), _encoded(pair[1])))
try:
return urlencode(pairs)
except UnicodeDecodeError: # pragma: no cover
return to_binary('')
def __str__(self):
pairs = [
(to_binary('ctx_ver'), to_binary('Z39.88-2004')),
(to_binary('rft_val_fmt'),
to_binary('info:ofi/fmt:kev:mtx:') + _encoded(self.mtx)),
(to_binary('rfr_id'), to_binary('info:sid/') + _encoded(self.sid))]
for pair in self:
pairs.append((_encoded(pair[0]), _encoded(pair[1])))
try:
return urlencode(pairs)
except UnicodeDecodeError: # pragma: no cover
return to_binary('')
def __str__(self):
pairs = [
(to_binary('ctx_ver'), to_binary('Z39.88-2004')),
(to_binary('rft_val_fmt'),
to_binary('info:ofi/fmt:kev:mtx:') + _encoded(self.mtx)),
(to_binary('rfr_id'), to_binary('info:sid/') + _encoded(self.sid))]
for pair in self:
pairs.append((_encoded(pair[0]), _encoded(pair[1])))
try:
return urlencode(pairs)
except UnicodeDecodeError: # pragma: no cover
return to_binary('')