openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #34347
Re: [Merge] lp:~phill-ridout/openlp/fixes-III into lp:openlp
Diff comments:
>
> === modified file 'openlp/core/common/i18n.py'
> --- openlp/core/common/i18n.py 2019-06-28 18:09:25 +0000
> +++ openlp/core/common/i18n.py 2019-07-18 19:27:49 +0000
> @@ -338,8 +338,8 @@
> Override the default object creation method to return a single instance.
> """
> if not cls.__instance__:
> - cls.__instance__ = object.__new__(cls)
> - cls.load(cls)
> + cls.__instance__ = super().__new__(cls)
> + cls.__instance__.load()
Tomas: In this case super() refers to object, as object is the super class
Tim:
"if not cls.__instance__:" is still in there, so the class is only instantiated once (I have tried with the print statement as you suggested too).
The only difference here is that we're calling load() on the instance, this is the correct way to do it as load is an instance method, not a class or static method, so passing cls to it is incorrect.
> return cls.__instance__
>
> def load(self):
>
> === modified file 'openlp/core/ui/icons.py'
> --- openlp/core/ui/icons.py 2019-04-13 13:00:22 +0000
> +++ openlp/core/ui/icons.py 2019-07-18 19:27:49 +0000
> @@ -45,8 +45,8 @@
> Override the default object creation method to return a single instance.
> """
> if not cls.__instance__:
> - cls.__instance__ = object.__new__(cls)
> - cls.load(cls)
> + cls.__instance__ = super().__new__(cls)
> + cls.__instance__.load()
> return cls.__instance__
same as above, tried with the print statement also....
>
> def load(self):
>
> === modified file 'openlp/core/widgets/views.py'
> --- openlp/core/widgets/views.py 2019-05-23 19:33:46 +0000
> +++ openlp/core/widgets/views.py 2019-07-18 19:27:49 +0000
> @@ -219,7 +219,7 @@
> slide_height = width // self.screen_ratio
> max_img_row_height = Settings().value('advanced/slide max height')
> if isinstance(max_img_row_height, int):
> - if max_img_row_height > 0 and slide_height > max_img_row_height:
> + if 0 < max_img_row_height < slide_height:
PyDev console: starting.
Python 3.7.3 (default, Apr 9 2019, 04:56:51)
[GCC 8.3.0] on linux
1 < 2 < 3
True
1 < 1 < 3
False
1 < 3 < 3
False
Also these particular changes were done automatically by pycharm, so shouldn't be human error in translating them...
> slide_height = max_img_row_height
> elif max_img_row_height < 0:
> # If auto setting, show that number of slides, or if the resulting slides too small, 100px.
--
https://code.launchpad.net/~phill-ridout/openlp/fixes-III/+merge/370337
Your team OpenLP Core is subscribed to branch lp:openlp.
References