18e45927 pyros2097

13 years ago
v0.49
Bin/sqc.exe ADDED
Binary file
Lib/__init__.py DELETED
File without changes
Lib/libsqstdlib.a DELETED
Binary file
Lib/libsquirrel.a DELETED
Binary file
Widget/__init__.py CHANGED
@@ -2,5 +2,6 @@ from editor import Editor
2
2
  from tab import Tab
3
3
  from tree import Tree
4
4
  from adb import Adb
5
+ from parser import Parser
5
6
  from ipython import PyInterp
6
7
  from style import *
Widget/__init__.pyc CHANGED
Binary file
Widget/adb.py CHANGED
@@ -45,7 +45,7 @@ class Adb(QWidget):
45
45
  self.parent.tabWidget_3.setCurrentIndex(1)
46
46
  self.parent.textEdit.clear()
47
47
  self.parent.textEdit.append("Pushing main.nut\n")
48
- self.adb_process = Popen(adblist[0], shell=False, stdout=PIPE,stderr=STDOUT)
48
+ self.adb_process = Popen(adblist[0], creationflags=0x08000000, shell=False, stdout=PIPE,stderr=STDOUT)
49
49
  t = threading.Thread(target=self.output, args=(self.adb_process.stdout,))
50
50
  t.start()
51
51
  t.join()
Widget/adb.pyc CHANGED
Binary file
Widget/lexersquirrel.py CHANGED
@@ -45,18 +45,41 @@ class LexerSquirrel(QsciLexerPython):
45
45
  self.marginFont.setFamily("MS Dlg")
46
46
  self.boldFont = QFont(self.plainFont)
47
47
  self.boldFont.setBold(True)
48
+ """
49
+ enum {
50
+ Default = 0, Comment = 1, Number = 2,
51
+ DoubleQuotedString = 3, SingleQuotedString = 4, Keyword = 5,
52
+ TripleSingleQuotedString = 6, TripleDoubleQuotedString = 7, ClassName = 8,
53
+ FunctionMethodName = 9, Operator = 10, Identifier = 11,
54
+ CommentBlock = 12, UnclosedString = 13, HighlightedIdentifier = 14,
55
+ Decorator = 15
56
+ }
57
+ enum IndentationWarning {
58
+ NoWarning = 0, Inconsistent = 1, TabsAfterSpaces = 2,
59
+ Spaces = 3, Tabs = 4
60
+ }
61
+ """
48
62
  self.styles = [
49
63
  #index description color paper font eol
50
64
  QsciStyle(0, QString("base"), self.colorStyle.color, self.colorStyle.paper, self.plainFont, True),
51
- QsciStyle(1, QString("comment"), QColor("#008000"), QColor("#eeffee"), self.plainFont, True),
65
+ QsciStyle(1, QString("comment"), QColor("#008000"), self.colorStyle.paper, self.plainFont, True),
52
- QsciStyle(2, QString("keyword"), QColor("#008000"), QColor("#ffffff"), self.boldFont, False),
66
+ QsciStyle(2, QString("number"), QColor("#008000"), self.colorStyle.paper, self.boldFont, False),
53
- QsciStyle(3, QString("string"), QColor("#008000"), QColor("#ffffff"), self.plainFont, True),
67
+ QsciStyle(3, QString("DoubleQuotedString"), QColor("#008000"), self.colorStyle.paper, self.plainFont, True),
54
- QsciStyle(4, QString("number"), QColor("#008000"), QColor("#ffffff"), self.plainFont, True),
68
+ QsciStyle(4, QString("SingleQuotedString"), QColor("#008000"), self.colorStyle.paper, self.plainFont, True),
55
- QsciStyle(5, QString("macro"), QColor("#808000"), QColor("#ffffff"), self.plainFont, True),
69
+ QsciStyle(5, QString("Keyword"), QColor("#808000"), self.colorStyle.paper, self.plainFont, True),
70
+ QsciStyle(6, QString("TripleSingleQuotedString"), self.colorStyle.paper, QColor("#ffd0d0"), self.plainFont, True),
71
+ QsciStyle(7, QString("TripleDoubleQuotedString"), self.colorStyle.paper, QColor("#001111"), self.plainFont, False),
72
+ QsciStyle(8, QString("ClassName"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False),
73
+ QsciStyle(9, QString("FunctionMethodName"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False),
56
- QsciStyle(6, QString("error"), QColor("#000000"), QColor("#ffd0d0"), self.plainFont, True),
74
+ QsciStyle(10, QString("Operator"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False),
75
+ QsciStyle(11, QString("Identifier"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False),
76
+ QsciStyle(12, QString("CommentBlock"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False),
77
+ QsciStyle(13, QString("UnclosedString"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False),
78
+ QsciStyle(14, QString("HighlightedIdentifier"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False),
79
+ QsciStyle(15, QString("Decorator"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False)
57
- QsciStyle(7, QString("MultiComment_start"), QColor("#ff00ff"), QColor("#001111"), self.plainFont, False),
80
+ #QsciStyle(7, QString("MultiComment_start"), QColor("#ff00ff"), QColor("#001111"), self.plainFont, False),
58
- QsciStyle(8, QString("MultiComment"), QColor("#ff00ff"), QColor("#001111"), self.plainFont, False),
81
+ #QsciStyle(8, QString("MultiComment"), QColor("#ff00ff"), QColor("#001111"), self.plainFont, False),
59
- QsciStyle(9, QString("MultiComment_stop"), QColor("#ff00ff"), QColor("#001111"), self.plainFont, False)
82
+ #QsciStyle(9, QString("MultiComment_stop"), QColor("#ff00ff"), QColor("#001111"), self.plainFont, False)
60
83
  ]
61
84
  self._foldcompact = True
62
85
 
Widget/parser.py ADDED
@@ -0,0 +1,50 @@
1
+ from globals import sqcDir
2
+ from PyQt4.QtGui import QWidget
3
+ import threading
4
+ from subprocess import PIPE,Popen,STDOUT
5
+ from PyQt4.QtCore import pyqtSignal,SIGNAL
6
+
7
+
8
+ class Parser(QWidget):
9
+ def __init__(self,parent):
10
+ QWidget.__init__(self,parent)
11
+ self.parent = parent
12
+ self.parser_process = None
13
+ self.isRunning = False
14
+ self.connect(self, SIGNAL("parse"),self.update)
15
+
16
+ def update(self,line):
17
+ self.parent.textEdit_2.append(line)
18
+ if(self.parent.tabWidget_3.isHidden()):
19
+ self.parent.tabWidget_3.show()
20
+ self.parent.tabWidget_3.setCurrentIndex(0)
21
+
22
+ def output(self,pipe):
23
+ while True:
24
+ try:
25
+ if self.parser_process.poll() != None:
26
+ break
27
+ line = pipe.readline().strip()
28
+
29
+ if len(line) > 0:
30
+ self.emit(SIGNAL("parse"),line)
31
+ except:
32
+ print "except"
33
+ #traceback.print_exc()
34
+
35
+
36
+ def run(self,nfile):
37
+ #print nfile
38
+ if(nfile.endswith(".nut")):
39
+ self.parent.textEdit_2.clear()
40
+ if self.parser_process != None and self.parser_process.poll() == None:
41
+ self.parser_process.kill()
42
+ self.parser_process = Popen(sqcDir+" "+nfile, creationflags=0x08000000, shell=False, stdout=PIPE,stderr=PIPE)
43
+ t = threading.Thread(target=self.output, args=(self.parser_process.stdout,))
44
+ t.start()
45
+ t.join()
46
+
47
+
48
+ def close(self):
49
+ if self.parser_process != None and self.parser_process.poll() == None:
50
+ self.parser_process.kill()
build/exe.win32-2.7/config.yaml CHANGED
@@ -6,6 +6,9 @@ ADB:
6
6
  shell kill
7
7
  File:
8
8
  - C:/CODE/assets/creditscene.nut
9
+ - C:/CODE/assets/common.nut
10
+ - C:/CODE/assets/logoscene.nut
11
+ - C:/CODE/assets/main.nut
9
12
  Project:
10
13
  - C:/CODE/data/
11
14
  - C:/CODE/assets/
build/exe.win32-2.7/library.zip CHANGED
Binary file
config.yaml CHANGED
@@ -6,6 +6,8 @@ ADB:
6
6
  shell kill
7
7
  File:
8
8
  - C:/CODE/assets/runtime.nut
9
+ - C:/CODE/assets/main.nut
10
+ - C:/CODE/assets/howtoscene.nut
9
11
  Project:
10
12
  - C:/CODE/data/
11
13
  - C:/CODE/assets/
@@ -15,7 +17,7 @@ Setting:
15
17
  fontname: Courier New
16
18
  fontsize: 10
17
19
  iconsize: 16
18
- styleindex: 0
20
+ styleindex: 4
19
21
  thresh: 1
20
22
  workspace: C:/CODE/
21
23
  Style: 0
globals.py CHANGED
@@ -5,7 +5,7 @@ __version__ = "0.48"
5
5
  __copyright__ = 'Copyright (c) 2012, pyros2097'
6
6
  __credits__ = ['pyros2097', 'eclipse']
7
7
  __email__ = 'pyros2097@gmail.com'
8
- __version__ = "0.48"
8
+ __version__ = "0.49"
9
9
 
10
10
 
11
11
  import os
@@ -36,6 +36,8 @@ OS_NAME = system()
36
36
  workDir = os.getcwd()
37
37
  apiDir = ospathjoin(workDir,"api")
38
38
  iconDir = ospathjoin("Icons")
39
+ binDir = ospathjoin(workDir,"bin")
40
+ sqcDir = ospathjoin(binDir,"sqc.exe")
39
41
 
40
42
 
41
43
  recycle = send2trash
main.py CHANGED
@@ -8,7 +8,7 @@ from PyQt4.QtGui import (QApplication,QPixmap,QSplashScreen,QMessageBox,
8
8
  from PyQt4.QtCore import SIGNAL,Qt,QStringList,QString
9
9
  import icons_rc
10
10
  from window import Window
11
- from Widget import Editor,PyInterp,Adb
11
+ from Widget import Editor,PyInterp,Adb,Parser
12
12
  from globals import (ospathsep,ospathjoin,ospathbasename,workDir,
13
13
  OS_NAME,os_icon,config,workSpace,
14
14
  iconSize,iconDir,ospathexists,os_pixmap)
@@ -24,6 +24,7 @@ class MainWindow(Window):
24
24
  self.dirty = None
25
25
  self.isFull = False
26
26
  self.adb = Adb(self)
27
+ self.parser = Parser(self)
27
28
  self.init()
28
29
 
29
30
  def init(self):
@@ -207,6 +208,7 @@ class MainWindow(Window):
207
208
  fl.write(tempText)
208
209
  fl.close()
209
210
  self.clearDirty(index)
211
+ self.parser.run(self.files[index])
210
212
  else:
211
213
  QMessageBox.about(self, "Can't Save","Failed to save ...")
212
214
  self.statusBar().showMessage('Failed to save ...', 5000)
@@ -234,6 +236,7 @@ class MainWindow(Window):
234
236
  def closeEvent(self, event):
235
237
  #check this ine adb.exe process is always on
236
238
  self.adb.close()
239
+ self.parser.close()
237
240
  notSaved = False
238
241
  for files in self.dirty:
239
242
  if files == True: