CheetahWrapper.py (cheetah3-3.2.1) | : | CheetahWrapper.py (cheetah3-3.2.2) | ||
---|---|---|---|---|
skipping to change at line 77 | skipping to change at line 77 | |||
self.cmd = self.locate_cheetah('cheetah') | self.cmd = self.locate_cheetah('cheetah') | |||
cwd = os.getcwd() | cwd = os.getcwd() | |||
if not os.environ.get('PYTHONPATH'): | if not os.environ.get('PYTHONPATH'): | |||
os.environ['PYTHONPATH'] = cwd | os.environ['PYTHONPATH'] = cwd | |||
else: | else: | |||
pythonPath = os.environ['PYTHONPATH'] | pythonPath = os.environ['PYTHONPATH'] | |||
if (pythonPath != cwd) and \ | if (pythonPath != cwd) and \ | |||
not pythonPath.endswith(':%s' % cwd): | not pythonPath.endswith(':%s' % cwd): | |||
os.environ['PYTHONPATH'] = '%s:%s' % (pythonPath, cwd) | os.environ['PYTHONPATH'] = '%s:%s' % (pythonPath, cwd) | |||
# Step 1: Create the scratch directory and chdir into it. | # Step 1: Create the scratch directory and chdir into it. | |||
self.scratchDir = scratchDir = tempfile.mktemp() | self.scratchDir = scratchDir = tempfile.mkdtemp() | |||
os.mkdir(scratchDir) | ||||
self.origCwd = os.getcwd() | self.origCwd = os.getcwd() | |||
os.chdir(scratchDir) | os.chdir(scratchDir) | |||
if self.srcDir: | if self.srcDir: | |||
os.mkdir(self.srcDir) | os.mkdir(self.srcDir) | |||
# Step 2: Create source subdirectories. | # Step 2: Create source subdirectories. | |||
for dir in self.subdirs: | for dir in self.subdirs: | |||
os.mkdir(dir) | os.mkdir(dir) | |||
# Step 3: Create the .tmpl files, each in its proper directory. | # Step 3: Create the .tmpl files, each in its proper directory. | |||
for fil in self.srcFiles: | for fil in self.srcFiles: | |||
f = open(fil, 'w') | f = open(fil, 'w') | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added |