Mercurial > hg > carton
comparison carton.py @ 27:dace84448c25
carry carton along with carton
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sun, 10 Jul 2011 18:48:30 -0700 |
parents | e6ee0410ceef |
children | dabf5e1bdf92 |
comparison
equal
deleted
inserted
replaced
26:e6ee0410ceef | 27:dace84448c25 |
---|---|
121 # add virtualenv to the virtualenv (!) | 121 # add virtualenv to the virtualenv (!) |
122 virtualenv_dir = os.path.dirname(virtualenv) | 122 virtualenv_dir = os.path.dirname(virtualenv) |
123 if os.path.exists(os.path.join(virtualenv_dir, 'setup.py')): | 123 if os.path.exists(os.path.join(virtualenv_dir, 'setup.py')): |
124 call([python, 'setup.py', 'install'], cwd=virtualenv_dir, stdout=subprocess.PIPE) | 124 call([python, 'setup.py', 'install'], cwd=virtualenv_dir, stdout=subprocess.PIPE) |
125 | 125 |
126 # TODO: | 126 |
127 | 127 # add carton to the virtualenv (!) |
128 # - add carton to the virtualenv (!) | 128 if CARTON: |
129 # if CARTON: | 129 CARTON = CARTON.decode('base64').decode('zlib') |
130 # CARTON = CARTON.decode('base64').decode('zlib') | 130 carton_filename = os.path.join(scripts_dir, 'carton.py') |
131 # carton_filename = os.path.join(scripts_dir, 'carton.py') | 131 f = file(carton_filename, 'w') |
132 # f = file(carton_filename, 'w') | 132 f.write(CARTON) |
133 # f.write(CARTON) | 133 f.close() |
134 # f.close() | 134 try: |
135 # try: | 135 os.chmod(carton_filename, 0755) |
136 # os.chmod(carton_filename, 0755) | 136 except: |
137 # except: | 137 # you probably don't have os.chmod |
138 # # you probably don't have os.chmod | 138 pass |
139 # pass | 139 |
140 | 140 # TODO: cleanup tempdir |
141 # - cleanup tempdir | |
142 # shutil.rmtree(tempdir) | 141 # shutil.rmtree(tempdir) |
143 """ | 142 """ |
144 | 143 |
145 def isURL(path): | 144 def isURL(path): |
146 return path.startswith('http://') or path.startswith('https://') | 145 return path.startswith('http://') or path.startswith('https://') |