[demo] [minor] fixes in make demo

This commit is contained in:
Anand Doshi 2013-09-02 14:58:45 +05:30
parent e499a48f85
commit 9283b6c59d
2 changed files with 12 additions and 16 deletions

View File

@ -30,7 +30,6 @@ prob = {
}
def make(reset=False, simulate=True):
webnotes.connect()
#webnotes.print_messages = True
webnotes.mute_emails = True
webnotes.rollback_on_exception = True
@ -38,7 +37,7 @@ def make(reset=False, simulate=True):
if reset:
setup()
if simulate:
simulate()
_simulate()
def setup():
install()
@ -50,7 +49,7 @@ def setup():
# make_opening_stock()
# make_opening_accounts()
def simulate():
def _simulate():
global runs_for
current_date = webnotes.utils.getdate(start_date)
@ -412,6 +411,3 @@ def import_data(dt, submit=False):
webnotes.form_dict["params"] = json.dumps({"_submit": 1})
webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", doctype+".csv")
upload()
if __name__=="__main__":
make()

View File

@ -6,7 +6,14 @@ import webnotes, os
import utilities.demo.make_demo
def make_demo_app():
webnotes.mute_emails = 1
webnotes.connect()
utilities.demo.make_demo.make(reset=True, simulate=False)
# setup demo user etc so that the site it up faster, while the data loads
make_demo_user()
make_demo_login_page()
make_demo_on_login_script()
utilities.demo.make_demo.make(reset=False, simulate=True)
def make_demo_user():
roles = ["Accounts Manager", "Analytics", "Expense Approver", "Accounts User",
@ -111,11 +118,4 @@ def make_demo_on_login_script():
webnotes.conn.commit()
if __name__=="__main__":
# webnotes.connect()
webnotes.mute_emails = 1
utilities.demo.make_demo.make(reset=True, simulate=False)
# setup demo user etc so that the site it up faster, while the data loads
make_demo_user()
make_demo_login_page()
make_demo_on_login_script()
utilities.demo.make_demo.make(reset=False, simulate=True)
make_demo_app()