Merge lp:~zyga/checkbox/session-peek-api into lp:checkbox

Proposed by Zygmunt Krynicki
Status: Superseded
Proposed branch: lp:~zyga/checkbox/session-peek-api
Merge into: lp:checkbox
Diff against target: 0 lines
To merge this branch: bzr merge lp:~zyga/checkbox/session-peek-api
Reviewer Review Type Date Requested Status
Checkbox Developers Pending
Review via email: mp+217806@code.launchpad.net

This proposal has been superseded by a proposal from 2014-04-30.

Description of the change

933a1ed plainbox:session: add SessionStorage.id
5897758 plainbox:session: make SessionStorage.load_checkpoint() handle missing files
6e72202 plainbox:session: refactor _restore_SessionState_metadata()
08a3e28 plainbox:session: create EnvelopeUnpackMixIn
f300476 plainbox:session: add SessionPeekHelper

To post a comment you must log in.
lp:~zyga/checkbox/session-peek-api updated
2961. By Zygmunt Krynicki

plainbox:session: add SessionStorage.id

This new property serves as a simple identifier for sessions.
It is derived from the random session directory name.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2962. By Zygmunt Krynicki

plainbox:session: make SessionStorage.load_checkpoint() handle missing files

Previously the load_checkpoint() method would crash if the session file
does not exist. This can be the case before a first checkpoint is created.
In such cases we should simply treat that file as empty.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2963. By Zygmunt Krynicki

plainbox:session: refactor _restore_SessionState_metadata()

This patch changes the API of
SessionResumeHelper{1,2,3}_restore_SessionState_metadata() so that
the first argument is a metadata object rather than a session object.

In addition, each of the 1-2-3 format versions implementations of that
method are moved to separate mix-in class MetaDataHelper{1,2,3}MixIn.
The existing SessionResumeHelper{1,2,3} clasess are all made to inherit
from the mix in.

This effectively allows the mix-in classes to be used by another
piece of code that wants to resume the meta-data object alone, without
having to resume the whole session.

Existing tests are adjusted to pass 'session.metadata' instead
of 'session', to compensate for the change.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2964. By Zygmunt Krynicki

plainbox:session: create EnvelopeUnpackMixIn

This small patch creates a mix-in class with the unpack_envelope() method
out of the initial part of SessionResumeHelper.resume() so that the
envelope unpacking code can be shared with the upcoming session peek
code.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2965. By Zygmunt Krynicki

plainbox:session: add SessionPeekHelper

This small class implements a peek(data) method and can peek at the
meta-data part of a session without having to restore a full session
(or handle any consistency issues the session may experience).

The new helper is added to objects importable from plainbox.impl.session

Signed-off-by: Zygmunt Krynicki <email address hidden>

Unmerged revisions

Preview Diff

Empty

Subscribers

People subscribed via source and target branches