[library-web] make it possible to pass URLs to --rebuild



commit a04656a0b632ccf3243791357a6ebdfa8a4f943b
Author: Frédéric Péters <fpeters 0d be>
Date:   Tue Jan 28 11:01:02 2014 +0000

    make it possible to pass URLs to --rebuild

 src/lgo.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/lgo.py b/src/lgo.py
index 687353e..6a7dcf2 100755
--- a/src/lgo.py
+++ b/src/lgo.py
@@ -23,6 +23,7 @@ import sys
 import re
 import tempfile
 import urllib2
+import urlparse
 from cStringIO import StringIO
 from optparse import OptionParser
 import logging
@@ -137,7 +138,14 @@ class Lgo(App):
 
         if self.options.rebuild_module:
             self.rebuild_all = True
-            for doc_module in self.extract_modules(self.options.rebuild_module):
+            if urlparse.urlparse(self.options.rebuild_module).scheme:
+                filename = self.download(self.options.rebuild_module)
+                if not filename:
+                    print >> sys.stderr, 'failed to get', self.options.rebuild_module
+                    sys.exit(1)
+            else:
+                filename = self.options.rebuild_module
+            for doc_module in self.extract_modules(filename):
                 doc_module.process()
             sys.exit(0)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]