file = open('vimrc', 'w')
file.write(text.replace('\e', '<Esc>'))
file.close()
- if os.path.exists(fname):
- os.system("""exec gvim -f -c "set filetype=%s" -c ":source %s/dotfile2html.vim" "%s"
- """ % (ftype, home_dir, fname))
- if i == 0:
- prev = None
- else:
- prev = file_types[i-1][0]
- if i >= ft_len - 1:
- next = None
- else:
- next = file_types[i+1][0]
- add_headers(fname, prev, next)
- if os.path.exists(fname + ".tmpl") and filecmp.cmp(fname + ".html", fname + ".tmpl"):
- os.remove(fname + ".html")
- else:
- os.rename(fname + ".html", fname + ".tmpl")
+ if not os.path.exists(fname):
+ continue
+ os.system("""exec gvim -f -c "set filetype=%s" -c ":source %s/dotfile2html.vim" "%s"
+ """ % (ftype, home_dir, fname))
+ if i == 0:
+ prev = None
+ else:
+ prev = file_types[i-1][0]
+ if i >= ft_len - 1:
+ next = None
+ else:
+ next = file_types[i+1][0]
+ add_headers(fname, prev, next)
+ if os.path.exists(fname + ".tmpl") and filecmp.cmp(fname + ".html", fname + ".tmpl"):
+ os.remove(fname + ".html")
+ else:
+ os.rename(fname + ".html", fname + ".tmpl")
if fname == 'vimrc' and os.path.exists('.' + fname):
shutil.copy2('.' + fname, fname)
if fname.endswith('.py'):