How to use the future.builtins.super function in future

To help you get started, we’ve selected a few future examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyglet / pyglet / tests / extlibs / future / py2_3 / future / backports / http / client.py View on Github external
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
github PythonCharmers / python-future / tests / test_future / test_super.py View on Github external
def __init__(self):
                self.__super = super(B, self)
            def meth(self, a):
github PythonCharmers / python-future / src / future / backports / email / _header_value_parser.py View on Github external
def domain(self):
        return ''.join(super(DomainLiteral, self).value.split())
github pyQode / pyqode.core / pyqode / core / api / code_edit.py View on Github external
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()
github stephenmcd / drum / drum / links / views.py View on Github external
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)
github pyQode / pyqode.core / pyqode / core / api / code_edit.py View on Github external
: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()
github fatiando / fatiando / fatiando / gravmag / euler.py View on Github external
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()