diff --git a/openlp/core/common/json.py b/openlp/core/common/json.py index c323479e6..06a6f9eac 100644 --- a/openlp/core/common/json.py +++ b/openlp/core/common/json.py @@ -186,12 +186,12 @@ class PathSerializer(JSONMixin, register_names=('Path', 'PosixPath', 'WindowsPat return path @classmethod - def json_object(cls, obj, base_path=None, js_use=False, **kwargs): + def json_object(cls, obj, base_path=None, is_js=False, **kwargs): """ Create a dictionary that can be JSON decoded. :param Path base_path: If specified, an absolute path to make a relative path from. - :param bool js_use: Encode the path as a uri. For example for use in the js rendering code. + :param bool is_js: Encode the path as a uri. For example for use in the js rendering code. :param kwargs: Contains any extra parameters. Not used! :return: The dictionary representation of this Path object. :rtype: dict[tuple] @@ -200,7 +200,7 @@ class PathSerializer(JSONMixin, register_names=('Path', 'PosixPath', 'WindowsPat if base_path: with suppress(ValueError): path = path.relative_to(base_path) - if js_use is True: + if is_js is True: return path.as_uri() json_dict = {'parts': path.parts} cls.attach_meta(json_dict) diff --git a/openlp/core/display/window.py b/openlp/core/display/window.py index e18437a4a..393b6ccce 100644 --- a/openlp/core/display/window.py +++ b/openlp/core/display/window.py @@ -332,9 +332,9 @@ class DisplayWindow(QtWidgets.QWidget): theme_copy = copy.deepcopy(theme) theme_copy.background_type = 'image' theme_copy.background_filename = self.checkerboard_path - exported_theme = theme_copy.export_theme(js_use=True) + exported_theme = theme_copy.export_theme(is_js=True) else: - exported_theme = theme.export_theme(js_use=True) + exported_theme = theme.export_theme(is_js=True) self.run_javascript('Display.setTheme({theme});'.format(theme=exported_theme)) def get_video_types(self): diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index af40809bd..bc5ba69b8 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -225,18 +225,18 @@ class Theme(object): jsn = json.loads(theme, cls=OpenLPJSONDecoder) self.expand_json(jsn) - def export_theme(self, theme_path=None, js_use=False): + def export_theme(self, theme_path=None, is_js=False): """ Loop through the fields and build a dictionary of them :param pathlib.Path | None theme_path: - :param bool js_use: For internal use, for example with the theme js code. + :param bool is_js: For internal use, for example with the theme js code. :return str: The json encoded theme object """ theme_data = {} for attr, value in self.__dict__.items(): theme_data["{attr}".format(attr=attr)] = value - return json.dumps(theme_data, cls=OpenLPJSONEncoder, base_path=theme_path, js_use=js_use) + return json.dumps(theme_data, cls=OpenLPJSONEncoder, base_path=theme_path, is_js=is_js) def parse(self, xml): """