Re: [orca-list] code review
- From: Mike Dupont <jamesmikedupont googlemail com>
- To: Joanmarie Diggs <jdiggs igalia com>
- Cc: orca-list gnome org
- Subject: Re: [orca-list] code review
- Date: Mon, 23 Dec 2013 17:50:21 -0600
this is what I meant :
https://github.com/h4ck3rm1k3/orca/blob/f79656250c6946e3bfd2e9184467ac97a84f5b40/src/orca/formatting_braille_eval.py#L15
def __add__(self, other):
if isinstance(other, self.__class__):
return self
elif isinstance(other, str):
return self
else:
raise TypeError("unsupported operand type(s)
for +: '{}' and '{}'").format(self.__class__, type(other))
this could be broken down much more fine tuned.
On Mon, Dec 23, 2013 at 5:46 PM, Mike Dupont
<jamesmikedupont googlemail com> wrote:
On Mon, Dec 23, 2013 at 5:05 PM, Joanmarie Diggs <jdiggs igalia com> wrote:
* "gluing" together of strings can result in bogus localization
* "gluing" together of different strings seems to be responsible for
some braille related bugs (ordering of elements, cursor routing)
So the solution, aside from making this "something anyone can edit"
needs to also take into account (and resolve) the above problems.
Formatting strings was a good idea in theory, but not in practice....
If you look at the second to last code, you can override the plus
operator and use strong typing.
so each string is typed and is not a string but an object instance,
then we can use rules to bind them together, compare the localization
etc. I dont know all the voodoo here, but we can work something out.
--
James Michael DuPont
Member of Free Libre Open Source Software Kosova http://www.flossk.org
Saving Wikipedia(tm) articles from deletion http://SpeedyDeletion.wikia.com
Mozilla Rep https://reps.mozilla.org/u/h4ck3rm1k3
--
James Michael DuPont
Member of Free Libre Open Source Software Kosova http://www.flossk.org
Saving Wikipedia(tm) articles from deletion http://SpeedyDeletion.wikia.com
Mozilla Rep https://reps.mozilla.org/u/h4ck3rm1k3
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]