easycoder 250609.1__py2.py3-none-any.whl → 250609.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 +1 -1
- easycoder/ec_core.py +91 -19
- easycoder/ec_program.py +2 -3
- {easycoder-250609.1.dist-info → easycoder-250609.2.dist-info}/METADATA +2 -1
- easycoder-250609.2.dist-info/RECORD +16 -0
- easycoder/.syncthing.ec_core.py.tmp +0 -0
- easycoder/.syncthing.ec_program.py.tmp +0 -0
- easycoder-250609.1.dist-info/RECORD +0 -18
- {easycoder-250609.1.dist-info → easycoder-250609.2.dist-info}/LICENSE +0 -0
- {easycoder-250609.1.dist-info → easycoder-250609.2.dist-info}/WHEEL +0 -0
- {easycoder-250609.1.dist-info → easycoder-250609.2.dist-info}/entry_points.txt +0 -0
easycoder/__init__.py
CHANGED
easycoder/ec_core.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import json, math, hashlib, threading, os, subprocess, sys, time
|
|
1
|
+
import json, math, hashlib, threading, os, subprocess, sys, time
|
|
2
|
+
import numbers, base64, binascii, random, requests, paramiko
|
|
2
3
|
from psutil import Process
|
|
3
4
|
from datetime import datetime
|
|
4
5
|
from random import randrange
|
|
@@ -386,7 +387,7 @@ class Core(Handler):
|
|
|
386
387
|
return True
|
|
387
388
|
|
|
388
389
|
def r_exit(self, command):
|
|
389
|
-
if self.program.graphics != None:
|
|
390
|
+
if self.program.parent == None and self.program.graphics != None:
|
|
390
391
|
self.program.graphics.force_exit(None)
|
|
391
392
|
return -1
|
|
392
393
|
|
|
@@ -601,6 +602,7 @@ class Core(Handler):
|
|
|
601
602
|
variable['name'] = name
|
|
602
603
|
variable['keyword'] = keyword
|
|
603
604
|
variable['import'] = None
|
|
605
|
+
variable['used'] = False
|
|
604
606
|
self.addCommand(variable)
|
|
605
607
|
if self.peek() != 'and':
|
|
606
608
|
break
|
|
@@ -711,7 +713,7 @@ class Core(Handler):
|
|
|
711
713
|
return self.nextPC()
|
|
712
714
|
|
|
713
715
|
# 1 Load a plugin. This is done at compile time.
|
|
714
|
-
# 2 Load text from a file
|
|
716
|
+
# 2 Load text from a file or ssh
|
|
715
717
|
def k_load(self, command):
|
|
716
718
|
self.nextToken()
|
|
717
719
|
if self.tokenIs('plugin'):
|
|
@@ -725,7 +727,15 @@ class Core(Handler):
|
|
|
725
727
|
if symbolRecord['hasValue']:
|
|
726
728
|
command['target'] = symbolRecord['name']
|
|
727
729
|
if self.nextIs('from'):
|
|
728
|
-
|
|
730
|
+
if self.nextIsSymbol():
|
|
731
|
+
record = self.getSymbolRecord()
|
|
732
|
+
if record['keyword'] == 'ssh':
|
|
733
|
+
command['ssh'] = record['name']
|
|
734
|
+
command['path'] = self.nextValue()
|
|
735
|
+
self.add(command)
|
|
736
|
+
return True
|
|
737
|
+
|
|
738
|
+
command['file'] = self.getValue()
|
|
729
739
|
self.add(command)
|
|
730
740
|
return True
|
|
731
741
|
else:
|
|
@@ -734,15 +744,24 @@ class Core(Handler):
|
|
|
734
744
|
|
|
735
745
|
def r_load(self, command):
|
|
736
746
|
target = self.getVariable(command['target'])
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
747
|
+
if 'ssh' in command:
|
|
748
|
+
ssh = self.getVariable(command['ssh'])
|
|
749
|
+
path = self.getRuntimeValue(command['path'])
|
|
750
|
+
sftp = ssh['sftp']
|
|
751
|
+
try:
|
|
752
|
+
with sftp.open(path, 'r') as remote_file: content = remote_file.read().decode()
|
|
753
|
+
except:
|
|
754
|
+
RuntimeError(self.program, 'Unable to read data')
|
|
755
|
+
else:
|
|
756
|
+
filename = self.getRuntimeValue(command['file'])
|
|
757
|
+
try:
|
|
758
|
+
with open(filename) as f: content = f.read()
|
|
759
|
+
except:
|
|
760
|
+
content = ''
|
|
761
|
+
try:
|
|
762
|
+
if filename.endswith('.json'): content = json.loads(content)
|
|
763
|
+
except:
|
|
764
|
+
RuntimeError(self.program, 'Bad or null JSON string')
|
|
746
765
|
value = {}
|
|
747
766
|
value['type'] = 'text'
|
|
748
767
|
value['content'] = content
|
|
@@ -1203,9 +1222,9 @@ class Core(Handler):
|
|
|
1203
1222
|
if record['keyword'] == 'module':
|
|
1204
1223
|
name = record['name']
|
|
1205
1224
|
command['module'] = name
|
|
1206
|
-
else:
|
|
1207
|
-
else:
|
|
1208
|
-
else:
|
|
1225
|
+
else: FatalError(self.compiler, f'Symbol \'name\' is not a module')
|
|
1226
|
+
else: FatalError(self.compiler, 'Module name expected after \'as\'')
|
|
1227
|
+
else: FatalError(self.compiler, '\'as {module name}\' expected')
|
|
1209
1228
|
exports = []
|
|
1210
1229
|
if self.peek() == 'with':
|
|
1211
1230
|
self.nextToken()
|
|
@@ -1276,16 +1295,40 @@ class Core(Handler):
|
|
|
1276
1295
|
|
|
1277
1296
|
# Set a value
|
|
1278
1297
|
# set {variable}
|
|
1298
|
+
# set {ssh} host {host} user {user} password {password}
|
|
1279
1299
|
# set the elements of {variable} to {value}
|
|
1280
1300
|
# set element/property of {variable} to {value}
|
|
1281
1301
|
def k_set(self, command):
|
|
1282
1302
|
if self.nextIsSymbol():
|
|
1283
|
-
|
|
1284
|
-
|
|
1303
|
+
record = self.getSymbolRecord()
|
|
1304
|
+
command['target'] = record['name']
|
|
1305
|
+
if record['hasValue']:
|
|
1285
1306
|
command['type'] = 'set'
|
|
1286
|
-
command['target'] = target['name']
|
|
1287
1307
|
self.add(command)
|
|
1288
1308
|
return True
|
|
1309
|
+
elif record['keyword'] == 'ssh':
|
|
1310
|
+
host = None
|
|
1311
|
+
user = None
|
|
1312
|
+
password = None
|
|
1313
|
+
while True:
|
|
1314
|
+
token = self.peek()
|
|
1315
|
+
if token == 'host':
|
|
1316
|
+
self.nextToken()
|
|
1317
|
+
host = self.nextValue()
|
|
1318
|
+
elif token == 'user':
|
|
1319
|
+
self.nextToken()
|
|
1320
|
+
user = self.nextValue()
|
|
1321
|
+
elif token == 'password':
|
|
1322
|
+
self.nextToken()
|
|
1323
|
+
password = self.nextValue()
|
|
1324
|
+
else: break
|
|
1325
|
+
command['host'] = host
|
|
1326
|
+
command['user'] = user
|
|
1327
|
+
command['password'] = password
|
|
1328
|
+
command['type'] = 'ssh'
|
|
1329
|
+
self.add(command)
|
|
1330
|
+
return True
|
|
1331
|
+
|
|
1289
1332
|
return False
|
|
1290
1333
|
|
|
1291
1334
|
token = self.getToken()
|
|
@@ -1333,6 +1376,12 @@ class Core(Handler):
|
|
|
1333
1376
|
command['value'] = self.nextValue()
|
|
1334
1377
|
self.add(command)
|
|
1335
1378
|
return True
|
|
1379
|
+
|
|
1380
|
+
elif token == 'path':
|
|
1381
|
+
command['path'] = self.nextValue()
|
|
1382
|
+
self.add(command)
|
|
1383
|
+
return True
|
|
1384
|
+
|
|
1336
1385
|
return False
|
|
1337
1386
|
|
|
1338
1387
|
def r_set(self, command):
|
|
@@ -1384,6 +1433,11 @@ class Core(Handler):
|
|
|
1384
1433
|
self.encoding = self.getRuntimeValue(command['encoding'])
|
|
1385
1434
|
return self.nextPC()
|
|
1386
1435
|
|
|
1436
|
+
elif cmdType == 'path':
|
|
1437
|
+
path = self.getRuntimeValue(command['path'])
|
|
1438
|
+
os.chdir(path)
|
|
1439
|
+
return self.nextPC()
|
|
1440
|
+
|
|
1387
1441
|
elif cmdType == 'property':
|
|
1388
1442
|
value = self.getRuntimeValue(command['value'])
|
|
1389
1443
|
name = self.getRuntimeValue(command['name'])
|
|
@@ -1403,6 +1457,17 @@ class Core(Handler):
|
|
|
1403
1457
|
val['content'] = content
|
|
1404
1458
|
self.putSymbolValue(targetVariable, val)
|
|
1405
1459
|
return self.nextPC()
|
|
1460
|
+
|
|
1461
|
+
elif cmdType == 'ssh':
|
|
1462
|
+
target = self.getVariable(command['target'])
|
|
1463
|
+
host = self.getRuntimeValue(command['host'])
|
|
1464
|
+
user = self.getRuntimeValue(command['user'])
|
|
1465
|
+
password = self.getRuntimeValue(command['password'])
|
|
1466
|
+
ssh = paramiko.SSHClient()
|
|
1467
|
+
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
1468
|
+
ssh.connect(host, username=user, password=password)
|
|
1469
|
+
target['sftp'] = ssh.open_sftp()
|
|
1470
|
+
return self.nextPC()
|
|
1406
1471
|
|
|
1407
1472
|
# Shuffle a list
|
|
1408
1473
|
def k_shuffle(self, command):
|
|
@@ -1473,6 +1538,12 @@ class Core(Handler):
|
|
|
1473
1538
|
|
|
1474
1539
|
return self.nextPC()
|
|
1475
1540
|
|
|
1541
|
+
def k_ssh(self, command):
|
|
1542
|
+
return self.compileVariable(command, False)
|
|
1543
|
+
|
|
1544
|
+
def r_ssh(self, command):
|
|
1545
|
+
return self.nextPC()
|
|
1546
|
+
|
|
1476
1547
|
# Declare a stack variable
|
|
1477
1548
|
def k_stack(self, command):
|
|
1478
1549
|
return self.compileVariable(command)
|
|
@@ -1624,6 +1695,7 @@ class Core(Handler):
|
|
|
1624
1695
|
target['locked'] = False
|
|
1625
1696
|
return self.nextPC()
|
|
1626
1697
|
|
|
1698
|
+
# Use a plugin module
|
|
1627
1699
|
def k_use(self, command):
|
|
1628
1700
|
if self.nextIs('graphics'):
|
|
1629
1701
|
print('Loading graphics module')
|
easycoder/ec_program.py
CHANGED
|
@@ -317,9 +317,8 @@ class Program:
|
|
|
317
317
|
queue = deque()
|
|
318
318
|
if self.parent != None:
|
|
319
319
|
self.releaseParent()
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
break
|
|
320
|
+
self.running = False
|
|
321
|
+
break
|
|
323
322
|
elif self.pc == None or self.pc == 0 or self.pc >= len(self.code):
|
|
324
323
|
break
|
|
325
324
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version: 250609.
|
|
3
|
+
Version: 250609.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>
|
|
@@ -8,6 +8,7 @@ Description-Content-Type: text/markdown
|
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
9
|
Requires-Dist: pytz
|
|
10
10
|
Requires-Dist: requests
|
|
11
|
+
Requires-Dist: paramiko
|
|
11
12
|
Requires-Dist: pyside6
|
|
12
13
|
Project-URL: Home, https://github.com/easycoder/easycoder-py
|
|
13
14
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
|
|
2
|
+
easycoder/__init__.py,sha256=tz50IaJCH93FqaP8zj-4hKCTqtgE_hEtFQCqRSto5cY,262
|
|
3
|
+
easycoder/ec_classes.py,sha256=L6-6yWHDHw8yF9TGL4WWc4p1aUyXzYz6Gom7jJ43h8o,1823
|
|
4
|
+
easycoder/ec_compiler.py,sha256=zKZXXUrQyHbwZ1gJARnwfdAPHWTARa5SN9Y31iuty8o,5086
|
|
5
|
+
easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
|
|
6
|
+
easycoder/ec_core.py,sha256=-xciv8vSVth7Xsf_ACSJPw0RYollM6hBUZhwOcCtHM0,95220
|
|
7
|
+
easycoder/ec_handler.py,sha256=zPDZ_hqdgNnkCd8B5HmSLkqsGgf4aDmqcUBOPHgo47U,2305
|
|
8
|
+
easycoder/ec_program.py,sha256=FmC9Oz4IpkmNq6D2TgMzVa3ha2TDv7jA15uwX_HFJVs,10080
|
|
9
|
+
easycoder/ec_pyside.py,sha256=I1y8QZgMHLWWxWbKLm_JzHJo6bwASak7tdnuAcuh66c,39904
|
|
10
|
+
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
11
|
+
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
12
|
+
easycoder-250609.2.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
13
|
+
easycoder-250609.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
14
|
+
easycoder-250609.2.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
|
|
15
|
+
easycoder-250609.2.dist-info/METADATA,sha256=zalIz9_FoKDnNmQAO2ScWXdtKwjY7TiEyGGRAriEK5M,6853
|
|
16
|
+
easycoder-250609.2.dist-info/RECORD,,
|
|
Binary file
|
|
Binary file
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
easycoder/.syncthing.ec_core.py.tmp,sha256=-TD3mz9sOGt1WMB7Sm-aA3Z6emzi8k4e04KR6H5beEI,92830
|
|
2
|
-
easycoder/.syncthing.ec_program.py.tmp,sha256=0j_gHubyxZ84l8lWiai4Luocsf0fIqHIWOxX0h6wX-M,10080
|
|
3
|
-
easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
|
|
4
|
-
easycoder/__init__.py,sha256=AODlCTfDI8YMdlZxd0PMKa2s4qpRIEt55QjeANrIf8c,262
|
|
5
|
-
easycoder/ec_classes.py,sha256=L6-6yWHDHw8yF9TGL4WWc4p1aUyXzYz6Gom7jJ43h8o,1823
|
|
6
|
-
easycoder/ec_compiler.py,sha256=zKZXXUrQyHbwZ1gJARnwfdAPHWTARa5SN9Y31iuty8o,5086
|
|
7
|
-
easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
|
|
8
|
-
easycoder/ec_core.py,sha256=IH7lvxr1ZSFcZvd00RV8wzG_fvWX8bSW4YHKLOL3m04,92443
|
|
9
|
-
easycoder/ec_handler.py,sha256=zPDZ_hqdgNnkCd8B5HmSLkqsGgf4aDmqcUBOPHgo47U,2305
|
|
10
|
-
easycoder/ec_program.py,sha256=HnJJhd0umQyw8CwUv3wxwG73DFLxciGTry8b3tYG-6w,10094
|
|
11
|
-
easycoder/ec_pyside.py,sha256=I1y8QZgMHLWWxWbKLm_JzHJo6bwASak7tdnuAcuh66c,39904
|
|
12
|
-
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
13
|
-
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
14
|
-
easycoder-250609.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
15
|
-
easycoder-250609.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
16
|
-
easycoder-250609.1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
|
|
17
|
-
easycoder-250609.1.dist-info/METADATA,sha256=k2M5UyNazI3BhOp4LqN7ncu-qwO5R3T8OIUu9RrP0rQ,6829
|
|
18
|
-
easycoder-250609.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|