# -*- coding: utf-8 -*-
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
An Linker maps a point
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Applyiers.Updater"
DecorationModuleStr="ShareYourSystem.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>
#<ImportSpecificModules>
#</ImportSpecificModules>
#<DefineClass>
@DecorationClass()
class LinkerClass(BaseClass):
#Definition
RepresentingKeyStrsList=[
'LinkingPointListsList'
]
def default_init(self,
_LinkingPointListsList=None,
**_KwargVariablesDict):
#Call the parent __init__ method
BaseClass.__init__(self,**_KwargVariablesDict)
def do_link(self):
""" """
#debug
'''
self.debug(('self.',self,['LinkingPointListsList']))
'''
#Apply
self.map('point',map(
lambda __LinkingPointList:
{'LiargVariablesList':__LinkingPointList},
self.LinkingPointListsList
)
)
#Return
#return self
#</DefineClass>
View the Linker sources on Github
In [3]:
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Itemizers import Pather
from ShareYourSystem.Applyiers import Linker
#Update several things
MyLinker=Linker.LinkerClass().update(
map(
lambda __Int:
(str(__Int)+'Pather',Pather.PatherClass()),
xrange(3)
)
)
#link
MyLinker.link(
map(
lambda __Int:
(str(__Int)+'Pather','/'+str(__Int-1)+'Pather/'+str(__Int)+'Pather')
if __Int>0
else
(str(0)+'Pather','/2Pather/0Pather'),
xrange(3)
)
)
#Definition the AttestedStr
SYS._attest(
[
'MyLinker is '+SYS._str(
MyLinker,
**{
'RepresentingBaseKeyStrsListBool':False,
'RepresentingAlineaIsBool':False
}
)
]
)
#Print