diff makeitso/makeitso.py @ 15:edabb0bfe107

add method to work TTW
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 15 Nov 2010 18:26:21 -0800
parents 99588f138993
children 1818cc524cde
line wrap: on
line diff
--- a/makeitso/makeitso.py	Mon Nov 15 08:05:55 2010 -0800
+++ b/makeitso/makeitso.py	Mon Nov 15 18:26:21 2010 -0800
@@ -7,6 +7,7 @@
 import re
 import subprocess
 import sys
+import urllib
 
 from optparse import OptionParser
 
@@ -103,6 +104,9 @@
                       help='starting delimeter')
     parser.add_option('-]', '--end-braces', dest='end_braces',
                       help='starting delimeter')
+    parser.add_option('--in-place', dest='in_place',
+                      action='store_true', default=False,
+                      help='interpret files in place') # TODO: unused
     parser.add_option('--commandline', dest='commandline',
                       action='store_true', default=False,
                       help="print the commandline to invoke this script TTW")
@@ -155,7 +159,8 @@
     # get the content
     if args:
         for arg in args:
-            content = file(arg).read()
+            f, headers = urllib.urlretrieve(arg)
+            content = file(f).read()
             substitute(content, variables=variables)
     else:
         content = sys.stdin.read()