[demo] [minor]

This commit is contained in:
Rushabh Mehta
2013-09-01 11:14:32 +05:30
parent 0c2fb66051
commit e499a48f85
2 changed files with 13 additions and 8 deletions

View File

@@ -29,7 +29,7 @@ prob = {
"Purchase Receipt": { "make": 0.7, "qty": (1,15) }, "Purchase Receipt": { "make": 0.7, "qty": (1,15) },
} }
def make(reset=False): def make(reset=False, simulate=True):
webnotes.connect() webnotes.connect()
#webnotes.print_messages = True #webnotes.print_messages = True
webnotes.mute_emails = True webnotes.mute_emails = True
@@ -37,7 +37,8 @@ def make(reset=False):
if reset: if reset:
setup() setup()
simulate() if simulate:
simulate()
def setup(): def setup():
install() install()

View File

@@ -3,10 +3,10 @@ if __name__=="__main__":
sys.path.extend([".", "lib", "app"]) sys.path.extend([".", "lib", "app"])
import webnotes, os import webnotes, os
import utilities.demo.make_demo
def make_demo_app(): def make_demo_app():
import utilities.demo.make_demo
utilities.demo.make_demo.make(reset=True)
def make_demo_user(): def make_demo_user():
roles = ["Accounts Manager", "Analytics", "Expense Approver", "Accounts User", roles = ["Accounts Manager", "Analytics", "Expense Approver", "Accounts User",
@@ -88,8 +88,10 @@ def make_demo_login_page():
p.insert() p.insert()
webnotes.conn.set_value("Website Settings", None, "home_page", "demo-login") website_settings = webnotes.bean("Website Settings", "Website Settings")
webnotes.conn.set_value("Website Settings", None, "disable_signup", 1) website_settings.doc.home_page = "demo-login"
website_settings.doc.disable_signup = 1
website_settings.save()
webnotes.conn.commit() webnotes.conn.commit()
@@ -111,7 +113,9 @@ def make_demo_on_login_script():
if __name__=="__main__": if __name__=="__main__":
# webnotes.connect() # webnotes.connect()
webnotes.mute_emails = 1 webnotes.mute_emails = 1
make_demo_app() 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_user()
make_demo_login_page() make_demo_login_page()
make_demo_on_login_script() make_demo_on_login_script()
utilities.demo.make_demo.make(reset=False, simulate=True)