Example #1
0
def get_bootinfo():
    """build and return boot info"""
    bootinfo = webnotes._dict()
    doclist = []

    # profile
    get_profile(bootinfo)

    # control panel
    cp = webnotes.model.doc.getsingle('Control Panel')

    # system info
    bootinfo['control_panel'] = webnotes._dict(cp.copy())
    bootinfo['sysdefaults'] = webnotes.defaults.get_defaults()
    bootinfo['server_date'] = webnotes.utils.nowdate()
    bootinfo["send_print_in_body_and_attachment"] = webnotes.conn.get_value(
        "Email Settings", None, "send_print_in_body_and_attachment")

    if webnotes.session['user'] != 'Guest':
        bootinfo['user_info'] = get_fullnames()
        bootinfo['sid'] = webnotes.session['sid']

    # home page
    bootinfo.modules = webnotes.get_config().modules
    bootinfo.hidden_modules = webnotes.conn.get_global("hidden_modules")
    bootinfo.doctype_icons = dict(
        webnotes.conn.sql("""select name, icon from 
		tabDocType where ifnull(icon,'')!=''"""))
    bootinfo.doctype_icons.update(
        dict(
            webnotes.conn.sql("""select name, icon from 
		tabPage where ifnull(icon,'')!=''""")))

    add_home_page(bootinfo, doclist)
    add_allowed_pages(bootinfo)
    load_translations(bootinfo)
    load_conf_settings(bootinfo)

    # ipinfo
    if webnotes.session['data'].get('ipinfo'):
        bootinfo['ipinfo'] = webnotes.session['data']['ipinfo']

    # add docs
    bootinfo['docs'] = doclist

    # plugins
    try:
        import startup.boot
        startup.boot.boot_session(bootinfo)
    except ImportError:
        pass

    from webnotes.model.utils import compress
    bootinfo['docs'] = compress(bootinfo['docs'])

    return bootinfo
Example #2
0
def get_bootinfo():
	"""build and return boot info"""
	bootinfo = webnotes._dict()
	doclist = []

	# profile
	get_profile(bootinfo)
	
	# control panel
	cp = webnotes.model.doc.getsingle('Control Panel')

	
	# system info
	bootinfo['control_panel'] = webnotes._dict(cp.copy())
	bootinfo['sysdefaults'] = webnotes.defaults.get_defaults()
	bootinfo['server_date'] = webnotes.utils.nowdate()
	bootinfo["send_print_in_body_and_attachment"] = webnotes.conn.get_value("Email Settings", 
		None, "send_print_in_body_and_attachment")

	if webnotes.session['user'] != 'Guest':
		bootinfo['user_info'] = get_fullnames()
		bootinfo['sid'] = webnotes.session['sid'];
		
	# home page
	bootinfo.modules = webnotes.get_config().modules
	bootinfo.hidden_modules = webnotes.conn.get_global("hidden_modules")
	bootinfo.doctype_icons = dict(webnotes.conn.sql("""select name, icon from 
		tabDocType where ifnull(icon,'')!=''"""))
	bootinfo.doctype_icons.update(dict(webnotes.conn.sql("""select name, icon from 
		tabPage where ifnull(icon,'')!=''""")))
	
	add_home_page(bootinfo, doclist)
	add_allowed_pages(bootinfo)
	load_translations(bootinfo)
	load_conf_settings(bootinfo)

	# ipinfo
	if webnotes.session['data'].get('ipinfo'):
		bootinfo['ipinfo'] = webnotes.session['data']['ipinfo']
	
	# add docs
	bootinfo['docs'] = doclist
	
	# plugins
	try:
		import startup.boot
		startup.boot.boot_session(bootinfo)
	except ImportError:
		pass
	
	from webnotes.model.utils import compress
	bootinfo['docs'] = compress(bootinfo['docs'])
	
	return bootinfo
Example #3
0
def get_bootinfo():
    """build and return boot info"""
    bootinfo = webnotes._dict()
    doclist = []

    # profile
    get_profile(bootinfo)

    # control panel
    cp = webnotes.model.doc.getsingle("Control Panel")

    # system info
    bootinfo["control_panel"] = webnotes._dict(cp.copy())
    bootinfo["sysdefaults"] = webnotes.defaults.get_defaults()
    bootinfo["server_date"] = webnotes.utils.nowdate()
    bootinfo["send_print_in_body_and_attachment"] = webnotes.conn.get_value(
        "Email Settings", None, "send_print_in_body_and_attachment"
    )

    if webnotes.session["user"] != "Guest":
        bootinfo["user_info"] = get_fullnames()
        bootinfo["sid"] = webnotes.session["sid"]

        # home page
    bootinfo.modules = webnotes.get_config().modules
    bootinfo.hidden_modules = webnotes.conn.get_global("hidden_modules")
    add_home_page(bootinfo, doclist)
    add_allowed_pages(bootinfo)
    load_translations(bootinfo)
    load_country_and_currency(bootinfo, doclist)

    # ipinfo
    if webnotes.session["data"].get("ipinfo"):
        bootinfo["ipinfo"] = webnotes.session["data"]["ipinfo"]

        # add docs
    bootinfo["docs"] = doclist

    # plugins
    try:
        import startup.boot

        startup.boot.boot_session(bootinfo)
    except ImportError:
        pass

    from webnotes.model.utils import compress

    bootinfo["docs"] = compress(bootinfo["docs"])

    return bootinfo
Example #4
0
def get_bootinfo():
    """build and return boot info"""
    bootinfo = webnotes._dict()
    doclist = []

    # profile
    get_profile(bootinfo)

    # control panel
    cp = webnotes.model.doc.getsingle("Control Panel")

    # system info
    bootinfo["control_panel"] = webnotes._dict(cp.copy())
    bootinfo["sysdefaults"] = webnotes.utils.get_defaults()
    bootinfo["server_date"] = webnotes.utils.nowdate()

    if webnotes.session["user"] != "Guest":
        bootinfo["user_info"] = get_fullnames()
        bootinfo["sid"] = webnotes.session["sid"]

        # home page
    add_home_page(bootinfo, doclist)
    add_allowed_pages(bootinfo)
    load_translations(bootinfo)
    load_country_and_currency(bootinfo, doclist)

    # ipinfo
    if webnotes.session["data"].get("ipinfo"):
        bootinfo["ipinfo"] = webnotes.session["data"]["ipinfo"]

        # add docs
    bootinfo["docs"] = doclist

    # plugins
    try:
        from startup import event_handlers

        if getattr(event_handlers, "boot_session", None):
            event_handlers.boot_session(bootinfo)

    except ImportError:
        pass

    from webnotes.model.utils import compress

    bootinfo["docs"] = compress(bootinfo["docs"])

    return bootinfo
Example #5
0
def get_bootinfo():
	"""build and return boot info"""
	bootinfo = webnotes._dict()
	doclist = []

	# profile
	get_profile(bootinfo)
	
	# control panel
	cp = webnotes.model.doc.getsingle('Control Panel')

	
	# system info
	bootinfo['control_panel'] = webnotes._dict(cp.copy())
	bootinfo['sysdefaults'] = webnotes.defaults.get_defaults()
	bootinfo['server_date'] = webnotes.utils.nowdate()

	if webnotes.session['user'] != 'Guest':
		bootinfo['user_info'] = get_fullnames()
		bootinfo['sid'] = webnotes.session['sid'];
		
	# home page
	add_home_page(bootinfo, doclist)
	add_allowed_pages(bootinfo)
	load_translations(bootinfo)
	load_country_and_currency(bootinfo, doclist)

	# ipinfo
	if webnotes.session['data'].get('ipinfo'):
		bootinfo['ipinfo'] = webnotes.session['data']['ipinfo']
	
	# add docs
	bootinfo['docs'] = doclist
	
	# plugins
	try:
		from startup import event_handlers
		if getattr(event_handlers, 'boot_session', None):
			event_handlers.boot_session(bootinfo)

	except ImportError:
		pass
	
	from webnotes.model.utils import compress
	bootinfo['docs'] = compress(bootinfo['docs'])
	
	return bootinfo
Example #6
0
def get_bootinfo():
    """build and return boot info"""
    bootinfo = webnotes.DictObj()
    doclist = []

    # profile
    get_profile(bootinfo)

    # control panel
    cp = webnotes.model.doc.getsingle('Control Panel')

    # system info
    bootinfo['control_panel'] = cp.copy()
    bootinfo['account_name'] = cp.get('account_id')
    bootinfo['sysdefaults'] = webnotes.utils.get_defaults()
    bootinfo['server_date'] = webnotes.utils.nowdate()

    if webnotes.session['user'] != 'Guest':
        bootinfo['user_info'] = get_fullnames()
        bootinfo['sid'] = webnotes.session['sid']

    # home page
    add_home_page(bootinfo, doclist)

    # ipinfo
    if webnotes.session['data'].get('ipinfo'):
        bootinfo['ipinfo'] = webnotes.session['data']['ipinfo']

    # add docs
    bootinfo['docs'] = doclist

    # plugins
    try:
        from startup import event_handlers
        if getattr(event_handlers, 'boot_session', None):
            event_handlers.boot_session(bootinfo)

    except ImportError:
        pass

    from webnotes.model.utils import compress
    bootinfo['docs'] = compress(bootinfo['docs'])

    return bootinfo
Example #7
0
	load_translations(bootinfo)
	load_conf_settings(bootinfo)
	load_startup_js(bootinfo)

	# ipinfo
	if webnotes.session['data'].get('ipinfo'):
		bootinfo['ipinfo'] = webnotes.session['data']['ipinfo']
	
	# add docs
	bootinfo['docs'] = doclist
	
	for method in hooks.boot_session or []:
		webnotes.get_attr(method)(bootinfo)
		
	from webnotes.model.utils import compress
	bootinfo['docs'] = compress(bootinfo['docs'])

	# deal with __slots__ in lang
	if bootinfo.lang:
		bootinfo.lang = unicode(bootinfo.lang)
	
	bootinfo.metadata_version = webnotes.cache().get_value("metadata_version")
	if not bootinfo.metadata_version:
		bootinfo.metadata_version = webnotes.reset_metadata_version()
		
	return bootinfo

def load_conf_settings(bootinfo):
	from webnotes import conf
	for key in ['developer_mode']:
		if key in conf: bootinfo[key] = conf.get(key)