Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/bazarr/src/commit/247f69c210531048186c699de240f5e860ef0b3f/libs/knowit/properties/basic.py You should set ROOT_URL correctly, otherwise the web may not work correctly.
bazarr/libs/knowit/properties/basic.py

28 lines
766 B

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from six import text_type
from ..property import Property
class Basic(Property):
"""Basic property to handle int, float and other basic types."""
def __init__(self, name, data_type, allow_fallback=False, **kwargs):
"""Init method."""
super(Basic, self).__init__(name, **kwargs)
self.data_type = data_type
self.allow_fallback = allow_fallback
def handle(self, value, context):
"""Handle value."""
if isinstance(value, self.data_type):
return value
try:
return self.data_type(text_type(value))
except ValueError:
if not self.allow_fallback:
self.report(value, context)