diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-02-08 09:52:29 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-02-08 09:52:29 +0100 |
commit | 4ee1ad88fc440164985c8efc50c0be133a0053bc (patch) | |
tree | 210635d4aa964873f8054c80fcbeb2e9f94ce6ab /netlib/odict.py | |
parent | 4873547de3c65ba7c14cace4bca7b17368b2900d (diff) | |
parent | 655b521749efd5a600d342a1d95b67d32da280a8 (diff) | |
download | mitmproxy-4ee1ad88fc440164985c8efc50c0be133a0053bc.tar.gz mitmproxy-4ee1ad88fc440164985c8efc50c0be133a0053bc.tar.bz2 mitmproxy-4ee1ad88fc440164985c8efc50c0be133a0053bc.zip |
Merge pull request #120 from mitmproxy/model-cleanup
Model Cleanup
Diffstat (limited to 'netlib/odict.py')
-rw-r--r-- | netlib/odict.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/netlib/odict.py b/netlib/odict.py index 90317e5e..1e6e381a 100644 --- a/netlib/odict.py +++ b/netlib/odict.py @@ -3,6 +3,8 @@ import re import copy import six +from .utils import Serializable + def safe_subn(pattern, repl, target, *args, **kwargs): """ @@ -13,7 +15,7 @@ def safe_subn(pattern, repl, target, *args, **kwargs): return re.subn(str(pattern), str(repl), target, *args, **kwargs) -class ODict(object): +class ODict(Serializable): """ A dictionary-like object for managing ordered (key, value) data. Think @@ -172,12 +174,12 @@ class ODict(object): def get_state(self): return [tuple(i) for i in self.lst] - def load_state(self, state): + def set_state(self, state): self.lst = [list(i) for i in state] @classmethod - def from_state(klass, state): - return klass([list(i) for i in state]) + def from_state(cls, state): + return cls([list(i) for i in state]) class ODictCaseless(ODict): |