]> git.cworth.org Git - sup/commitdiff
comment updates
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sat, 6 Jan 2007 19:50:14 +0000 (19:50 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sat, 6 Jan 2007 19:50:14 +0000 (19:50 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@222 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/source.rb

index aa7ef6b22ff59b6abb00303b44fe6cb652179447..59b8b70bfe615289db6834a809be3f1de7461aa7 100644 (file)
@@ -10,8 +10,8 @@ class Source
   ##  3. (optional) see whether the source has marked it read or not
   ##
   ## In particular, Sup doesn't need to move messages, mark them as
-  ## read, delete them, or anything else. (Well, maybe delete at some
-  ## point.)
+  ## read, delete them, or anything else. (Well, at some point it will
+  ## need to delete them, but that will be an optional capability.)
   ##
   ## On the other hand, Sup assumes that you can assign each message a
   ## unique integer id, such that newer messages have higher ids than
@@ -22,16 +22,20 @@ class Source
   ## capability, e.g. IMAP, then you have to do a little more work to
   ## simulate it.
   ##
-  ## To write a new source, subclass this class, and should implement:
+  ## To write a new source, subclass this class, and implement:
   ##
   ## - start_offset
   ## - end_offset
+  ## - pct_done (percent of the way cur_offset is to end_offset)
   ## - load_header offset
   ## - load_message offset
   ## - raw_header offset
-  ## - raw_full_message offset-
+  ## - raw_full_message offset
   ## - next (or each, if you prefer)
   ##
+  ## ... where "offset" really means unique id. (You can tell I
+  ## started with mbox.)
+  ##
   ## You can throw SourceErrors from any of those, but we don't catch
   ## anything else, so make sure you catch *all* errors and reraise
   ## them as SourceErrors, and set broken_msg to something if the
@@ -39,6 +43,11 @@ class Source
   ##
   ## Also, be sure to make the source thread-safe, since it WILL be
   ## pummeled from multiple threads at once.
+  ##
+  ## Two examples for you to look at, though sadly neither of them is
+  ## as simple as I'd like: mbox/loader.rb and imap.rb
+
+
 
   ## dirty? described whether cur_offset has changed, which means the
   ## source info needs to be re-saved to sources.yaml.