comparison makeitso/makeitso.py @ 25:fbf19940fa97

remove the staging directory you attempted to download
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 30 Nov 2010 09:23:46 -0800
parents 1b802678b341
children 044ac9e0b29c
comparison
equal deleted inserted replaced
24:1b802678b341 25:fbf19940fa97
3 filesystem template interpreter 3 filesystem template interpreter
4 """ 4 """
5 5
6 import os 6 import os
7 import re 7 import re
8 import shutil
8 import subprocess 9 import subprocess
9 import sys 10 import sys
10 import tempfile 11 import tempfile
11 import urllib 12 import urllib
12 # TODO: may have to use urllib2.urlopen to get reasonable timeouts 13 # TODO: may have to use urllib2.urlopen to get reasonable timeouts
18 19
19 # URL of tempita 20 # URL of tempita
20 tempita_location = 'http://bitbucket.org/ianb/tempita/raw-file/tip/tempita/' 21 tempita_location = 'http://bitbucket.org/ianb/tempita/raw-file/tip/tempita/'
21 22
22 def cleanup(): 23 def cleanup():
24
25 # remove temporary net module directory
23 if 'tempdir' in globals(): 26 if 'tempdir' in globals():
24 ### TODO: remove it 27 shutil.remove(tempdir)
25 pass
26 28
27 try: 29 try:
28 import tempita 30 import tempita
29 except ImportError: 31 except ImportError:
30 32
31 # Get tempita from the net 33 # Get tempita from the net
34 # TODO: abstract this to get arbitrary modules from the net
32 def getFiles(url, subdir, files): 35 def getFiles(url, subdir, files):
33 """ 36 """
34 fetch files from the internet 37 fetch files from the internet
35 - url : base url 38 - url : base url
36 - subdirectory: to put things in 39 - subdirectory: to put things in