easycoder 251026.1__py2.py3-none-any.whl → 251103.2__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of easycoder might be problematic. Click here for more details.

easycoder/__init__.py CHANGED
@@ -12,4 +12,4 @@ from .ec_pyside import *
12
12
  from .ec_timestamp import *
13
13
  from .ec_value import *
14
14
 
15
- __version__ = "251026.1"
15
+ __version__ = "251103.2"
easycoder/ec_compiler.py CHANGED
@@ -78,7 +78,10 @@ class Compiler:
78
78
  return self.program.code[pc]
79
79
 
80
80
  # Add a command to the code list
81
- def add(self, command):
81
+ def addCommand(self, command):
82
+ if len(self.code) == 0:
83
+ if self.program.usingGraphics:
84
+ pass
82
85
  self.code.append(command)
83
86
 
84
87
  def isSymbol(self):
@@ -161,7 +164,7 @@ class Compiler:
161
164
  command['locked'] = False
162
165
  command['extra'] = extra
163
166
  if 'keyword' in command: command['hasValue'] = self.hasValue(command['keyword'])
164
- self.add(command)
167
+ self.addCommand(command)
165
168
  return True
166
169
 
167
170
  # Compile the current token
@@ -209,7 +212,7 @@ class Compiler:
209
212
  self.index = index
210
213
  while True:
211
214
  token = self.tokens[self.index]
212
- keyword = token.token
215
+ # keyword = token.token
213
216
  if self.debugCompile: print(self.script.lines[token.lino])
214
217
  # if keyword != 'else':
215
218
  if self.compileOne() == True:
@@ -223,3 +226,6 @@ class Compiler:
223
226
 
224
227
  def compileFromHere(self, stopOn):
225
228
  return self.compileFrom(self.getIndex(), stopOn)
229
+
230
+ def compileFromStart(self):
231
+ return self.compileFrom(0, [])
easycoder/ec_core.py CHANGED
@@ -1769,12 +1769,17 @@ class Core(Handler):
1769
1769
  self.program.importPlugin(f'{source}:{clazz}')
1770
1770
  return True
1771
1771
  return False
1772
- elif self.nextIs('graphics'):
1773
- print('Loading graphics module')
1774
- from .ec_pyside import Graphics
1775
- self.program.graphics = Graphics
1776
- self.program.useClass(Graphics)
1777
- return True
1772
+ else:
1773
+ token = self.nextToken()
1774
+ if token in ['graphics', 'debugger']:
1775
+ if not hasattr(self.program, 'usingGraphics'):
1776
+ print('Loading graphics module')
1777
+ from .ec_pyside import Graphics
1778
+ self.program.graphics = Graphics
1779
+ self.program.useClass(Graphics)
1780
+ self.program.usingGraphics = True
1781
+ if token == 'debugger': self.program.debugging = True
1782
+ return True
1778
1783
  return False
1779
1784
 
1780
1785
  # Declare a general-purpose variable
@@ -2657,7 +2662,14 @@ class Core(Handler):
2657
2662
  path = self.nextValue()
2658
2663
  condition.path = path
2659
2664
  condition.type = 'exists'
2660
- token = self.nextToken()
2665
+ self.skip('on')
2666
+ if self.nextIsSymbol():
2667
+ record = self.getSymbolRecord()
2668
+ if record['keyword'] == 'ssh':
2669
+ condition.type = 'sshExists'
2670
+ condition.target = record['name']
2671
+ token = self.nextToken()
2672
+ else: token = self.getToken()
2661
2673
  if token == 'exists':
2662
2674
  return condition
2663
2675
  elif token == 'does':
@@ -2841,6 +2853,17 @@ class Core(Handler):
2841
2853
  test = errormsg != None
2842
2854
  return not test if condition.negate else test
2843
2855
 
2856
+ def c_sshExists(self, condition):
2857
+ path = self.getRuntimeValue(condition.path)
2858
+ ssh = self.getVariable(condition.target)
2859
+ sftp = ssh['sftp']
2860
+ try:
2861
+ with sftp.open(path, 'r') as remote_file: remote_file.read().decode()
2862
+ comparison = True
2863
+ except:
2864
+ comparison = False
2865
+ return not comparison if condition.negate else comparison
2866
+
2844
2867
  def c_starts(self, condition):
2845
2868
  value1 = self.getRuntimeValue(condition.value1)
2846
2869
  value2 = self.getRuntimeValue(condition.value2)
easycoder/ec_handler.py CHANGED
@@ -23,7 +23,7 @@ class Handler:
23
23
  self.rewindTo = compiler.rewindTo
24
24
  self.warning = compiler.warning
25
25
  self.getPC = compiler.getPC
26
- self.add = compiler.add
26
+ self.add = compiler.addCommand
27
27
  self.getCommandAt = compiler.getCommandAt
28
28
  self.compileOne = compiler.compileOne
29
29
  self.compileFromHere = compiler.compileFromHere
easycoder/ec_program.py CHANGED
@@ -34,9 +34,9 @@ class Program:
34
34
  self.domainIndex = {}
35
35
  self.name = '<anon>'
36
36
  self.code = []
37
+ self.pc = 0
37
38
  self.symbols = {}
38
39
  self.onError = 0
39
- self.pc = 0
40
40
  self.debugStep = False
41
41
  self.stack = []
42
42
  self.script = Script(source)
@@ -48,7 +48,6 @@ class Program:
48
48
  self.externalControl = False
49
49
  self.ticker = 0
50
50
  self.running = True
51
- # self.start()
52
51
 
53
52
  # This is called at 10msec intervals by the GUI code
54
53
  def flushCB(self):
@@ -62,7 +61,7 @@ class Program:
62
61
  module['child'] = self
63
62
  startCompile = time.time()
64
63
  self.tokenise(self.script)
65
- if self.compiler.compileFrom(0, []):
64
+ if self.compiler.compileFromStart():
66
65
  finishCompile = time.time()
67
66
  s = len(self.script.lines)
68
67
  t = len(self.script.tokens)
easycoder/ec_pyside.py CHANGED
@@ -836,6 +836,7 @@ class Graphics(Handler):
836
836
 
837
837
  # Initialize the graphics environment
838
838
  def k_init(self, command):
839
+ # return True
839
840
  if self.nextIs('graphics'):
840
841
  self.add(command)
841
842
  return True
@@ -847,7 +848,22 @@ class Graphics(Handler):
847
848
  self.program.screenWidth = screen[0]
848
849
  self.program.screenHeight = screen[1]
849
850
  print(f'Screen: {self.program.screenWidth}x{self.program.screenHeight}')
850
- return self.nextPC()
851
+ # return self.nextPC()
852
+ def on_last_window_closed():
853
+ self.program.kill()
854
+ def init():
855
+ self.program.flush(self.nextPC())
856
+ def flush():
857
+ if not self.blocked:
858
+ if self.runOnTick != 0:
859
+ self.program.run(self.runOnTick)
860
+ self.program.flushCB()
861
+ timer = QTimer()
862
+ timer.timeout.connect(flush)
863
+ timer.start(10)
864
+ QTimer.singleShot(500, init)
865
+ self.app.lastWindowClosed.connect(on_last_window_closed)
866
+ self.app.exec()
851
867
 
852
868
  # Declare a label variable
853
869
  def k_label(self, command):
@@ -1367,21 +1383,22 @@ class Graphics(Handler):
1367
1383
  return False
1368
1384
 
1369
1385
  def r_start(self, command):
1370
- def on_last_window_closed():
1371
- self.program.kill()
1372
- def init():
1373
- self.program.flush(self.nextPC())
1374
- def flush():
1375
- if not self.blocked:
1376
- if self.runOnTick != 0:
1377
- self.program.run(self.runOnTick)
1378
- self.program.flushCB()
1379
- timer = QTimer()
1380
- timer.timeout.connect(flush)
1381
- timer.start(10)
1382
- QTimer.singleShot(500, init)
1383
- self.app.lastWindowClosed.connect(on_last_window_closed)
1384
- self.app.exec()
1386
+ return self.nextPC()
1387
+ # def on_last_window_closed():
1388
+ # self.program.kill()
1389
+ # def init():
1390
+ # self.program.flush(self.nextPC())
1391
+ # def flush():
1392
+ # if not self.blocked:
1393
+ # if self.runOnTick != 0:
1394
+ # self.program.run(self.runOnTick)
1395
+ # self.program.flushCB()
1396
+ # timer = QTimer()
1397
+ # timer.timeout.connect(flush)
1398
+ # timer.start(10)
1399
+ # QTimer.singleShot(500, init)
1400
+ # self.app.lastWindowClosed.connect(on_last_window_closed)
1401
+ # self.app.exec()
1385
1402
 
1386
1403
  # Declare a widget variable
1387
1404
  def k_widget(self, command):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easycoder
3
- Version: 251026.1
3
+ Version: 251103.2
4
4
  Summary: Rapid scripting in English
5
5
  Keywords: compiler,scripting,prototyping,programming,coding,python,low code,hypertalk,computer language,learn to code
6
6
  Author-email: Graham Trott <gtanyware@gmail.com>
@@ -0,0 +1,19 @@
1
+ easycoder/__init__.py,sha256=Lcn-X3_bWT1Leeh_wHMEaDuMq_A2Zm4GWMxwo3Ko7qI,339
2
+ easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
3
+ easycoder/ec_border.py,sha256=KpOy0Jq8jI_6DYGo4jaFvoBP_jTIoAYWrmuHhl-FXA4,2355
4
+ easycoder/ec_classes.py,sha256=YGUiKnVN6T5scoeBmmGDQAtE8xJgaTHi0Exh9A7H2Y4,1750
5
+ easycoder/ec_compiler.py,sha256=ZtI40G7GTkCeOYMx66TmU_SwauoktAPW3njhFWESK6k,5505
6
+ easycoder/ec_condition.py,sha256=uamZrlW3Ej3R4bPDuduGB2f00M80Z1D0qV8muDx4Qfw,784
7
+ easycoder/ec_core.py,sha256=c51wdwTwppZwGLOhN22SBCdAmnTFQw0eirMJxkOb8vI,100780
8
+ easycoder/ec_handler.py,sha256=zEZ5cPruEVZp3SIQ6ZjdZN5jDyW2gFvHcNmFaet4Sd4,2324
9
+ easycoder/ec_keyboard.py,sha256=H8DhPT8-IvAIGgRxCs4qSaF_AQLaS6lxxtDteejbktM,19010
10
+ easycoder/ec_program.py,sha256=aPuZOYWFqGd1jsLDl5M5YmLu5LfFAewF9EZh6zHIbyM,10308
11
+ easycoder/ec_pyside.py,sha256=Pkf0lgDTgC7WOjjleiGeBj4e9y9de4DDNlZFsajkVjU,58374
12
+ easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
13
+ easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
14
+ easycoder/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
15
+ easycoder-251103.2.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
16
+ easycoder-251103.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
+ easycoder-251103.2.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
18
+ easycoder-251103.2.dist-info/METADATA,sha256=OntVjUUCq5GZxKP5eSqo8iKBG4WTL0tQ5ocEge4Pzbc,6897
19
+ easycoder-251103.2.dist-info/RECORD,,
@@ -1,19 +0,0 @@
1
- easycoder/__init__.py,sha256=faRkYBTijJU5gEqIEnWKcegBFkwU6yPfL_Jrxrzf5pc,339
2
- easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
3
- easycoder/ec_border.py,sha256=KpOy0Jq8jI_6DYGo4jaFvoBP_jTIoAYWrmuHhl-FXA4,2355
4
- easycoder/ec_classes.py,sha256=YGUiKnVN6T5scoeBmmGDQAtE8xJgaTHi0Exh9A7H2Y4,1750
5
- easycoder/ec_compiler.py,sha256=LYwGNs8dcHKXI_nnu1sVFe1N36vjvylcUO_tX_bLjrk,5359
6
- easycoder/ec_condition.py,sha256=uamZrlW3Ej3R4bPDuduGB2f00M80Z1D0qV8muDx4Qfw,784
7
- easycoder/ec_core.py,sha256=nrhUCbvf1_QTK_kpY1uKnnrXOgsJaehkguWyqwPW44Q,99777
8
- easycoder/ec_handler.py,sha256=ED08ULiOlZkcs4XHxAguvdPZw_dFXuwGDFLbFuo0kLs,2317
9
- easycoder/ec_keyboard.py,sha256=H8DhPT8-IvAIGgRxCs4qSaF_AQLaS6lxxtDteejbktM,19010
10
- easycoder/ec_program.py,sha256=srVDRlELMElvnkjxmREczUVPkvPXPvanZglN4hKreLI,10324
11
- easycoder/ec_pyside.py,sha256=UDGmiCVbmAoW1vmVp3S-7YRumwoJefMS2UlgDts95NU,57758
12
- easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
13
- easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
14
- easycoder/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
15
- easycoder-251026.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
16
- easycoder-251026.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
- easycoder-251026.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
18
- easycoder-251026.1.dist-info/METADATA,sha256=pGt9N2PuGWLykuWQ-ZyKN_kvLIS0yx2ZRQDCsGIF0cI,6897
19
- easycoder-251026.1.dist-info/RECORD,,