easycoder 250618.1__py2.py3-none-any.whl → 250622.1__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__ = "250618.1"
12
+ __version__ = "250622.1"
easycoder/ec_core.py CHANGED
@@ -357,6 +357,29 @@ class Core(Handler):
357
357
  self.putSymbolValue(target, value)
358
358
  return self.nextPC()
359
359
 
360
+ # download [binary] {url} to {path}
361
+ def k_download(self, command):
362
+ if self.nextIs('binary'):
363
+ command['binary'] = True
364
+ self.nextToken()
365
+ else: command['binary'] = False
366
+ command['url'] = self.getValue()
367
+ self.skip('to')
368
+ command['path'] = self.nextValue()
369
+ self.add(command)
370
+ return True
371
+
372
+ def r_download(self, command):
373
+ binary = command['binary']
374
+ url = self.getRuntimeValue(command['url'])
375
+ path = self.getRuntimeValue(command['path'])
376
+ mode = 'wb' if binary else 'w'
377
+ response = requests.get(url, stream=True)
378
+ with open(path, mode) as f:
379
+ for chunk in response.iter_content(chunk_size=8192):
380
+ if chunk: f.write(chunk)
381
+ return self.nextPC()
382
+
360
383
  # Dummy command for testing
361
384
  def k_dummy(self, command):
362
385
  self.add(command)
@@ -1725,6 +1748,24 @@ class Core(Handler):
1725
1748
  self.add(command)
1726
1749
  return self.nextPC()
1727
1750
 
1751
+ # Trim whitespace from a variable
1752
+ def k_trim(self, command):
1753
+ if self.nextIsSymbol():
1754
+ record = self.getSymbolRecord()
1755
+ if record['hasValue']:
1756
+ command['name'] = record['name']
1757
+ self.add(command)
1758
+ return True
1759
+ return False
1760
+
1761
+ def r_trim(self, command):
1762
+ record = self.getVariable(command['name'])
1763
+ value = record['value'][record['index']]
1764
+ if value['type'] == 'text':
1765
+ content = value['content']
1766
+ value['content'] = content.strip()
1767
+ return self.nextPC()
1768
+
1728
1769
  # Truncate a file
1729
1770
  def k_truncate(self, command):
1730
1771
  if self.nextIsSymbol():
easycoder/ec_pyside.py CHANGED
@@ -920,9 +920,8 @@ class Graphics(Handler):
920
920
  message = data['message']
921
921
  if style == 'question':
922
922
  choice = QMessageBox.question(window, title, message)
923
- if choice == QMessageBox.Yes: result = 'Yes'
924
- else: result = 'No'
925
- if style == 'yesnocancel':
923
+ result = 'Yes' if choice == QMessageBox.Yes else 'No'
924
+ elif style == 'yesnocancel':
926
925
  choice = QMessageBox.question(
927
926
  window,
928
927
  title,
@@ -1,11 +1,12 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: easycoder
3
- Version: 250618.1
3
+ Version: 250622.1
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
9
10
  Requires-Dist: pytz
10
11
  Requires-Dist: requests
11
12
  Requires-Dist: psutil
@@ -1,16 +1,16 @@
1
1
  easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
2
- easycoder/__init__.py,sha256=_rT8h5lahxvdIUoXWpGkFSpk8SaDfspVbYnuG4qxk20,262
2
+ easycoder/__init__.py,sha256=hMYnb_QFsQ2sVls6TyzREEcKy1QBK_oEPMRhOW1SIok,262
3
3
  easycoder/ec_classes.py,sha256=L6-6yWHDHw8yF9TGL4WWc4p1aUyXzYz6Gom7jJ43h8o,1823
4
4
  easycoder/ec_compiler.py,sha256=6X9Sy5hr9-Ek36XqWrHJ8Ct1fE5sw2hBLKKFMh2RfRs,5130
5
5
  easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
6
- easycoder/ec_core.py,sha256=HJW5QcpmKsSAeU-D_LdErg5BZeeVjGPLvu35xh5KgEE,97775
6
+ easycoder/ec_core.py,sha256=_r0AAlVPJ80syZkos6YhHuolHv7jsZRxB-LfU3U3t7c,99180
7
7
  easycoder/ec_handler.py,sha256=ohf3xUuWw_Qb5SZnulGtDhvCb11kvWtYfgbQTiOXpIY,2261
8
8
  easycoder/ec_program.py,sha256=IDpfq9oghFJMJyRD9uab31VOP5MOF4M7kcUVfDn7d4I,9992
9
- easycoder/ec_pyside.py,sha256=QFPu_5fW2XFBovOvbwOFwy6SlCKw1swdJfb-I0d-AE8,40342
9
+ easycoder/ec_pyside.py,sha256=1rby0Vbc-IffqdVakKcx1q39wma88ibwI14YuR6bp9k,40317
10
10
  easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
11
11
  easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
12
- easycoder-250618.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
13
- easycoder-250618.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
- easycoder-250618.1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
15
- easycoder-250618.1.dist-info/METADATA,sha256=jA3cqs6lQs9E7YV9Yw-xvmbrITZrj8bg76o21siTTgk,6875
16
- easycoder-250618.1.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.10.1
2
+ Generator: flit 3.12.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any