1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
- Using \\ instead of \ in regular string syntax
- Using != instead of is not in conditions, when the object is not atomic
Index: kuttypy/utilities/syntax.py
===================================================================
--- kuttypy.orig/utilities/syntax.py
+++ kuttypy/utilities/syntax.py
@@ -54,16 +54,16 @@ class PythonHighlighter(QtGui.QSyntaxHig
# Comparison
'==', '!=', '<', '<=', '>', '>=',
# Arithmetic
- '\+', '-', '\*', '/', '//', '\%', '\*\*',
+ '\\+', '-', '\\*', '/', '//', '\\%', '\\*\\*',
# In-place
- '\+=', '-=', '\*=', '/=', '\%=',
+ '\\+=', '-=', '\\*=', '/=', '\\%=',
# Bitwise
- '\^', '\|', '\&', '\~', '>>', '<<',
+ '\\^', '\\|', '\\&', '\\~', '>>', '<<',
]
# Python braces
braces = [
- '\{', '\}', '\(', '\)', '\[', '\]',
+ '\\{', '\\}', '\\(', '\\)', '\\[', '\\]',
]
def __init__(self, parent: QtGui.QTextDocument) -> None:
@@ -215,16 +215,16 @@ class CHighlighter(QtGui.QSyntaxHighligh
# Comparison
'==', '!=', '<', '<=', '>', '>=',
# Arithmetic
- '\+', '-', '\*', '/', '//', '\%', '\*\*',
+ '\\+', '-', '\\*', '/', '//', '\\%', '\\*\\*',
# In-place
- '\+=', '-=', '\*=', '/=', '\%=',
+ '\\+=', '-=', '\\*=', '/=', '\\%=',
# Bitwise
- '\^', '\|', '\&', '\~', '>>', '<<',
+ '\\^', '\\|', '\\&', '\\~', '>>', '<<',
]
# Python braces
braces = [
- '\{', '\}', '\(', '\)', '\[', '\]',
+ '\\{', '\\}', '\\(', '\\)', '\\[', '\\]',
]
def __init__(self, parent: QtGui.QTextDocument) -> None:
Index: kuttypy/KuttyPyGUI.py
===================================================================
--- kuttypy.orig/KuttyPyGUI.py
+++ kuttypy/KuttyPyGUI.py
@@ -80,7 +80,7 @@ class AppWindow(QtWidgets.QMainWindow, l
self.defaultDirectory = path["examples"]
self.setTheme("material")
- examples = [a for a in os.listdir(os.path.join(path["examples"],self.EXAMPLES_DIR)) if ('.py' in a) and a is not 'kuttyPy.py'] #.py files except the library
+ examples = [a for a in os.listdir(os.path.join(path["examples"],self.EXAMPLES_DIR)) if ('.py' in a) and a != 'kuttyPy.py'] #.py files except the library
self.exampleList.addItems(examples)
blinkindex = self.exampleList.findText('blink.py')
if blinkindex!=-1: #default example. blink.py present in examples directory
Index: kuttypy/KuttyPyNano.py
===================================================================
--- kuttypy.orig/KuttyPyNano.py
+++ kuttypy/KuttyPyNano.py
@@ -63,7 +63,7 @@ class AppWindow(QtWidgets.QMainWindow, l
self.ipy = None
self.setTheme("material")
- examples = [a for a in os.listdir(os.path.join(path["examples"],self.EXAMPLES_DIR)) if ('.py' in a) and a is not 'kuttyPy.py'] #.py files except the library
+ examples = [a for a in os.listdir(os.path.join(path["examples"],self.EXAMPLES_DIR)) if ('.py' in a) and a != 'kuttyPy.py'] #.py files except the library
self.exampleList.addItems(examples)
blinkindex = self.exampleList.findText('blink.py')
if blinkindex!=-1: #default example. blink.py present in examples directory
Index: kuttypy/KuttyPyUno.py
===================================================================
--- kuttypy.orig/KuttyPyUno.py
+++ kuttypy/KuttyPyUno.py
@@ -63,7 +63,7 @@ class AppWindow(QtWidgets.QMainWindow, l
self.ipy = None
self.setTheme("material")
- examples = [a for a in os.listdir(os.path.join(path["examples"],self.EXAMPLES_DIR)) if ('.py' in a) and a is not 'kuttyPy.py'] #.py files except the library
+ examples = [a for a in os.listdir(os.path.join(path["examples"],self.EXAMPLES_DIR)) if ('.py' in a) and a != 'kuttyPy.py'] #.py files except the library
self.exampleList.addItems(examples)
blinkindex = self.exampleList.findText('blink.py')
if blinkindex!=-1: #default example. blink.py present in examples directory
|