[script nvda] Re: docString

  • From: "cyrille.bougot2" <dmarc-noreply@xxxxxxxxxxxxx> ("cyrille.bougot2")
  • To: script NVDA <scriptnvda@xxxxxxxxxxxxx>
  • Date: Fri, 29 Apr 2022 16:46:41 +0200 (CEST)

Bonjour,

Pour une réponse simpliste concernant la syntaxe:
Si tu connais le Python et que tu sais écrire des docstrings pour Python, tu 
sais écrire des docstrings pour NVDA.

Après, si ta question concerne plutôt le contenu des docstrings:
* Voir le Guide de développement de NVDA en espérant qu'il soit à jour sur ce 
point.
* Voir comment c'est fait dans du code récemment intégré

Par exemple une fonction que j'ai intégrée l'année dernière (et qui donc a été 
revue):
def _getSpellingCharAddCapNotification(
        speakCharAs: str,
        sayCapForCapitals: bool,
        capPitchChange: int,
        beepForCapitals: bool,
) -> Generator[SequenceItemT, None, None]:
    """This function produces a speech sequence containing a character to be 
spelt as well as commands
    to indicate that this character is uppercase if applicable.
    @param speakCharAs: The character as it will be spoken by the synthesizer.
    @param sayCapForCapitals: indicates if 'cap' should be reported along with 
the currently spelt character.
    @param capPitchChange: pitch offset to apply while spelling the currently 
spelt character.
    @param beepForCapitals: indicates if a cap notification beep should be 
produced while spelling the currently
    spellt character.
    """


Si tu as d'autres questions, précise.

A+

Cyrille

 
 

De : "yannick"
A : scriptnvda@xxxxxxxxxxxxx
Envoyé: jeudi 28 Avril 2022 23:05
Objet : [script nvda] docString
 
bonjour ou pourrais je trouver des explications sur la manière d'écrire
des docString pour nvda ?

merci !

 

Other related posts: