hsmbase.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:miros 作者: aleph2c 项目源码 文件源码
def goto(self, rTarget, **kwargs):

    if callable(rTarget) is False:
      rTarget = self.registry[rTarget]

    if( "payload" in kwargs ):
      self.tEvt['payload'] = kwargs['payload']

    """Transition to a new state (Cached Version)"""
    caller = inspect.stack()[1][3]  # hsm could be calling its super states
                                    # we aren't tracking this in this, so we can
                                    # just reference the call stack to find who
                                    # discovered the event
    #print "\nCurrent state: ", self.rCurr; print "Source state: ", self.rSource
    self.__spy__(caller, self.tEvt['event'], self.tEvt['payload'])

    # this is how you see the target
    if self.rCurr['toLcaCache'].get(self.tEvt['event'], None) == None:
      self.rCurr['toLcaCache'][self.tEvt['event']] = \
          self.to_lca(self.hsm_dict[rTarget])
    # self.pp.pprint(self.rCurr); print
    self.exit(self.rCurr['toLcaCache'][self.tEvt['event']])
    self.rNext = self.hsm_dict[rTarget]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号