X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=dotfiles2html%2Fdotfiles2html.py;h=7c6f95a18734d8cc32ded20a9de8443911a7b516;hb=123caa2fc6ef46d3a862678b45077923fd1a2138;hp=640aa6a2ac9a579c8e2625748dc731071d83437c;hpb=b1492b5836aead48044b51e9ba114c641669c6b6;p=phdru.name%2Fphdru.name.git diff --git a/dotfiles2html/dotfiles2html.py b/dotfiles2html/dotfiles2html.py index 640aa6a..7c6f95a 100755 --- a/dotfiles2html/dotfiles2html.py +++ b/dotfiles2html/dotfiles2html.py @@ -5,6 +5,7 @@ __copyright__ = "Copyright (C) 2004-2020 PhiloSoft Design" import filecmp import os +import re import shutil os.umask(0022) # octal; -rw-r--r-- @@ -75,10 +76,13 @@ def process_dotfile(i, fname, ftype, file_types): if not os.path.exists(fname): return + file = open(fname, 'r') + text = file.read() + file.close() + + text = re.sub('cgmem_nice \d+ ', '', text) + if fname in ('mailcap', 'mc.ext', 'menu'): - file = open(fname, 'r') - text = file.read() - file.close() file = open(fname, 'w') text = text.replace('mplay', 'mplayer') text = text.replace('mplayerer', 'mplayer') @@ -90,11 +94,9 @@ def process_dotfile(i, fname, ftype, file_types): file.close() elif fname == 'vimrc': - file = open('vimrc', 'r') - text = file.read() - file.close() - file = open('vimrc', 'w') - file.write(text.replace('\033', '')) + file = open(fname, 'w') + text = text.replace('\033', '') + file.write(text) file.close() os.system("""exec gvim -f -c "set filetype=%s" -c ":source %s/dotfile2html.vim" "%s"