Changeset 245


Ignore:
Timestamp:
Jan 12, 2011 1:56:54 PM (7 years ago)
Author:
mbutscher
Message:
  • Bug fixed: Autocompletion for anchors treated wiki links as wiki words (no relative or absolute paths supported)
  • Bug fixed: Indexing of updated pages was called directly in event handling instead of in the update thread
Location:
branches/mbutscher/work
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/mbutscher/work/extensions/wikidPadParser/WikidPadParser.py

    r231 r245  
    33
    44# Official parser plugin for wiki language "WikidPad default 2.0"
    5 # Last modified (format YYYY-MM-DD): 2010-12-25
     5# Last modified (format YYYY-MM-DD): 2011-01-12
    66
    77
     
    1313
    1414import re    # from pwiki.rtlibRepl import re
     15from pwiki.WikiExceptions import *
    1516from pwiki.StringOps import UPPERCASE, LOWERCASE, revStr
    1617from pwiki.WikiDocument import WikiDocument
     
    19821983            # In an anchor of a possible bracketed wiki word
    19831984            tofind = line[-mat.end():]
    1984             wikiWord = revStr(mat.group("wikiWord"))
     1985            wikiLinkCore = revStr(mat.group("wikiWord"))
     1986            wikiWord = _TheHelper.resolvePrefixSilenceAndWikiWordLink(
     1987                    wikiLinkCore, docPage)[2]
     1988
    19851989            anchorBegin = revStr(mat.group("anchorBegin"))
    19861990
     
    19911995
    19921996                for a in anchors:
    1993                     backStepMap[BracketStart + wikiWord +
     1997                    backStepMap[BracketStart + wikiLinkCore +
    19941998                            BracketEnd +
    19951999                            WikiWordAnchorStart + a] = len(tofind)
     
    20022006            # In an anchor of a possible camel case word
    20032007            tofind = line[-mat.end():]
    2004             wikiWord = revStr(mat.group("wikiWord"))
     2008            wikiLinkCore = revStr(mat.group("wikiWord"))
     2009            wikiWord = _TheHelper.resolvePrefixSilenceAndWikiWordLink(
     2010                    wikiLinkCore, docPage)[2]
     2011
    20052012            anchorBegin = revStr(mat.group("anchorBegin"))
    20062013
     
    20112018                       
    20122019                for a in anchors:
    2013                     backStepMap[wikiWord + WikiWordAnchorStart +
     2020                    backStepMap[wikiWord + wikiLinkCore +
    20142021                            a] = len(tofind)
    20152022            except WikiWordNotFoundException:
  • branches/mbutscher/work/lib/pwiki/DocPages.py

    r234 r245  
    15181518            threadstop=DUMBTHREADSTOP):
    15191519
     1520        # Step 1: Refresh attributes
    15201521        self.refreshAttributesFromPageAst(pageAst, threadstop=threadstop)
    15211522
     1523        # Some attributes control format details so check if attribute
     1524        # refresh changed the details
    15221525        formatDetails2 = self.getFormatDetails()
    15231526        if not formatDetails.isEquivTo(formatDetails2):
     
    15261529            return False
    15271530
    1528         return self.refreshMainDbCacheFromPageAst(pageAst, fireEvent=fireEvent,
     1531        # Step 2: Refresh todos, link structure ...
     1532        self.refreshMainDbCacheFromPageAst(pageAst, fireEvent=fireEvent,
    15291533                threadstop=threadstop)
     1534
     1535        # Step 3: Update index search data
     1536        self.putIntoSearchIndex(threadstop=threadstop)
     1537       
     1538        return True
     1539
    15301540
    15311541
     
    17401750        """
    17411751        with self.textOperationLock:
     1752            threadstop.testRunning()
     1753
    17421754            if not self.getWikiDocument().isSearchIndexEnabled():
    17431755                return True  # Or false?
     
    18161828            if step == -1:
    18171829                self._refreshMetaData(pageAst, formatDetails, threadstop=threadstop)
    1818    
     1830
    18191831                with self.textOperationLock:
    18201832                    if not liveTextPlaceHold is self.liveTextPlaceHold:
  • branches/mbutscher/work/lib/pwiki/wikidata/WikiDataManager.py

    r234 r245  
    16861686        It also automatically refreshes the index to the latest version if needed.
    16871687        """
    1688 #         print "--getSearchIndex1"
    16891688        if not self.isSearchIndexEnabled():
    16901689            return None
    1691 #         print "--getSearchIndex4"
    16921690       
    16931691        import whoosh.index, whoosh.writing
     
    20562054                attrs["wikiPage"] = miscevt.getSource()
    20572055                self.fireMiscEventProps(attrs)
    2058                 miscevt.getSource().putIntoSearchIndex()
     2056#                 miscevt.getSource().putIntoSearchIndex()
    20592057            elif miscevt.has_key("saving new wiki page"):           
    20602058                self.autoLinkRelaxInfo = None
    2061                 miscevt.getSource().putIntoSearchIndex()
     2059#                 miscevt.getSource().putIntoSearchIndex()
    20622060            elif miscevt.has_key("reread cc blacklist needed"):
    20632061                self._updateCcWordBlacklist()
Note: See TracChangeset for help on using the changeset viewer.