easycoder 250622.1__py2.py3-none-any.whl → 250622.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
@@ -9,4 +9,4 @@ from .ec_program import *
9
9
  from .ec_timestamp import *
10
10
  from .ec_value import *
11
11
 
12
- __version__ = "250622.1"
12
+ __version__ = "250622.2"
easycoder/ec_classes.py CHANGED
@@ -10,7 +10,7 @@ class FatalError:
10
10
 
11
11
  class NoValueError(FatalError):
12
12
  def __init__(self, compiler, record):
13
- super().__init__(compiler, 'Variable {record["name"]} does not hold a value')
13
+ super().__init__(compiler, f'Variable {record["name"]} does not hold a value')
14
14
 
15
15
  class AssertionError:
16
16
  def __init__(self, program, msg=None):
easycoder/ec_compiler.py CHANGED
@@ -16,6 +16,7 @@ class Compiler:
16
16
  self.program.compiler = self
17
17
  self.compileConstant = self.value.compileConstant
18
18
  self.debugCompile = False
19
+ self.valueTypes = {}
19
20
 
20
21
  def getPC(self):
21
22
  return len(self.program.code)
@@ -124,13 +125,19 @@ class Compiler:
124
125
  symbolRecord['used'] = True
125
126
  return symbolRecord
126
127
 
128
+ def addValueType(self):
129
+ self.valueTypes[self.getToken()] = True
130
+
131
+ def hasValue(self, type):
132
+ return type in self.valueTypes
133
+
127
134
  def compileLabel(self, command):
128
- return self.compileSymbol(command, self.getToken(), False)
135
+ return self.compileSymbol(command, self.getToken())
129
136
 
130
- def compileVariable(self, command, hasValue = False, extra=None):
131
- return self.compileSymbol(command, self.nextToken(), hasValue, extra)
137
+ def compileVariable(self, command, extra=None):
138
+ return self.compileSymbol(command, self.nextToken(), extra)
132
139
 
133
- def compileSymbol(self, command, name, hasValue, extra=None):
140
+ def compileSymbol(self, command, name, extra=None):
134
141
  try:
135
142
  v = self.symbols[name]
136
143
  except:
@@ -141,7 +148,6 @@ class Compiler:
141
148
  self.symbols[name] = self.getPC()
142
149
  command['program'] = self.program
143
150
  command['type'] = 'symbol'
144
- command['hasValue'] = hasValue
145
151
  command['name'] = name
146
152
  command['elements'] = 1
147
153
  command['index'] = 0
@@ -151,6 +157,7 @@ class Compiler:
151
157
  command['import'] = None
152
158
  command['locked'] = False
153
159
  command['extra'] = extra
160
+ if 'keyword' in command: command['hasValue'] = self.hasValue(command['keyword'])
154
161
  self.add(command)
155
162
  return True
156
163
 
easycoder/ec_core.py CHANGED
@@ -287,7 +287,6 @@ class Core(Handler):
287
287
  if type == 'file':
288
288
  filename = self.getRuntimeValue(command['filename'])
289
289
  if os.path.isfile(filename):
290
- print('Deleting',filename)
291
290
  os.remove(filename)
292
291
  elif type == 'property':
293
292
  key = self.getRuntimeValue(command['key'])
@@ -408,7 +407,7 @@ class Core(Handler):
408
407
 
409
408
  # Declare a file variable
410
409
  def k_file(self, command):
411
- return self.compileVariable(command, False)
410
+ return self.compileVariable(command)
412
411
 
413
412
  def r_file(self, command):
414
413
  return self.nextPC()
@@ -617,6 +616,7 @@ class Core(Handler):
617
616
  variable['keyword'] = keyword
618
617
  variable['import'] = None
619
618
  variable['used'] = False
619
+ variable['hasValue'] = True if keyword == 'variable' else False
620
620
  self.add(variable)
621
621
  if self.peek() != 'and':
622
622
  break
@@ -1621,7 +1621,7 @@ class Core(Handler):
1621
1621
  return self.nextPC()
1622
1622
 
1623
1623
  def k_ssh(self, command):
1624
- return self.compileVariable(command, False)
1624
+ return self.compileVariable(command)
1625
1625
 
1626
1626
  def r_ssh(self, command):
1627
1627
  return self.nextPC()
@@ -1807,7 +1807,8 @@ class Core(Handler):
1807
1807
 
1808
1808
  # Declare a general-purpose variable
1809
1809
  def k_variable(self, command):
1810
- return self.compileVariable(command, True)
1810
+ self.compiler.addValueType()
1811
+ return self.compileVariable(command)
1811
1812
 
1812
1813
  def r_variable(self, command):
1813
1814
  return self.nextPC()
easycoder/ec_pyside.py CHANGED
@@ -166,7 +166,7 @@ class Graphics(Handler):
166
166
 
167
167
  # Declare a checkbox variable
168
168
  def k_checkbox(self, command):
169
- return self.compileVariable(command, False, 'gui')
169
+ return self.compileVariable(command, 'gui')
170
170
 
171
171
  def r_checkbox(self, command):
172
172
  return self.nextPC()
@@ -201,7 +201,7 @@ class Graphics(Handler):
201
201
 
202
202
  # Declare a combobox variable
203
203
  def k_combobox(self, command):
204
- return self.compileVariable(command, False, 'gui')
204
+ return self.compileVariable(command, 'gui')
205
205
 
206
206
  def r_combobox(self, command):
207
207
  return self.nextPC()
@@ -501,7 +501,7 @@ class Graphics(Handler):
501
501
 
502
502
  # Declare a dialog variable
503
503
  def k_dialog(self, command):
504
- return self.compileVariable(command, False)
504
+ return self.compileVariable(command)
505
505
 
506
506
  def r_dialog(self, command):
507
507
  return self.nextPC()
@@ -532,7 +532,7 @@ class Graphics(Handler):
532
532
 
533
533
  # Create a group box
534
534
  def k_groupbox(self, command):
535
- return self.compileVariable(command, False, 'gui')
535
+ return self.compileVariable(command, 'gui')
536
536
 
537
537
  def r_groupbox(self, command):
538
538
  return self.nextPC()
@@ -554,35 +554,35 @@ class Graphics(Handler):
554
554
 
555
555
  # Declare a label variable
556
556
  def k_label(self, command):
557
- return self.compileVariable(command, False, 'gui')
557
+ return self.compileVariable(command, 'gui')
558
558
 
559
559
  def r_label(self, command):
560
560
  return self.nextPC()
561
561
 
562
562
  # Declare a layout variable
563
563
  def k_layout(self, command):
564
- return self.compileVariable(command, False, 'gui')
564
+ return self.compileVariable(command, 'gui')
565
565
 
566
566
  def r_layout(self, command):
567
567
  return self.nextPC()
568
568
 
569
569
  # Declare a line input variable
570
570
  def k_lineinput(self, command):
571
- return self.compileVariable(command, False, 'gui')
571
+ return self.compileVariable(command, 'gui')
572
572
 
573
573
  def r_lineinput(self, command):
574
574
  return self.nextPC()
575
575
 
576
576
  # Declare a listbox input variable
577
577
  def k_listbox(self, command):
578
- return self.compileVariable(command, False, 'gui')
578
+ return self.compileVariable(command, 'gui')
579
579
 
580
580
  def r_listbox(self, command):
581
581
  return self.nextPC()
582
582
 
583
583
  # Declare a messagebox variable
584
584
  def k_messagebox(self, command):
585
- return self.compileVariable(command, False)
585
+ return self.compileVariable(command)
586
586
 
587
587
  def r_messagebox(self, command):
588
588
  return self.nextPC()
@@ -675,7 +675,7 @@ class Graphics(Handler):
675
675
 
676
676
  # Declare a pushbutton variable
677
677
  def k_pushbutton(self, command):
678
- return self.compileVariable(command, False, 'gui')
678
+ return self.compileVariable(command, 'gui')
679
679
 
680
680
  def r_pushbutton(self, command):
681
681
  return self.nextPC()
@@ -977,7 +977,7 @@ class Graphics(Handler):
977
977
 
978
978
  # Declare a window variable
979
979
  def k_window(self, command):
980
- return self.compileVariable(command, False)
980
+ return self.compileVariable(command)
981
981
 
982
982
  def r_window(self, command):
983
983
  return self.nextPC()
@@ -1,12 +1,11 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: easycoder
3
- Version: 250622.1
3
+ Version: 250622.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>
7
7
  Description-Content-Type: text/markdown
8
8
  Classifier: License :: OSI Approved :: MIT License
9
- License-File: LICENSE
10
9
  Requires-Dist: pytz
11
10
  Requires-Dist: requests
12
11
  Requires-Dist: psutil
@@ -0,0 +1,16 @@
1
+ easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
2
+ easycoder/__init__.py,sha256=PHW-HNbpCmVm8RMIqa9NnwOztypuuhVv0B_XCqvE5ek,262
3
+ easycoder/ec_classes.py,sha256=PWPaJuTfaWD4-tgT-2WWOgeFV_jXxlxyKCxvXyylCUU,1824
4
+ easycoder/ec_compiler.py,sha256=9byLqJZgMHAyFFyD8eGhY77oTsY1GY1aVcVrU4JAbd4,5287
5
+ easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
6
+ easycoder/ec_core.py,sha256=xtZbGC_BovC1wazV44YojUvhow2tojk6vatMV8MubOA,99234
7
+ easycoder/ec_handler.py,sha256=ohf3xUuWw_Qb5SZnulGtDhvCb11kvWtYfgbQTiOXpIY,2261
8
+ easycoder/ec_program.py,sha256=IDpfq9oghFJMJyRD9uab31VOP5MOF4M7kcUVfDn7d4I,9992
9
+ easycoder/ec_pyside.py,sha256=-EHV8TBIw5jwlufzYcy8mcPXmfYC82Pf7Ep4_cvbceM,40240
10
+ easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
11
+ easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
12
+ easycoder-250622.2.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
13
+ easycoder-250622.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
+ easycoder-250622.2.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
15
+ easycoder-250622.2.dist-info/METADATA,sha256=Dg1zj_SNi6IasPrU3yLxV8JmLor0PwFluOXD168QoIA,6875
16
+ easycoder-250622.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.12.0
2
+ Generator: flit 3.10.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any
@@ -1,16 +0,0 @@
1
- easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
2
- easycoder/__init__.py,sha256=hMYnb_QFsQ2sVls6TyzREEcKy1QBK_oEPMRhOW1SIok,262
3
- easycoder/ec_classes.py,sha256=L6-6yWHDHw8yF9TGL4WWc4p1aUyXzYz6Gom7jJ43h8o,1823
4
- easycoder/ec_compiler.py,sha256=6X9Sy5hr9-Ek36XqWrHJ8Ct1fE5sw2hBLKKFMh2RfRs,5130
5
- easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
6
- easycoder/ec_core.py,sha256=_r0AAlVPJ80syZkos6YhHuolHv7jsZRxB-LfU3U3t7c,99180
7
- easycoder/ec_handler.py,sha256=ohf3xUuWw_Qb5SZnulGtDhvCb11kvWtYfgbQTiOXpIY,2261
8
- easycoder/ec_program.py,sha256=IDpfq9oghFJMJyRD9uab31VOP5MOF4M7kcUVfDn7d4I,9992
9
- easycoder/ec_pyside.py,sha256=1rby0Vbc-IffqdVakKcx1q39wma88ibwI14YuR6bp9k,40317
10
- easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
11
- easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
12
- easycoder-250622.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
13
- easycoder-250622.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
- easycoder-250622.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
15
- easycoder-250622.1.dist-info/METADATA,sha256=WYp6DjCtgGbZQ-J-3FIS8Cbzs7iy5sjY7qRNScLjWtY,6897
16
- easycoder-250622.1.dist-info/RECORD,,