changeset 20:738d84b4de52

start documenting
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 09 Nov 2011 19:55:15 -0800
parents d69041957c0e
children 0706968f01bb
files README.txt fetch.py tests/test.py
diffstat 3 files changed, 40 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/README.txt	Wed Nov 09 17:06:02 2011 -0800
+++ b/README.txt	Wed Nov 09 19:55:15 2011 -0800
@@ -1,14 +1,46 @@
 fetch
-===========
+=====
 
 fetch stuff from the interwebs
 
+
 Format
 ------
 
-`fetch` fetches from a manifest of the format
+`fetch` fetches from a manifest of the format::
+
+ [URL] [Destination] [Type]
+
+A URL can contain a hash tag (e.g. http://example.com/foo#bar/fleem)
+which is used to extract the subdirectories from a multi-directory
+resource.
+
+The `Type` of the resource is used to dispatch to the included
+Fetchers that take care of fetching the object.  
+
+
+Fetchers
+--------
+
+`fetch` includes several objects for fetching resources::
 
-[URL] [Destination] [Type]
+ file : fetch a single file
+ tar : fetch and extract a tarball
+ hg : checkout a mercurial repository
+ git : checkout a git repository
+
+The `file` fetcher cannot have a hash tag subpath since it is a single
+resource.
+
+Though `fetch` has a set of fetchers included, you can pass an
+arbitrary list into `fetch.Fetch`'s constructor. 
+
+
+Version Control
+---------------
+
+The `hg` and the `git` fetchers fetch from version control systems and
+have additional options.
 
 
 ----
--- a/fetch.py	Wed Nov 09 17:06:02 2011 -0800
+++ b/fetch.py	Wed Nov 09 19:55:15 2011 -0800
@@ -124,7 +124,11 @@
         """checkout a git repository"""
         type = 'git'
 
-    fetchers
+        def __init__(self, url, export=True):
+            VCSFetcher.__init__(self, url, export=True)
+            self.hg = which('git')
+
+    fetchers.append(GitFetcher)
 
 __all__ += [i.__name__ for i in fetchers]
 
--- a/tests/test.py	Wed Nov 09 17:06:02 2011 -0800
+++ b/tests/test.py	Wed Nov 09 19:55:15 2011 -0800
@@ -9,7 +9,6 @@
 import sys
 from optparse import OptionParser
 
-
 def run_tests(raise_on_error=False, report_first=False):
 
     # add results here