give our test protocol an anno/flags extension
authorMark Hammond <mhammond@skippinet.com.au>
Mon, 20 Apr 2009 11:06:00 +1000
changeset 209 ef3b5eaab4ad0450a9e97e65fbf26c4debb6c750
parent 208 e58224320aefe37a07f8c5611c122b7071b71eeb
child 210 9056db5cd8ef1ea86be7232e338c0b3025f250c3
push id24
push usermhammond@skippinet.com.au
push dateMon, 20 Apr 2009 01:22:13 +0000
give our test protocol an anno/flags extension
server/python/raindrop/proto/test/__init__.py
--- a/server/python/raindrop/proto/test/__init__.py
+++ b/server/python/raindrop/proto/test/__init__.py
@@ -105,12 +105,22 @@ class TestConverter(base.SimpleConverter
         new_doc['body'] = body
         #new_doc['_attachments'] = attachments
         new_doc['multipart'] = False
         new_doc['headers'] = {}
         for hn, hv in msg.items():
             new_doc['headers'][hn.lower()] = hv
         return new_doc
 
+# A 'converter' - takes a proto/test as input and creates a
+# 'anno/flags' as output.
+class TestFlagsConverter(base.SimpleConverterBase):
+    target_type = "msg", "anno/flags"
+    sources = [
+        ('msg', 'proto/test'),
+    ]
+    def simple_convert(self, doc):
+        return {'seen': False}
+
 
 class TestAccount(base.AccountBase):
   def startSync(self, conductor):
     return TestMessageProvider(self, conductor).attach()