Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logger.error(
"There is a Kolibri server running."
"Running updates now could cause a database error."
"Please use `kolibri stop` and try again."
)
sys.exit(1)
except server.NotRunning:
pass
_migrate_databases()
run_upgrades(old_version, new_version)
with open(version_file(), "w") as f:
f.write(kolibri.__version__)
from django.core.cache import caches
cache = caches["built_files"]
cache.clear()
try:
return get_distribution(top_level_module).version
except (DistributionNotFound, AttributeError):
try:
module = importlib.import_module(plugin_name)
return module.__version__
except (ImportError, AttributeError):
try:
# Try importing the top level module that this plugin is in
module = importlib.import_module(top_level_module)
return module.__version__
except (ImportError, AttributeError):
# This should work for most things, but seems like we are stuck
# just use the Kolibri version and just run upgrades in line with
# Kolibri instead.
return kolibri.__version__
else:
return kolibri.__version__
except (DistributionNotFound, AttributeError):
try:
module = importlib.import_module(plugin_name)
return module.__version__
except (ImportError, AttributeError):
try:
# Try importing the top level module that this plugin is in
module = importlib.import_module(top_level_module)
return module.__version__
except (ImportError, AttributeError):
# This should work for most things, but seems like we are stuck
# just use the Kolibri version and just run upgrades in line with
# Kolibri instead.
return kolibri.__version__
else:
return kolibri.__version__
def get(self, request, format=None):
info = {}
info["version"] = kolibri.__version__
status, urls = get_urls()
if not urls:
# Will not return anything when running the debug server, so at least return the current URL
urls = [
request.build_absolute_uri(OPTIONS["Deployment"]["URL_PATH_PREFIX"])
]
filtered_urls = [
url for url in urls if "127.0.0.1" not in url and "localhost" not in url
]
if filtered_urls:
urls = filtered_urls
info["urls"] = urls
# You can specify multiple suffix as a list of string:
source_suffix = ['.rst', '.md']
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Kolibri Developer Docs'
copyright = u'{year:d}, Learning Equality'.format(year=datetime.now().year)
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = kolibri.__version__
# The full version, including alpha/beta/rc tags.
release = kolibri.__version__
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
This package can be installed by running ``pip install --user kolibri``. `See the download
page `_ for other methods of installation.
- `View the documentation `_ and the `community
forums `_ for more guidance on setting up
and using Kolibri
- Visit the `Github project `_ and the
`developer documentation `_ if you would like
to contribute to development
"""
setup(
name="kolibri",
version=kolibri.__version__,
description="Kolibri - the offline app for universal education",
long_description=long_description,
author="Learning Equality",
author_email="info@learningequality.org",
url="https://github.com/learningequality/kolibri",
packages=[str("kolibri")], # https://github.com/pypa/setuptools/pull/597
entry_points={
"console_scripts": ["kolibri = kolibri.utils.cli:main"],
"kolibri.plugins": [
"{module_path} = {module_path}".format(module_path=module_path)
for module_path in kolibri.INTERNAL_PLUGINS
],
},
package_dir={"kolibri": "kolibri"},
include_package_data=True,
install_requires=[],
# The master toctree document.
master_doc = "index"
# General information about the project.
project = u"Kolibri developer documentation"
copyright = u"{year:d}, Learning Equality".format(year=datetime.now().year)
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = kolibri.__version__
# The full version, including alpha/beta/rc tags.
release = kolibri.__version__
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "default"
on_rtd = os.environ.get("READTHEDOCS", None) == "True"