Merge branch 'renamedt' into shf_rename

Conflicts:
	erpnext/patches/patch_list.py
This commit is contained in:
Anand Doshi
2012-03-29 15:31:17 +05:30
15 changed files with 383 additions and 163 deletions

20
wnf.py
View File

@@ -25,11 +25,12 @@ def replace_code(start, txt1, txt2, extn):
for fn in wt[2]:
if fn.split('.')[-1]==extn:
fpath = os.path.join(wt[0], fn)
with open(fpath, 'r') as f:
content = f.read()
if fpath != '/var/www/erpnext/erpnext/patches/jan_mar_2012/rename_dt.py': # temporary
with open(fpath, 'r') as f:
content = f.read()
if re.search(txt1, content):
search_replace_with_prompt(fpath, txt1, txt2)
if re.search(txt1, content):
search_replace_with_prompt(fpath, txt1, txt2)
@@ -45,15 +46,16 @@ def search_replace_with_prompt(fpath, txt1, txt2):
if c.find(txt1) != -1:
print '\n', fpath
print colored(txt1, 'red').join(c[:-1].split(txt1))
a = raw_input('Do you want to Change [y/n]?')
if a=='y':
a = ''
while a not in ['y', 'n', 'Y', 'N']:
a = raw_input('Do you want to Change [y/n]?')
if a.lower() == 'y':
c = c.replace(txt1, txt2)
tmp.append(c)
tmp.append(c)
with open(fpath, 'w') as f:
f.write(''.join(tmp))
print colored('Updated in %s' % fpath, 'green')
print colored('Updated', 'green')
def setup_options():