MCPcopy Index your code
hub / github.com/python/cpython / js_output

Method js_output

Lib/http/cookies.py:393–404  ·  view source on GitHub ↗
(self, attrs=None)

Source from the content-addressed store, hash-verified

391 return '<%s: %s>' % (self.__class__.__name__, self.OutputString())
392
393 def js_output(self, attrs=None):
394 # Print javascript
395 output_string = self.OutputString(attrs)
396 if _has_control_character(output_string):
397 raise CookieError("Control characters are not allowed in cookies")
398 return """
399 <script type="text/javascript">
400 <!-- begin hiding
401 document.cookie = \"%s\";
402 // end hiding -->
403 </script>
404 """ % (output_string.replace('"', r'\"&#x27;))
405
406 def OutputString(self, attrs=None):
407 # Build up our result

Callers 5

test_setterMethod · 0.95
js_outputMethod · 0.45
test_loadMethod · 0.45
test_quoted_metaMethod · 0.45

Calls 4

OutputStringMethod · 0.95
_has_control_characterFunction · 0.85
CookieErrorClass · 0.85
replaceMethod · 0.45

Tested by 4

test_setterMethod · 0.76
test_loadMethod · 0.36
test_quoted_metaMethod · 0.36