website fixes

This commit is contained in:
Rushabh Mehta
2012-02-06 13:09:08 +01:00
parent e651648b1b
commit cc54fd46bc
4 changed files with 36 additions and 22 deletions

18
wnf.py
View File

@@ -68,6 +68,10 @@ def run():
from webnotes.db import Database
import webnotes.modules.patch_handler
# connect
if options.db_name is not None:
webnotes.connect(options.db_name)
# build
if options.build:
import build.project
@@ -99,19 +103,11 @@ def run():
os.system('git commit -a -m "%s"' % options.push[2])
os.system('git push %s %s' % (options.push[0], options.push[1]))
# patch
elif options.patch_list:
# clear log
webnotes.modules.patch_handler.log_list = []
# connect to db
if options.db_name is not None:
webnotes.connect(options.db_name)
else:
webnotes.connect()
# run individual patches
for patch in options.patch_list:
webnotes.modules.patch_handler.run_single(\
@@ -129,6 +125,10 @@ def run():
elif options.run_latest:
webnotes.modules.patch_handler.run_all()
print '\n'.join(webnotes.modules.patch_handler.log_list)
# print messages
if webnotes.message_log:
print '\n'.join(webnotes.message_log)
if __name__=='__main__':
run()