Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pyqode/core/api/code_edit.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
This module contains the base code editor widget.
"""
from __future__ import print_function
import os
import sys
try:
from future.builtins import str, super
except:
# not availabe on python 3.2 (but not needed)
pass
import logging
import platform
from pyqode.core import icons
Expand Down
1 change: 0 additions & 1 deletion pyqode/core/api/folding.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
This module contains the code folding API.

"""
from __future__ import print_function
import logging
import sys
from pyqode.core.api.utils import TextBlockHelper
Expand Down
7 changes: 0 additions & 7 deletions pyqode/core/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@
import logging
from pyqode.qt import QtCore

try:
from future.builtins import open
from future.builtins import str
except:
pass # python 3.2 not supported


class Cache(object):
"""
Provides an easy acces to the cache by exposing some wrapper properties
Expand Down
5 changes: 0 additions & 5 deletions pyqode/core/managers/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
This module contains the file helper implementation

"""
try:
from future.builtins import open
from future.builtins import str
except:
pass # python 3.2 not supported
import locale
import logging
import mimetypes
Expand Down
14 changes: 7 additions & 7 deletions pyqode/core/panels/folding.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def on_install(self, editor):
def sizeHint(self):
""" Returns the widget size hint (based on the editor font size) """
fm = QtGui.QFontMetricsF(self.editor.font())
size_hint = QtCore.QSize(fm.height(), fm.height())
size_hint = QtCore.QSize(int(fm.height()), int(fm.height()))
if size_hint.width() > 16:
size_hint.setWidth(16)
return size_hint
Expand Down Expand Up @@ -332,12 +332,12 @@ def merged_colors(colorA, colorB, factor):
colorA = QtGui.QColor(colorA)
colorB = QtGui.QColor(colorB)
tmp = colorA
tmp.setRed((tmp.red() * factor) / maxFactor +
(colorB.red() * (maxFactor - factor)) / maxFactor)
tmp.setGreen((tmp.green() * factor) / maxFactor +
(colorB.green() * (maxFactor - factor)) / maxFactor)
tmp.setBlue((tmp.blue() * factor) / maxFactor +
(colorB.blue() * (maxFactor - factor)) / maxFactor)
tmp.setRed(int((tmp.red() * factor) / maxFactor +
(colorB.red() * (maxFactor - factor)) / maxFactor))
tmp.setGreen(int((tmp.green() * factor) / maxFactor +
(colorB.green() * (maxFactor - factor)) / maxFactor))
tmp.setBlue(int((tmp.blue() * factor) / maxFactor +
(colorB.blue() * (maxFactor - factor)) / maxFactor))
return tmp

pal = QtWidgets.QApplication.instance().palette()
Expand Down
6 changes: 3 additions & 3 deletions pyqode/core/panels/global_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def _draw_visible_area(self, painter):
end = self.editor.visible_blocks[-1][-1]
rect = QtCore.QRect()
rect.setX(0)
rect.setY(start.blockNumber() * self.get_marker_height())
rect.setWidth(self.sizeHint().width())
rect.setBottom(end.blockNumber() * self.get_marker_height())
rect.setY(int(start.blockNumber() * self.get_marker_height()))
rect.setWidth(int(self.sizeHint().width()))
rect.setBottom(int(end.blockNumber() * self.get_marker_height()))
if self.editor.background.lightness() < 128:
c = self.editor.background.darker(150)
else:
Expand Down
2 changes: 1 addition & 1 deletion pyqode/python/backend/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def run_pep8(request_data):

PYFLAKES_ERROR_MESSAGES = [
messages.DoctestSyntaxError,
messages.ReturnWithArgsInsideGenerator,
messages.ReturnOutsideFunction,
messages.UndefinedExport,
messages.UndefinedName,
messages.UndefinedLocal
Expand Down
5 changes: 4 additions & 1 deletion pyqode/qt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ def setup_apiv2():
if sys.version_info[0] == 2:
logging.getLogger(__name__).debug(
'setting up SIP API to version 2')
import sip
try:
from PyQt5 import sip
except:
import sip
try:
sip.setapi("QString", 2)
sip.setapi("QVariant", 2)
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ altgraph==0.15
autopep8==1.3.5
cycler==0.10.0
docutils==0.14
future==0.16.0
jedi==0.11.1
kiwisolver==1.0.1
macholib==1.9
Expand Down
2 changes: 1 addition & 1 deletion src/algo/worker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import time
import typing
from collections import Iterable
from collections.abc import Iterable
from typing import *

from algo.stmts import *
Expand Down
11 changes: 6 additions & 5 deletions src/forms/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def python_input(prompt="", globals=None, locals=None, unsafe=False):
def python_print_error(msg, end="\n"):
ExecState.current_output += util.html.color_span(msg, "red") + end

if not AppState.mode_python:
if not AppState.mode_python and ExecState.worker is not None:
set_current_line(ExecState.worker.last, True)

update_output()
Expand Down Expand Up @@ -840,7 +840,7 @@ def handler_Step():
show_error()
finally:
plot_update()
if ExecState.worker.finished:
if ExecState.worker is not None and ExecState.worker.finished:
GuiState.ui.actionRun.setDisabled(False)
if not ExecState.stop_flag:
end_output()
Expand All @@ -849,9 +849,10 @@ def handler_Step():
ExecState.running = False
GuiState.ui.actionDebug.setDisabled(False)
GuiState.ui.actionStep.setDisabled(False)
GuiState.ui.actionNew.setDisabled(not ExecState.worker.finished)
GuiState.ui.actionOpen.setDisabled(not ExecState.worker.finished)
GuiState.ui.actionStop.setEnabled(not ExecState.worker.finished)
if ExecState.worker is not None:
GuiState.ui.actionNew.setDisabled(not ExecState.worker.finished)
GuiState.ui.actionOpen.setDisabled(not ExecState.worker.finished)
GuiState.ui.actionStop.setEnabled(not ExecState.worker.finished)


def handler_Debug():
Expand Down
Loading