summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6269427)
raw | patch | inline | side by side (parent: 6269427)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 21 Oct 2010 20:31:13 +0000 (20:31 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 21 Oct 2010 20:31:13 +0000 (20:31 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4556 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/anypy/email_.py | [new file with mode: 0644] | patch | blob |
roundup/backends/back_anydbm.py | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history |
diff --git a/roundup/anypy/email_.py b/roundup/anypy/email_.py
--- /dev/null
+++ b/roundup/anypy/email_.py
@@ -0,0 +1,19 @@
+try:
+ # Python 2.5+
+ from email.parser import FeedParser
+except ImportError:
+ # Python 2.4
+ try :
+ from email.Parser import FeedParser
+ except ImportError:
+ from email.Parser import Parser
+ class FeedParser:
+ def __init__(self):
+ self.content = []
+
+ def feed(self, s):
+ self.content.append(s)
+
+ def close(self):
+ p = Parser()
+ return p.parsestr(''.join(self.content))
index 3d132ec672062730b2446ee3dd1ac6d369588ed2..1d8c32f00a8dde6692270e3982f52acd3fbee842 100644 (file)
def getclasses(self):
"""Return a list of the names of all existing classes."""
- return sorted(self.classes)
+ l = self.classes.keys()
+ l.sort()
+ return l
def getclass(self, classname):
"""Get the Class object representing a particular class.
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 09168ddf0e4ced405780bd31a1077d9135bd805a..fd4e0ba6c33b0e6615d73e5b86f1664af2218cc4 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
-try:
- # Python 2.5+
- from email.parser import FeedParser
-except ImportError:
- # Python 2.4
- from email.Parser import FeedParser
+from anypy.email_ import FeedParser
from roundup import password, date, hyperdb
from roundup.i18n import _