mirror of https://github.com/tLDP/python-tldp
find the parent ./tldp/ directory
This commit is contained in:
parent
a3180238bd
commit
211d3b93d7
|
@ -7,13 +7,17 @@ from __future__ import print_function
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
opd = os.path.dirname
|
||||||
|
opj = os.path.join
|
||||||
|
|
||||||
|
sys.path.append(opd(opd(__file__)))
|
||||||
from tldp import VERSION
|
from tldp import VERSION
|
||||||
|
|
||||||
fin = open(os.path.join(os.path.dirname(__file__), 'tldp.spec.in'))
|
fin = open(opj(opd(__file__), 'tldp.spec.in'))
|
||||||
fout = open(os.path.join(os.path.dirname(__file__), 'tldp.spec'))
|
fout = open(opj(opd(__file__), 'tldp.spec'), 'w')
|
||||||
|
|
||||||
def transform(mapping, text):
|
def transform(mapping, text):
|
||||||
for tag, replacement in mapping.iteritems():
|
for tag, replacement in mapping.items():
|
||||||
text = text.replace(tag, replacement)
|
text = text.replace(tag, replacement)
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue