changeset 15:edabb0bfe107

add method to work TTW
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 15 Nov 2010 18:26:21 -0800
parents bf1ce840d0f0
children 1818cc524cde
files makeitso/makeitso.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
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()