Ejemplo n.º 1
0
    def run(self, edit, preview=True, skip_selected=False):
        queue = common.Queue()
        region, source = self.sel(skip_selected)

        queue.put((source, self.view.file_name(), self.view, region))
        common.set_timeout(
            lambda: common.worker(queue, preview, pep8_params()),
            common.WORKER_START_TIMEOUT)
Ejemplo n.º 2
0
    def run(self, edit, preview=True, skip_selected=False):
        queue = common.Queue()
        region, source, encoding = self.sel(skip_selected)
        if not isinstance(source, unicode) and hasattr('decode'):
            source = source.decode(encoding)

        queue.put((source, self.view.file_name(), self.view, region, encoding))
        common.set_timeout(
            lambda: common.worker(queue, preview, pep8_params()),
            common.WORKER_START_TIMEOUT)
Ejemplo n.º 3
0
    def run(self, edit, preview=True, skip_selected=False):
        queue = common.Queue()
        region, source, encoding = self.sel(skip_selected)
        if not isinstance(source, unicode) and hasattr('decode'):
            source = source.decode(encoding)

        queue.put((source, self.view.file_name(), self.view, region, encoding))
        common.set_timeout(
            lambda: common.worker(queue, preview, pep8_params()),
            common.WORKER_START_TIMEOUT)
Ejemplo n.º 4
0
    def run(self, paths=None, preview=True):
        if not paths:
            return
        queue = common.Queue()

        for path in self.files(paths):
            with open(path, 'r') as fd:
                source = fd.read()
            queue.put((source, path, None, None))

        common.set_timeout(
            lambda: common.worker(queue, preview, pep8_params()),
            common.WORKER_START_TIMEOUT)
Ejemplo n.º 5
0
    def run(self, paths=None, preview=True):
        if not paths:
            return
        queue = common.Queue()

        for path in self.files(paths):
            with open(path, 'r') as fd:
                source = fd.read()

            encoding = common.get_pyencoding(source)
            if not isinstance(source, unicode) and hasattr(source, 'decode'):
                source = source.decode(encoding)

            queue.put((source, path, None, None, encoding))

        common.set_timeout(
            lambda: common.worker(queue, preview, pep8_params()),
            common.WORKER_START_TIMEOUT)
Ejemplo n.º 6
0
    def run(self, paths=None, preview=True):
        if not paths:
            return
        queue = common.Queue()

        for path in self.files(paths):
            with open(path, 'r') as fd:
                source = fd.read()

            encoding = common.get_pyencoding(source)
            if not isinstance(source, unicode) and hasattr(source, 'decode'):
                source = source.decode(encoding)

            queue.put((source, path, None, None, encoding))

        common.set_timeout(
            lambda: common.worker(queue, preview, pep8_params()),
            common.WORKER_START_TIMEOUT)