Re: [orca-list] code review



Joanmarie,
That sounds great, do you have a git repo I can review?

Here is an example of what I am thinking about :
https://github.com/h4ck3rm1k3/orca/commit/5435727cd06a721201d7451dd98ae50e1451c2f6

basically you have a single formatting class for a format and a event :
from orca.formatting.braille.animation import AnimationBrailleAction

https://github.com/h4ck3rm1k3/orca/blob/5435727cd06a721201d7451dd98ae50e1451c2f6/src/orca/formatting/braille/animation.py

On Mon, Dec 23, 2013 at 4:13 PM, Joanmarie Diggs <jdiggs igalia com> wrote:
For what it's worth, the formatting strings are a mess that are
difficult for sighted users. :) Object presentation will be redone as
part of the performance work I am doing and the formatting code will be
going away by side effect.

--joanie (Orca maintainer)

On 12/23/2013 04:49 PM, Mike Dupont wrote:
On Mon, Dec 23, 2013 at 1:52 PM, Alex Midence <alex midence gmail com> wrote:
Symon
Link?

I just got off the phone with Johnathan,
the first step I think for orca is to strip out all complex formatting
code and push it out.
We need to make it into something that can be edited by blind people.

take a look at this :
https://github.com/h4ck3rm1k3/orca/blob/f79656250c6946e3bfd2e9184467ac97a84f5b40/src/orca/formatting_braille_eval.py

it represents a closed world representation of the braille formatting,
each function represents one of the nested ifs:

def action_3_unfocused ():
        return [Component(obj,asString(label + displayedText +
roleName + (description and space(": ") + description)))]

It should look more like :

class SomeAction(SomeBraileAction) :
    def unfocused():
        return [
             Component(obj,asString(label + displayedText + roleName +
(description and space(": ") + description)))
       ]


What if we moved the format strings into a jinja2 template system?
http://jinja.pocoo.org/docs/
Even better it could be a template like :

{{label}} {{displayedText}} {{roleName}} {{description}}  {{space(":
")}} {{description}}

but i am not exactly sure how that would work yet, but the idea would
be move all the formatting out into a domain specific language that
can be edited in small specific files by disabled people and not some
bloated huge nested dict.

mike








-- 
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]