• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2


Commit MetaInfo

Revisiónf2e58889ca6219ea8afe1b566204ae1b48d4f64c (tree)
Tiempo2023-10-04 01:41:46
AutorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

Added some '# pragma: no mutate (OLD)' on old CC2Cpy writer files --- not fixed, just silenced

Cambiar Resumen

Diferencia incremental

diff -r 224c887cdfd8 -r f2e58889ca62 .hgignore
--- a/.hgignore Tue Oct 03 17:24:58 2023 +0200
+++ b/.hgignore Tue Oct 03 18:41:46 2023 +0200
@@ -20,3 +20,4 @@
2020 .mypy_cache
2121 TestDoubles/_generated/
2222
23+html
diff -r 224c887cdfd8 -r f2e58889ca62 castle/writers/CC2Cpy/CC_B_ComponentInterface.py
--- a/castle/writers/CC2Cpy/CC_B_ComponentInterface.py Tue Oct 03 17:24:58 2023 +0200
+++ b/castle/writers/CC2Cpy/CC_B_ComponentInterface.py Tue Oct 03 18:41:46 2023 +0200
@@ -1,7 +1,5 @@
11 # (C) Albert Mietus, 2022, 2023. Part of Castle/CCastle project
2-
3-
4-import logging; logger = logging.getLogger(__name__)
2+import logging; logger = logging.getLogger(__name__) # pragma: no mutate
53
64 from .CCbase import *
75 from castle.auxiliary.pack import mk_tuple
@@ -30,7 +28,7 @@
3028 return count
3129
3230 def find_port_by_name(self, name:str) -> CC_Port:
33- return next(p for p in self.ports if p.name==name)
31+ return next(p for p in self.ports if p.name==name) # pragma: no mutate (OLD)
3432
3533 def render(self, prepend:str="", indent:str=" ") ->str:
3634 return (
diff -r 224c887cdfd8 -r f2e58889ca62 castle/writers/CC2Cpy/CCbase.py
--- a/castle/writers/CC2Cpy/CCbase.py Tue Oct 03 17:24:58 2023 +0200
+++ b/castle/writers/CC2Cpy/CCbase.py Tue Oct 03 18:41:46 2023 +0200
@@ -19,7 +19,7 @@
1919 type: type
2020
2121
22-CC_TypedParameterTuple: TypeAlias = Sequence[CC_TypedParameter]
22+CC_TypedParameterTuple: TypeAlias = Sequence[CC_TypedParameter] # pragma: no mutate (OLD)
2323
2424 class CC_PortDirection(Enum):
2525 CC_B_PortDirectionIs_UNKNOWN = Unknown = 0
@@ -40,7 +40,7 @@
4040 type: type
4141
4242 def isInPort(self):
43- return self.direction in (CC_PortDirection.In, CC_PortDirection.BiDir)
43+ return self.direction in (CC_PortDirection.In, CC_PortDirection.BiDir) # pragma: no mutate (OLD)
4444 def portray_name(self) ->str: ### <port name>
4545 return f'{self.name}'
4646
@@ -52,7 +52,7 @@
5252 else:
5353 from warnings import warn
5454 tn = self.type if isinstance(self.type, str) else self.type.__name__
55- warn(f"Using string (or other non CC_Base types) port.types (for >>{tn}<<) is not wise", DeprecationWarning, stacklevel=2)
55+ warn(f"Using string (or other non CC_Base types) port.types (for >>{tn}<<) is not wise", DeprecationWarning, stacklevel=2) # pragma: no mutate (OLD)
5656 return f'&cc_P_{tn}'
5757
5858
@@ -60,11 +60,11 @@
6060 class CC_Function(ABCD, CC_Base): # ABC
6161 name: str
6262 _ : KW_ONLY
63- type: type=None # the return type of the callable
64- body=None # XXX Add the (AST of the) body LATER
63+ type: type=None # the return type of the callable # pragma: no mutate (OLD)
64+ body=None # XXX Add the (AST of the) body LATER # pragma: no mutate (OLD)
6565
6666
67-@dataclass
67+@dataclass # pragma: no mutate
6868 class CC_Handler(CC_Function): # ABC Can be an event of data/stream -- with or without parameters
6969 _ : KW_ONLY
7070 port: CC_Port
@@ -72,12 +72,12 @@
7272 @dataclass
7373 class CC_EventHandler(CC_Handler):
7474 _ : KW_ONLY
75- parameterTuple: CC_TypedParameterTuple=()
75+ parameterTuple: CC_TypedParameterTuple=() # pragma: no mutate (OLD)
7676
7777 @dataclass
7878 class CC_Method(CC_Function, ABCD):
7979 _ : KW_ONLY
80- parameterTuple: CC_TypedParameterTuple=()
80+ parameterTuple: CC_TypedParameterTuple=() # pragma: no mutate (OLD)
8181
8282 class CC_ClassMethod(CC_Method): pass
8383 class CC_ElementMethod(CC_Method): pass #Or CC InstanceMethod??