# -*- coding: utf-8 -*-
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
A Transmitter
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Noders.Networker"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>
#<ImportSpecificModules>
import copy
from ShareYourSystem.Standards.Itemizers import Pather
#</ImportSpecificModules>
#<DefineClass>
@DecorationClass()
class TransmitterClass(BaseClass):
#Definition
RepresentingKeyStrsList=[
'TransmittingUpdateList',
'TransmittingCollectionStrsList',
'TransmittedVariablesList',
'TransmittingSelfIsBool'
]
def default_init(self,
_TransmittingUpdateList=None,
_TransmittingCollectionStrsList=None,
_TransmittingSelfIsBool=True,
_TransmittedVariablesList=None,
**_KwargVariablesDict
):
#Call the parent init method
BaseClass.__init__(self,**_KwargVariablesDict)
def do_transmit(self):
#debug
'''
self.debug(('self.',self,['TransmittingSelfIsBool']))
'''
#Check
if self.TransmittingSelfIsBool:
#update
self.update(self.TransmittingUpdateList)
#map
self.TransmittedVariablesList=SYS.flat(
map(
lambda __TransmittingCollectionStr:
map(
lambda __DeriveNoderPointer:
__DeriveNoderPointer.CatchToPointVariable,
getattr(
self,
__TransmittingCollectionStr+'CollectionOrderedDict'
).values()
) if hasattr(self,__TransmittingCollectionStr+'CollectionOrderedDict')
else [],
self.TransmittingCollectionStrsList
)
)
#command
self.command(
self.TransmittingUpdateList,
self.TransmittedVariablesList,
_GatherIsBool=False
)
#Return self
#return self
#</DefineClass>
View the Transmitter sources on Github
In [3]:
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Transmitter
import operator
#Definition of a brian structure
MyTransmitter=Transmitter.TransmitterClass(
).push(
[
(
'First',
Transmitter.TransmitterClass().update(
[
('ConnectingCatchGetStrsList',
[
'/NodePointDeriveNoder/<Transmitome>SecondTransmitter'
]
),
('ConnectingGraspClueVariablesList',
[
'/NodePointDeriveNoder/<Transmitome>SecondTransmitter'
]
),
('TagStr','Networked')
]
)
),
(
'Second',
Transmitter.TransmitterClass().__setitem__(
'TagStr',
'Networked'
)
)
],
**{
'CollectingCollectionStr':'Transmitome'
}
).network(
**{
'RecruitingConcludeConditionVariable':[
('__class__.NameStr',operator.eq,'Transmitter')
]
}
)
#transmit
MyTransmitter['<Transmitome>FirstTransmitter'].transmit(
[('MyInt',0)],
['PostConnectome']
)
#Definition the AttestedStr
SYS._attest(
[
'MyTransmitter is '+SYS._str(
MyTransmitter,
**{
'RepresentingBaseKeyStrsListBool':False,
'RepresentingAlineaIsBool':False
}
)
]
)
#Print