Mercurial > hg > MakeItSo
comparison makeitso/makeitso.py @ 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 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 26:044ac9e0b29c | 27:ac44c36da885 | 
|---|---|
| 79 cmdstr = ' '.join(command) | 79 cmdstr = ' '.join(command) | 
| 80 raise SystemExit("Command `%s` exited with code %d" % (cmdstr, code)) | 80 raise SystemExit("Command `%s` exited with code %d" % (cmdstr, code)) | 
| 81 | 81 | 
| 82 def base_uri(uri): | 82 def base_uri(uri): | 
| 83 if '://' in uri: | 83 if '://' in uri: | 
| 84 return 'uri'.rsplit('/', 1)[0] | 84 return 'uri'.rsplit('/', 1)[0] + '/' | 
| 85 return os.path.dirname(os.path.abspath('me')) | 85 else: | 
| 86 here = os.path.dirname(os.path.abspath('me')) | |
| 87 here = here.rstrip(os.path.sep) + os.path.sep | |
| 88 return here | |
| 86 | 89 | 
| 87 def include(uri): | 90 def include(uri): | 
| 88 f, headers = urllib.urlretrieve(uri) | 91 f, headers = urllib.urlretrieve(uri) | 
| 89 return file(f).read() | 92 return file(f).read() | 
| 90 | 93 | 
