ctags 메크로
ctags에 태그가 자꾸 깨지는데 계속 태깅하는게 귀찮아서 Vim에서 쓰려고 후딱 만들었음. python은 잊을만 하면 한번씩 쓰다보니... -_-;
import os
import sys
import subprocess
pwd = subprocess.Popen(["pwd"], stdout=subprocess.PIPE, shell=True)
(current_path, err) = pwd.communicate()
pwd_status = pwd.wait()
if pwd_status != 0 :
print "Error : Print Working Directory Fail."
sys.exit(0)
i = current_path.find("Assets")
if i == -1 :
print "Error : Can't Find Assets Directory In Current Path."
sys.exit(0)
dirnames = current_path.split(os.sep)
assets_path = ""
for name in dirnames :
if name == "" :
continue
assets_path += "/" + name
if name == "Assets" :
break
os.chdir(assets_path)
subprocess.call(["ctags", "-R", "."])