15 |
import os |
import os |
16 |
import string |
import string |
17 |
|
|
18 |
from Thuban.Lib.fileutil import relative_filename |
import Thuban.Lib.fileutil |
19 |
|
|
20 |
|
def relative_filename(dir, filename): |
21 |
|
"""Return a filename relative to dir for the absolute file name absname. |
22 |
|
|
23 |
|
This is almost the same as the function in fileutil, except that dir |
24 |
|
can be an empty string in which case filename will be returned |
25 |
|
unchanged. |
26 |
|
""" |
27 |
|
if dir: |
28 |
|
return Thuban.Lib.fileutil.relative_filename(dir, filename) |
29 |
|
else: |
30 |
|
return filename |
31 |
|
|
32 |
def escape(data): |
def escape(data): |
33 |
"""Escape &, \", ', <, and > in a string of data. |
"""Escape &, \", ', <, and > in a string of data. |