예제 #1
0
 def plugin_data(self):
     return {
         "contentCacheKey": ContentCacheKey.get_cache_key(),
         "languageGlobals": self.language_globals(),
         "oidcProviderEnabled": OIDCProviderHook().is_enabled,
         "kolibriTheme": ThemeHook().theme,
     }
예제 #2
0
def kolibri_content_cache_key():
    js = """
    <script>
      var contentCacheKey = '{cache_key}';
    </script>
    """.format(cache_key=ContentCacheKey.get_cache_key(), )
    return mark_safe(js)
예제 #3
0
 def plugin_data(self):
     language_code = get_language()
     static_root = static("assets/fonts/noto-full")
     full_file = "{}.{}.{}.css?v={}"
     return {
         "fullCSSFileModern": full_file.format(
             static_root, language_code, "modern", kolibri.__version__
         ),
         "fullCSSFileBasic": full_file.format(
             static_root, language_code, "basic", kolibri.__version__
         ),
         "allowRemoteAccess": allow_other_browsers_to_connect()
         or not interface.enabled,
         "appCapabilities": interface.capabilities,
         "contentCacheKey": ContentCacheKey.get_cache_key(),
         "languageGlobals": self.language_globals(),
         "oidcProviderEnabled": OIDCProviderHook.is_enabled(),
         "kolibriTheme": ThemeHook.get_theme(),
     }
예제 #4
0
 def plugin_data(self):
     language_code = get_language()
     static_root = static("assets/fonts/noto-full")
     full_file = "{}.{}.{}.css?v={}"
     return {
         "fullCSSFileModern":
         full_file.format(static_root, language_code, "modern",
                          kolibri.__version__),
         "fullCSSFileBasic":
         full_file.format(static_root, language_code, "basic",
                          kolibri.__version__),
         "contentCacheKey":
         ContentCacheKey.get_cache_key(),
         "languageGlobals":
         self.language_globals(),
         "oidcProviderEnabled":
         OIDCProviderHook.is_enabled(),
         "kolibriTheme":
         ThemeHook.get_theme(),
     }
예제 #5
0
파일: api.py 프로젝트: chrislun16/kolibri
def get_cache_key(*args, **kwargs):
    return str(ContentCacheKey.get_cache_key())
예제 #6
0
def calculate_spa_etag(*args, **kwargs):
    return hashlib.md5(
        kolibri_version.encode("utf-8")
        + str(ContentCacheKey.get_cache_key()).encode("utf-8")
        + str(ThemeHook.cacheKey()).encode("utf-8")
    ).hexdigest()