changeset 27:ac44c36da885

make include example work
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 14 Dec 2010 22:46:56 -0800
parents 044ac9e0b29c
children dc18d6db4956
files examples/include-example.txt makeitso/makeitso.py
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/examples/include-example.txt	Mon Dec 13 21:03:39 2010 -0800
+++ b/examples/include-example.txt	Tue Dec 14 22:46:56 2010 -0800
@@ -2,4 +2,4 @@
 
 I am including a file:
 
-{{include(example.txt)}}
+{{include(here + 'example.txt')}}
--- a/makeitso/makeitso.py	Mon Dec 13 21:03:39 2010 -0800
+++ b/makeitso/makeitso.py	Tue Dec 14 22:46:56 2010 -0800
@@ -81,8 +81,11 @@
 
 def base_uri(uri):
     if '://' in uri:
-        return 'uri'.rsplit('/', 1)[0]
-    return os.path.dirname(os.path.abspath('me'))
+        return 'uri'.rsplit('/', 1)[0] + '/'
+    else:
+        here = os.path.dirname(os.path.abspath('me'))
+        here = here.rstrip(os.path.sep) + os.path.sep
+        return here
 
 def include(uri):
     f, headers = urllib.urlretrieve(uri)