author | Edouard Tisserant <edouard.tisserant@gmail.com> |
Sat, 23 Nov 2024 00:49:57 +0100 | |
changeset 4045 | 6975b486b07f |
parent 3931 | 1c0263e2b3b1 |
permissions | -rw-r--r-- |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/env python |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
2 |
# -*- coding: utf-8 -*- |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
3 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
4 |
import sys |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
5 |
from types import ModuleType |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
6 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
7 |
# TODO use gettext instead |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
8 |
def get_translation(txt): |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
9 |
return txt |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
10 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
11 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
12 |
class FakeObject: |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
13 |
def __init__(self, *args, **kwargs): |
3790
9ec48ec13b65
fake_wx: handle missing classname
GP Orcullo <kinsamanka@gmail.com>
parents:
3767
diff
changeset
|
14 |
if "__classname__" in kwargs: |
9ec48ec13b65
fake_wx: handle missing classname
GP Orcullo <kinsamanka@gmail.com>
parents:
3767
diff
changeset
|
15 |
self.__classname__ = kwargs["__classname__"] |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
16 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
17 |
def __getattr__(self,name): |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
18 |
if name.startswith('__'): |
3767 | 19 |
raise AttributeError(name) |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
20 |
return FakeObject(__classname__=self.__classname__+"."+name) |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
21 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
22 |
def __call__(self, *args, **kwargs): |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
23 |
return FakeObject(__classname__=self.__classname__+"()") |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
24 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
25 |
def __getitem__(self, key): |
3809
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
26 |
return FakeObject(__classname__=self.__classname__+"["+repr(key)+"]") |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
27 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
28 |
def __str__(self): |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
29 |
return self.__classname__ |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
30 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
31 |
def __or__(self, other): |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
32 |
return FakeObject(__classname__=self.__classname__+"|"+other.__classname__) |
3809
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
33 |
|
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
34 |
def __hash__(self) -> int: |
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
35 |
return id(self) |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
36 |
|
3809
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
37 |
def __cmp__(self,other): |
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
38 |
return True |
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
39 |
__lt__=__cmp__ |
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
40 |
__le__=__cmp__ |
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
41 |
__eq__=__cmp__ |
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
42 |
__ne__=__cmp__ |
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
43 |
__gt__=__cmp__ |
45accb98d761
Fake_wx objects now support comparison and hashing
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3790
diff
changeset
|
44 |
__ge__=__cmp__ |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
45 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
46 |
class FakeClass: |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
47 |
def __init__(self, *args, **kwargs): |
3767 | 48 |
print(("DUMMY Class __init__ !",self.__name__,args,kwargs)) |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
49 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
50 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
51 |
class FakeModule(ModuleType): |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
52 |
def __init__(self, name, classes): |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
53 |
self.__modname__ = name |
3767 | 54 |
self.__objects__ = dict([(desc, type(desc, (FakeClass,), {})) |
55 |
if type(desc)==str else desc for desc in classes]) |
|
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
56 |
ModuleType(name) |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
57 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
58 |
def __getattr__(self,name): |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
59 |
if name.startswith('__'): |
3767 | 60 |
raise AttributeError(name) |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
61 |
|
3767 | 62 |
if name in self.__objects__: |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
63 |
return self.__objects__[name] |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
64 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
65 |
obj = FakeObject(__classname__=self.__modname__+"."+name) |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
66 |
self.__objects__[name] = obj |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
67 |
return obj |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
68 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
69 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
70 |
# Keep track of already faked modules to catch those |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
71 |
# that are already present in sys.modules from start |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
72 |
# (i.e. mpl_toolkits for exemple) |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
73 |
already_patched = {} |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
74 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
75 |
for name, classes in [ |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
76 |
# list given for each module name contains name string for a FakeClass, |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
77 |
# otherwise a tuple (name, object) for arbitrary object/function/class |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
78 |
('wx',[ |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
79 |
'Panel', 'PyCommandEvent', 'Dialog', 'PopupWindow', 'TextEntryDialog', |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
80 |
'Notebook', 'ListCtrl', 'TextDropTarget', 'PyControl', 'TextCtrl', |
3549
0af7b6a96c53
CLI: fix fake_wx for OPC-UA in CLI, match with test and requirements
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3501
diff
changeset
|
81 |
'SplitterWindow', 'Frame', 'Printout', 'StaticBitmap', 'DropTarget', |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
82 |
('GetTranslation', get_translation)]), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
83 |
('wx.lib.agw.advancedsplash',[]), |
3549
0af7b6a96c53
CLI: fix fake_wx for OPC-UA in CLI, match with test and requirements
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3501
diff
changeset
|
84 |
('wx.dataview',['DataViewIndexListModel', 'PyDataViewIndexListModel']), |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
85 |
('wx.lib.buttons',['GenBitmapTextButton']), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
86 |
('wx.adv',['EditableListBox']), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
87 |
('wx.grid',[ |
3931
1c0263e2b3b1
IDE: Remove all occurrences of deprecated wx.grid.PyGrid
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3817
diff
changeset
|
88 |
'Grid', 'GridTableBase', 'GridCellEditor', 'GridCellTextEditor', |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
89 |
'GridCellChoiceEditor']), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
90 |
('wx.lib.agw.customtreectrl',['CustomTreeCtrl']), |
3549
0af7b6a96c53
CLI: fix fake_wx for OPC-UA in CLI, match with test and requirements
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3501
diff
changeset
|
91 |
('wx.lib.gizmos',[]), |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
92 |
('wx.lib.intctrl',['IntCtrl']), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
93 |
('matplotlib.pyplot',[]), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
94 |
('matplotlib.backends.backend_wxagg',['FigureCanvasWxAgg']), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
95 |
('wx.stc',['StyledTextCtrl']), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
96 |
('wx.lib.scrolledpanel',[]), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
97 |
('wx.lib.mixins.listctrl',['ColumnSorterMixin', 'ListCtrlAutoWidthMixin']), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
98 |
('wx.dataview',['PyDataViewIndexListModel']), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
99 |
('matplotlib.backends.backend_agg',[]), |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
100 |
('wx.aui',[]), |
3817
3deeda82636a
Fix Py3 problems with basic SVGHMI build and run.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3809
diff
changeset
|
101 |
('wx.html',['HtmlWindow']), |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
102 |
('mpl_toolkits.mplot3d',[])]: |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
103 |
modpath = None |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
104 |
parentmod = None |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
105 |
for identifier in name.split("."): |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
106 |
modpath = (modpath + "." + identifier) if modpath else identifier |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
107 |
mod = sys.modules.get(modpath, None) |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
108 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
109 |
if mod is None or modpath not in already_patched: |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
110 |
mod = FakeModule(modpath, classes) |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
111 |
sys.modules[modpath] = mod |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
112 |
already_patched[modpath] = True |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
113 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
114 |
if parentmod is not None: |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
115 |
parentmod.__objects__[identifier] = mod |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
116 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
117 |
parentmod = mod |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
118 |
|
3752 | 119 |
import builtins |
3501
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
120 |
|
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
121 |
builtins.__dict__['_'] = get_translation |
fa291393aac7
Added preliminary CLI. Supports building a project, transfering and running on PLC.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
122 |