diff options
Diffstat (limited to 'licenses/03-cleanup-cc-html-files.py')
-rwxr-xr-x | licenses/03-cleanup-cc-html-files.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/licenses/03-cleanup-cc-html-files.py b/licenses/03-cleanup-cc-html-files.py index 80f93cd..c81ca7d 100755 --- a/licenses/03-cleanup-cc-html-files.py +++ b/licenses/03-cleanup-cc-html-files.py @@ -5,6 +5,8 @@ import os import re import sys +from license_utils import rewrite_attr + def main(argv): langs = ['C', 'ar', 'es', 'fr', 'pt_BR'] @@ -118,12 +120,6 @@ def cleanup_deed_file(src_dir, license, lang): f.write(html) f.close() -def rewrite_attr(html, elem, attr, source, target): - for element in html.findAll(elem): - if element.has_key(attr): - attr_val = re.sub(source, target, element[attr]) - element[attr] = attr_val - def cleanup_conditional_comments(html): comments = html.findAll(text=lambda text:isinstance(text, Comment) and '[if' in text) for comment in comments: |