d9933728 pyros2097

13 years ago
Minor Fixes...
Error.py ADDED
@@ -0,0 +1,4 @@
1
+ class Errors:
2
+ open = "Already Open"
3
+ locked = "Locked"
4
+ Exist = "Does not Exist"
README.md CHANGED
@@ -1,5 +1,4 @@
1
1
  ## Sabel v0.57
2
- ========================
3
2
 
4
3
  Sabel is an IDE for programming squirrel and EmoFramework.
5
4
  Can be used to Create games for android and ios.
Test/testMain.py CHANGED
@@ -6,6 +6,7 @@ import mainwindow
6
6
  import icons
7
7
  import sys
8
8
  import os
9
+ from globals import config
9
10
 
10
11
  path = os.getcwd()
11
12
 
@@ -14,12 +15,20 @@ class TestMainWindow:
14
15
  self.frame = mainwindow.MainWindow()
15
16
  self.frame.showMaximized()
16
17
  self.frame.init()
18
+ self.test_project()
17
19
  #self.test_file()
18
20
  #self.test_syntax()
19
21
  #self.test_openImage()
20
22
  #self.test_openAudio()
21
- self.test_openEditor()
23
+ #self.test_openEditor()
22
24
  sys.exit(app.exec_())
25
+
26
+ def test_project(self):
27
+ eq_(False,self.frame.treeWidget.createProject("C:/gg/gg/"))
28
+ if not(self.frame.treeWidget.contains("C:/port/")):
29
+ eq_(True,self.frame.treeWidget.createProject("C:/port/"))
30
+ else:
31
+ eq_(False,self.frame.treeWidget.createProject("C:/port/"))
23
32
 
24
33
  def test_file(self):
25
34
  eq_(False,self.frame.createTab("somefile.c"))
Widget/editor.pyc CHANGED
Binary file
Widget/tree.py CHANGED
@@ -123,6 +123,9 @@ class ProjectTree(QTreeWidget):
123
123
  if(len(config.projects()) != None):
124
124
  for pro in config.projects():
125
125
  self.createProject(pro)
126
+
127
+ def contains(self,pro):
128
+ return (pro in self.projects)
126
129
 
127
130
  def readDir(self,parent,path):
128
131
  for d in oslistdir(path):
@@ -159,27 +162,28 @@ class ProjectTree(QTreeWidget):
159
162
  fname = str(QFileDialog.getExistingDirectory(self,"Open Project Folder"))
160
163
  if not (fname == ""):
161
164
  fname = fname+"/"
162
- if len(self.projects) != 0:
163
- if(fname in self.projects):
164
- QMessageBox.about(self, "Already Open","Project Already Open\n"+fname)
165
- else:
166
- self.createProject(fname)
165
+ self.createProject(fname)
167
- else:
166
+
168
- self.createProject(fname)
169
-
170
167
  #Important all projects must go through this
171
168
  def createProject(self,startDir):
172
169
  if(ospathexists(startDir)):
170
+ if self.projects != None:
171
+ if(startDir in self.projects):#will work even if list is empty
172
+ QMessageBox.about(self, "Already Open","Project Already Open\n"+startDir)
173
+ return False
173
174
  self.projects.append(startDir)
174
175
  self.addProject(startDir)
175
176
  config.setProject(self.projects)
177
+ return True
176
178
  #print "adding"+startDir
177
179
  else:
178
- #print "removing"+startDir
180
+ #This is important very very important otherwise it will crash
181
+ if self.projects != None:
179
- if(startDir in self.projects):
182
+ if(startDir in self.projects):
180
- self.projects.remove(startDir)
183
+ self.projects.remove(startDir)
181
184
  config.setProject(self.projects)
182
185
  QMessageBox.about(self,"Can't Open Project","Project Does Not Exist %s"%startDir)
186
+ return False
183
187
 
184
188
 
185
189
 
@@ -211,8 +215,6 @@ class ProjectTree(QTreeWidget):
211
215
  self.projects.remove(itemPath)
212
216
  config.setProject(self.projects)
213
217
  self.takeTopLevelItem(self.indexOfTopLevelItem(item))
214
-
215
-
216
218
 
217
219
  def addItem(self,links):
218
220
  print links
Widget/tree.pyc CHANGED
Binary file
api/php.api ADDED
@@ -0,0 +1,60 @@
1
+ class
2
+ function
3
+ static
4
+ global
5
+ return
6
+ if (expression)
7
+ else
8
+ while (expression)
9
+ do
10
+ for ($i = 0; $i < $len; $i++)
11
+ foreach($array as $item)
12
+ switch ($value)
13
+ case
14
+ default:
15
+ break;
16
+ continue;
17
+ <<<TEXT
18
+ TEXT;
19
+ "\n"
20
+ echo
21
+ print_r?1($array)
22
+ printf?1()
23
+ rand?1(min, max)
24
+ range?1(min, max)
25
+ var_dump?1($value)
26
+ phpversion?1()
27
+
28
+ strlen?1()
29
+ strtoupper?1()
30
+ strtolower?1
31
+ ctype_alpha?1($c)
32
+ ctype_digit?1($c)
33
+ ctype_space?1($c)
34
+ substr?1($string,start,len)
35
+ str_repeat?1($string,val)
36
+ str_shuffle?1($string)
37
+ explode(separator,$string)
38
+ str_pad?1($string,val)
39
+ array?1(values)
40
+ sort?1($array) function to sort the contents of the array.
41
+ count?1($array) ->int function to count the number of elements in the array
42
+ array_sum?1($array) ->int function to calculate the sum of all values
43
+ array_count_values?1($array) ->array function returns an array with the number of occurrences for each value
44
+ array_unique?1($array) ->array function returns an array without duplicates
45
+ current?1($array) function returns the current element in the array
46
+ next?1($array) function advances the pointer by one position
47
+ prev?1($array) returns the element, one position before the current one
48
+ end?1($array) function returns the last element
49
+ reset?1($array) function to set the internal pointer to the first element again
50
+ list?1($idx, $val) function to create an array from two variables.
51
+ each?1($array) function returns the current key and value pair from an array and advances the array cursor
52
+ array_merge?1($array1, $array2) ($array) function to create $names array by merging the previous two arrays.
53
+ array_push?1($array,values) function inserts one or more items to the end of the array
54
+ array_pop?1($array) function removes the last item from the array
55
+ array_unshift?1($array,values) function adds values to the beginning of the array
56
+ array_shift?1($array) function removes the first item from the array
57
+ in_array?1(value, $array) function checks, if a specific element is inside an array
58
+ array_keys?1($array) function returns all the keys of an array
59
+ array_values?1($array) function returns all the values of an array
60
+ array_walk?1($array, func($value, $key)) function applies a user defined function to every member of the array
build/exe.win32-2.7/config.yml CHANGED
@@ -17,14 +17,18 @@ CMD:
17
17
  - GCC
18
18
  - NEKO
19
19
  - NEKOC
20
+ - PHP
20
21
  ClosedProject:
21
22
  - 0
22
23
  - 0
23
24
  File:
24
25
  - C:/Documents and Settings/Administrator/My Documents/www.mercyelectronic.com/index.html
25
26
  - C:/Documents and Settings/Administrator/My Documents/www.mercyelectronic.com/style.css
27
+ - C:/gg.php
28
+ - C:/CODE/Sabel/api/php.api
26
29
  PARAM:
27
30
  - hh
31
+ - C:/gg.php
28
32
  Project:
29
33
  - C:/CODE/datad/
30
34
  Recent: []
config.yml CHANGED
@@ -23,10 +23,12 @@ File:
23
23
  - C:/CODE/assets/creditscene.nut
24
24
  - C:/Documents and Settings/Administrator/My Documents/www.mercyelectronic.com/index.html
25
25
  - C:/Documents and Settings/Administrator/My Documents/www.mercyelectronic.com/style.css
26
+ - C:/CODE/Sabel/Test/testMain.py
26
27
  PARAM:
27
28
  - Dude
28
29
  Project:
29
30
  - C:/CODE/assets/
31
+ - C:/port/
30
32
  Recent: []
31
33
  Setting:
32
34
  device: 1
@@ -35,7 +37,7 @@ Setting:
35
37
  iconsize: 16
36
38
  mode: 0
37
39
  styleindex: 8
38
- tabwidth: 3
40
+ tabwidth: 2
39
41
  thresh: 2
40
42
  workspace: C:/CODE/
41
43
  Style: 0
license.txt ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2012 Peter John (pyros2097@gmail.com)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.