Grammalecte  Check-in [cdb1937a91]

Overview
Comment:[core][py] gc engine: no color by default (type is not certain)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | core
Files: files | file ages | folders
SHA3-256: cdb1937a91061044fe4f6af75bf5e83dbdd7bb82e6eb775251e814f86fbccbff
User & Date: olr on 2018-09-25 15:51:03
Original Comment: [core][py] gc engine: pas de couleurs par défaut (le type n’étant pas certain)
Other Links: manifest | tags
Context
2018-09-25
16:06
[core][fx][tb][js] use colors defined by the rules file (+bugs fixed) check-in: 05735bba7b user: olr tags: trunk, core, tb, fx
15:51
[core][py] gc engine: no color by default (type is not certain) check-in: cdb1937a91 user: olr tags: trunk, core
15:49
[fr] couleurs par défaut + options manquantes sur certaines règles check-in: 757f44a2f3 user: olr tags: trunk, fr
Changes

Modified gc_core/py/lang_core/gc_engine.py from [10f4857be2] to [c275dc26cb].

660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
    def _createErrorAsDict (self, nStart, nEnd, sLineId, sRuleId, sOption, sMessage, lSugg, sURL, bContext):
        dErr = {
            "nStart": nStart,
            "nEnd": nEnd,
            "sLineId": sLineId,
            "sRuleId": sRuleId,
            "sType": sOption  if sOption  else "notype",
            "aColor": _dOptionsColors.get(sOption, [100, 100, 255]),
            "sMessage": sMessage,
            "aSuggestions": lSugg,
            "URL": sURL
        }
        if bContext:
            dErr['sUnderlined'] = self.sText0[nStart:nEnd]
            dErr['sBefore'] = self.sText0[max(0,nStart-80):nStart]







|







660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
    def _createErrorAsDict (self, nStart, nEnd, sLineId, sRuleId, sOption, sMessage, lSugg, sURL, bContext):
        dErr = {
            "nStart": nStart,
            "nEnd": nEnd,
            "sLineId": sLineId,
            "sRuleId": sRuleId,
            "sType": sOption  if sOption  else "notype",
            "aColor": _dOptionsColors.get(sOption, None),
            "sMessage": sMessage,
            "aSuggestions": lSugg,
            "URL": sURL
        }
        if bContext:
            dErr['sUnderlined'] = self.sText0[nStart:nEnd]
            dErr['sBefore'] = self.sText0[max(0,nStart-80):nStart]