From 62f3c0ba594c1c8b403c1ae53a6f5a554ce262af Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Fri, 2 Jan 2015 21:05:22 -0600 Subject: Port `enum` to `enum34` --- mail/changes/bug-6601_port_enum34 | 1 + mail/pkg/requirements.pip | 2 +- mail/src/leap/mail/imap/memorystore.py | 10 +++++----- mail/src/leap/mail/imap/messageparts.py | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 mail/changes/bug-6601_port_enum34 diff --git a/mail/changes/bug-6601_port_enum34 b/mail/changes/bug-6601_port_enum34 new file mode 100644 index 0000000..2ca551d --- /dev/null +++ b/mail/changes/bug-6601_port_enum34 @@ -0,0 +1 @@ +- Port `enum` to `enum34` (Closes #6601) diff --git a/mail/pkg/requirements.pip b/mail/pkg/requirements.pip index 17ceba6..5bd4972 100644 --- a/mail/pkg/requirements.pip +++ b/mail/pkg/requirements.pip @@ -4,4 +4,4 @@ leap.common>=0.3.7 leap.keymanager>=0.3.8 twisted # >= 12.0.3 ?? zope.proxy -enum +enum34 diff --git a/mail/src/leap/mail/imap/memorystore.py b/mail/src/leap/mail/imap/memorystore.py index 5eea4ef..e075394 100644 --- a/mail/src/leap/mail/imap/memorystore.py +++ b/mail/src/leap/mail/imap/memorystore.py @@ -52,10 +52,10 @@ logger = logging.getLogger(__name__) # soledad storage, in seconds. SOLEDAD_WRITE_PERIOD = 15 -FDOC = MessagePartType.fdoc.key -HDOC = MessagePartType.hdoc.key -CDOCS = MessagePartType.cdocs.key -DOCS_ID = MessagePartType.docs_id.key +FDOC = MessagePartType.fdoc.name +HDOC = MessagePartType.hdoc.name +CDOCS = MessagePartType.cdocs.name +DOCS_ID = MessagePartType.docs_id.name @contextlib.contextmanager @@ -73,7 +73,7 @@ def set_bool_flag(obj, att): setattr(obj, att, False) -DirtyState = Enum("none", "dirty", "new") +DirtyState = Enum("DirtyState", "none dirty new") class MemoryStore(object): diff --git a/mail/src/leap/mail/imap/messageparts.py b/mail/src/leap/mail/imap/messageparts.py index 257721c..fb1d75a 100644 --- a/mail/src/leap/mail/imap/messageparts.py +++ b/mail/src/leap/mail/imap/messageparts.py @@ -32,7 +32,7 @@ from leap.mail.imap import interfaces from leap.mail.imap.fields import fields from leap.mail.utils import empty, first, find_charset -MessagePartType = Enum("hdoc", "fdoc", "cdoc", "cdocs", "docs_id") +MessagePartType = Enum("MessagePartType", "hdoc fdoc cdoc cdocs docs_id") logger = logging.getLogger(__name__) -- cgit v1.2.3