Exemplo n.º 1
0
    def leave(self, to_state):
        """ Override to update REQUEST_URI in the parent's context. """
        InsertingUri.leave(self, to_state)

        if to_state.name != self.success_state:
            return

        if self.parent.ctx['INSERT_URI'] is None:
            # Assert reinserting???
            return # i.e. for reinserting.

        if not (is_usk(self.parent.ctx['INSERT_URI']) and
                is_usk(self.parent.ctx['REQUEST_URI'])):
            return

        if (get_version(self.parent.ctx['INSERT_URI']) >
            get_version(self.parent.ctx['REQUEST_URI'])):

            version = get_version(self.parent.ctx['INSERT_URI'])

            self.parent.ctx['REQUEST_URI'] = (
                get_usk_for_usk_version(self.parent.ctx['REQUEST_URI'],
                                        version))
Exemplo n.º 2
0
 def __init__(self, parent, name, success_state, failure_state):
     InsertingUri.__init__(self, parent, name, success_state, failure_state)
     self.topkey_funcs = archivetop