find the parent ./tldp/ directory

This commit is contained in:
Martin A. Brown 2016-04-27 14:03:43 -04:00
parent a3180238bd
commit 211d3b93d7
1 changed files with 7 additions and 3 deletions

View File

@ -7,13 +7,17 @@ from __future__ import print_function
import os
import sys
opd = os.path.dirname
opj = os.path.join
sys.path.append(opd(opd(__file__)))
from tldp import VERSION
fin = open(os.path.join(os.path.dirname(__file__), 'tldp.spec.in'))
fout = open(os.path.join(os.path.dirname(__file__), 'tldp.spec'))
fin = open(opj(opd(__file__), 'tldp.spec.in'))
fout = open(opj(opd(__file__), 'tldp.spec'), 'w')
def transform(mapping, text):
for tag, replacement in mapping.iteritems():
for tag, replacement in mapping.items():
text = text.replace(tag, replacement)
return text