kolibri/utils/cli.py
def initialize(debug=False, skip_update=False):
    """
    Currently, always called before running commands. This may change in case
    commands that conflict with this behavior show up.

    :param: debug: Tells initialization to setup logging etc.
    """
    if not os.path.isfile(version_file()):
        django.setup()

        setup_logging(debug=debug)

        if not skip_update:
            _first_run()
    else:
        # Do this here so that we can fix any issues with our configuration file before
        # we attempt to set up django.
        from .conf import autoremove_unavailable_plugins, enable_default_plugins

        autoremove_unavailable_plugins()

        version = open(version_file(), "r").read()
        version = version.strip() if version else ""

        if should_back_up(kolibri.__version__, version):
            # dbbackup will load settings.INSTALLED_APPS.
            # we need to ensure plugins are correct in conf.config before
            enable_default_plugins()
            # Version changed, make a backup no matter what.
            from kolibri.core.deviceadmin.utils import dbbackup

            try:
                backup = dbbackup(version)
                logger.info("Backed up database to: {path}".format(path=backup))
            except IncompatibleDatabase:
                logger.warning(
                    "Skipped automatic database backup, not compatible with "
                    "this DB engine."
                )

        django.setup()

        setup_logging(debug=debug)

        if kolibri.__version__ != version:
            logger.info(
                "Version was {old}, new version: {new}".format(
                    old=version, new=kolibri.__version__
                )
            )
            if not skip_update:
                update()

    Currently, always called before running commands. This may change in case
    commands that conflict with this behavior show up.

    :param: debug: Tells initialization to setup logging etc.
    
Currently, always called before running commands. This may change in case
commands that conflict with this behavior show up.

:param: debug: Tells initialization to setup logging etc.
Currently always called before running commands . This may change in case commands that conflict with this behavior show up . : param : debug : Tells initialization to setup logging etc .
def initialize(debug=False, skip_update=False):
    if not os.path.isfile(version_file()):
        django.setup()
        setup_logging(debug=debug)
        if not skip_update:
            _first_run()
    else:
        from .conf import autoremove_unavailable_plugins, enable_default_plugins
        autoremove_unavailable_plugins()
        version = open(version_file(), "r").read()
        version = version.strip() if version else ""
        if should_back_up(kolibri.__version__, version):
            enable_default_plugins()
            from kolibri.core.deviceadmin.utils import dbbackup
            try:
                backup = dbbackup(version)
                logger.info("Backed up database to: {path}".format(path=backup))
            except IncompatibleDatabase:
                logger.warning(
                    "Skipped automatic database backup, not compatible with "
                    "this DB engine."
                )
        django.setup()
        setup_logging(debug=debug)
        if kolibri.__version__ != version:
            logger.info(
                "Version was {old}, new version: {new}".format(
                    old=version, new=kolibri.__version__
                )
            )
            if not skip_update:
                update()
def initialize ( debug = False , skip_update = False ) : if not os . path . isfile ( version_file ( ) ) : django . setup ( ) setup_logging ( debug = debug ) if not skip_update : _first_run ( ) else : from . conf import autoremove_unavailable_plugins , enable_default_plugins autoremove_unavailable_plugins ( ) version = open ( version_file ( ) , "r" ) . read ( ) version = version . strip ( ) if version else "" if should_back_up ( kolibri . __version__ , version ) : enable_default_plugins ( ) from kolibri . core . deviceadmin . utils import dbbackup try : backup = dbbackup ( version ) logger . info ( "Backed up database to: {path}" . format ( path = backup ) ) except IncompatibleDatabase : logger . warning ( "Skipped automatic database backup, not compatible with " "this DB engine." ) django . setup ( ) setup_logging ( debug = debug ) if kolibri . __version__ != version : logger . info ( "Version was {old}, new version: {new}" . format ( old = version , new = kolibri . __version__ ) ) if not skip_update : update ( )
Currently, always called before running commands.
Currently always called before running commands .
"""
    Currently, always called before running commands. This may change in case
    commands that conflict with this behavior show up.

    :param: debug: Tells initialization to setup logging etc.
    """ # Do this here so that we can fix any issues with our configuration file before # we attempt to set up django. # dbbackup will load settings.INSTALLED_APPS. # we need to ensure plugins are correct in conf.config before # Version changed, make a backup no matter what.
debug
skip_update