Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def meth(self):
super()
def read(self, amt=None):
if self.fp is None:
return bytes(b"")
if self._method == "HEAD":
self._close_conn()
return bytes(b"")
if amt is not None:
# Amount is given, so call base class version
# (which is implemented in terms of self.readinto)
return bytes(super(HTTPResponse, self).read(amt))
else:
# Amount is not given (unbounded read) so we must check self.length
# and self.chunked
if self.chunked:
return self._readall_chunked()
if self.length is None:
s = self.fp.read()
else:
try:
s = self._safe_read(self.length)
except IncompleteRead:
self._close_conn()
raise
self.length = 0
def __init__(self):
self.__super = super(B, self)
def meth(self, a):
def domain(self):
return ''.join(super(DomainLiteral, self).value.split())
def close(self):
super().close() # set "closed" flag
if self.fp:
self._close_conn()
def resizeEvent(self, e):
"""
Overrides resize event to resize the editor's panels.
:param e: resize event
"""
super(CodeEdit, self).resizeEvent(e)
self.panels.resize()
def flush(self):
super().flush()
if self.fp:
self.fp.flush()
if hours and form.instance.link:
lookup = {
"link": form.instance.link,
"publish_date__gt": now() - timedelta(hours=hours),
}
try:
link = Link.objects.get(**lookup)
except Link.DoesNotExist:
pass
else:
error(self.request, "Link exists")
return redirect(link)
form.instance.user = self.request.user
form.instance.gen_description = False
info(self.request, "Link created")
return super(LinkCreate, self).form_valid(form)
:param clear: True to clear the editor content before closing.
"""
if self._closed:
return
self._closed = True
if self._tooltips_runner:
self._tooltips_runner.cancel_requests()
self._tooltips_runner = None
self.decorations.clear()
self.modes.clear()
self.panels.clear()
self.backend.stop()
Cache().set_cursor_position(
self.file.path, self.textCursor().position())
super(CodeEdit, self).close()
def __init__(self, x, y, z, field, xderiv, yderiv, zderiv,
structural_index, windows, size, keep=0.2):
super().__init__(x, y, z, field, xderiv, yderiv, zderiv,
structural_index)
self.windows = windows
self.size = size
self.keep = keep
self.window_centers = self._get_window_centers()