Pusher

Doc


Pusher instances


View the Pusher notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Pusher.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


Pusher instances

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Noders.Collecter"
DecorationModuleStr="ShareYourSystem.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
#</ImportSpecificModules>

#<DefineClass>
@DecorationClass()
class PusherClass(BaseClass):

    #Definition
    RepresentingKeyStrsList=[   
                                    'PushingStoreListsList'
                                ]

    #@Hooker.HookerClass(**{'HookingAfterVariablesList':[{'CallingVariable':BaseClass.__init__}]})
    def default_init(self,
                        _PushingStoreListsList=None,
                        **_KwargVariablesDict
                    ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def do_push(self):

        #debug
        '''
        self.debug(('self.',self,['PushingStoreListsList']))
        '''

        #Apply __getitem__
        self.map('collect',map(
                                    lambda __PushingStoreList:
                                    {
                                        'LiargVariablesList':[],
                                        'KwargVariablesDict':
                                        {
                                            'CollectingNodeKeyStr':__PushingStoreList[0],
                                            'CollectingNodeVariable':__PushingStoreList[1],
                                        }
                                    },
                                    self.PushingStoreListsList
                                )
                    )
#</DefineClass>

View the Pusher sources on Github


In [2]:
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Applyiers import Pusher

#push
MyPusher=Pusher.PusherClass().push(
    [
        [
            'FirstChild',
            Pusher.PusherClass().__setitem__('MyInt',0)
        ],
        [
            'SecondChild',
            Pusher.PusherClass()
        ]
    ],
    **{'CollectingCollectionStr':'Pushome'}
)

#Definition the AttestedStr
SYS._attest(
    [
        'MyPusher is '+SYS._str(
        MyPusher,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        )
    ]
)



*****Start of the Attest *****

MyPusher is < (PusherClass), 4556355856>
   /{ 
   /  '<New><Instance>IdInt' : 4556355856
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopPusher
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<New><Instance>PushomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'FirstChildPusher' : < (PusherClass), 4556354896>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4556354896
   /   /   /  '<New><Instance>MyInt' : 0
   /   /   /  '<New><Instance>NodeCollectionStr' : Pushome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : FirstChildPusher
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (PusherClass), 4556355856>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4556378488>
   /   /   /  '<Spe><Class>PushingStoreListsList' : None
   /   /   /}
   /   /  'SecondChildPusher' : < (PusherClass), 4556355472>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4556355472
   /   /   /  '<New><Instance>NodeCollectionStr' : Pushome
   /   /   /  '<New><Instance>NodeIndexInt' : 1
   /   /   /  '<New><Instance>NodeKeyStr' : SecondChildPusher
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (PusherClass), 4556355856>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4556378488>
   /   /   /  '<Spe><Class>PushingStoreListsList' : None
   /   /   /}
   /   /}
   /  '<Spe><Instance>PushingStoreListsList' : 
   /   /[
   /   /  0 : 
   /   /   /[
   /   /   /  0 : FirstChild
   /   /   /  1 : {...}< (PusherClass), 4556354896>
   /   /   /]
   /   /  1 : 
   /   /   /[
   /   /   /  0 : SecondChild
   /   /   /  1 : {...}< (PusherClass), 4556355472>
   /   /   /]
   /   /]
   /}

*****End of the Attest *****