Changeset 116

Show
Ignore:
Timestamp:
Sat Apr 28 13:26:53 2007
Author:
mbutscher
Message:

* Bug fixed: Preview didn't work with titled wikiwords
* Bug fixed: When renaming wikiword with non-ascii characters

and modifying links, non-ascii characters were preceded
with backslashes

Files:

Legend:

Unmodified
Added
Removed
Modified
  • branches/mbutscher/work/WikidPadStarter.py

    r115 r116  
    4 4 os.stat_float_times(True)  
    5 5  
    6   VERSION_STRING = "wikidPad 1.9beta4"  
      6 VERSION_STRING = "wikidPad 1.9beta5"  
    6 6  
    7 7 if not hasattr(sys, 'frozen'):  
  • branches/mbutscher/work/wikidpad_unicode.iss

    r115 r116  
    39 39 SolidCompression=true  
    40 40 AppName=WikidPad  
    41   AppVerName=WikidPad 1.9beta4  
      41 AppVerName=WikidPad 1.9beta5  
    41 41 DefaultDirName={pf}\WikidPad  
    42 42 DefaultGroupName=WikidPad  
    43 43 AppID={{22A83C29-58A8-4CAB-8EDC-918D74F8429E}  
    44 44 VersionInfoVersion=1.9  
    45   VersionInfoTextVersion=WikidPad 1.9beta4  
      45 VersionInfoTextVersion=WikidPad 1.9beta5  
    45 45 LicenseFile=C:\DATEN\Projekte\Wikidpad\Current\license.txt  
    46 46 AllowNoIcons=true  
    47 47 ShowLanguageDialog=yes  
    48 48 Compression=lzma/ultra  
    49   OutputBaseFilename=WikidPad-1.9beta4  
      49 OutputBaseFilename=WikidPad-1.9beta5  
    49 49 InternalCompressLevel=ultra  
    50 50 AppCopyright=© 2005-2007 Jason Horman, Michael Butscher, Gerhard Reitmayr  
  • branches/mbutscher/work/WikidPadHelp/data/OptionsDialog.wiki

    r115 r116  
    211 211 Wiki word which should be shown as first one each time the wiki is opened. If the field is empty, the last words when the wiki was closed is shown on opening.  
    212 212  
    213   *New page title prefix*  
    214   Control the heading level of the initial main title of new pages and fill between one and four '+' in this field. Default is "++".  
    215    
    216 213 *Default export dir.*  
    217 214 Set the default export directory into which exports should go.  
    218 215  
      216 *Title prefix*  
      217 Control the heading level of the initial main title of new pages and fill between one and four '+' in this field. Default is "++".  
      218  
      219 *Wikiword to title*  
      220 How should the main title of new pages be generated from the wikiword:  
      221     * As is: Use wikiword as title  
      222     * Add spaces: Add spaces to wikiword in front of each uppercase letter ("NewWikiWord" -> "New Wiki Word")  
      223  
      224 *Use link title if present*  
      225 If you came to a not yet created page through a titled link (e.g. [WikiWord| This is the title]) and this option is checked, the link title will be used as title of the page.  
    219 226  
    220 227 *Modif. date must match*  
  • branches/mbutscher/work/WikidPadHelp/data/ChangeLog.wiki

    r115 r116  
    2 2  
    3 3  
    4   Apr. 27, 2007 (1.9beta4)  
      4 Apr. 28, 2007 (1.9beta5)  
      5  
      6     * Bug fixed: Preview didn't work with titled wikiwords  
      7     * Bug fixed: When renaming wikiword with non-ascii characters  
      8       and modifying links, non-ascii characters were preceded with  
      9       backslashes  
      10  
      11  
      12  
      13 Apr. 27, 2007 (1.9beta4, repository revision in "mbutscher" branch: 114)  
    5 14  
    6 15     * Clicking on footnotes moves to the last footnote on page  
  • branches/mbutscher/work/lib/pwiki/Exporters.py

    r115 r116  
    1138 1138  
    1139 1139                         self.outAppend(u'<td valign="top">')  
    1140                           self._processWikiWord(word, wwNode)  
      1140                         self._processWikiWord(word, wwNode, None)  
    1140 1140                         self.outAppend(u'</td>')  
    1141 1141                          
     
    1168 1168  
    1169 1169                         self.outAppend(u'<td valign="top">')  
    1170                           self._processWikiWord(word, wwNode)  
      1170                         self._processWikiWord(word, wwNode, None)  
    1170 1170                         self.outAppend(u'</td>')  
    1171 1171                          
     
    1191 1191              
    1192 1192              
    1193       def _processWikiWord(self, tokenText, astNode):  
      1193     def _processWikiWord(self, tokenText, astNode, fullContent):  
    1193 1193         word = astNode.nakedWord  
    1194 1194         link = self.links.get(word)  
     
    1223 1223                         escapeHtml(link))  
    1224 1224                 if astNode.titleTokens is not None:  
    1225                       self.processTokens(content, astNode.titleTokens)  
      1225                     self.processTokens(fullContent, astNode.titleTokens)  
    1225 1225                 else:  
    1226 1226                     self.outAppend(escapeHtml(word))                         
     
    1229 1229         else:  
    1230 1230             if astNode.titleTokens is not None:  
    1231                   self.processTokens(content, astNode.titleTokens)  
      1231                 self.processTokens(fullContent, astNode.titleTokens)  
    1231 1231             else:  
    1232 1232                 self.outAppend(escapeHtml(tokenText))                         
     
    1645 1645  
    1646 1646             elif styleno == WikiFormatting.FormatTypes.WikiWord:  
    1647                   self._processWikiWord(tok.text, tok.node)  
      1647                 self._processWikiWord(tok.text, tok.node, content)  
    1647 1647 #                 word = tok.node.nakedWord  
    1648 1648 #                 link = self.links.get(word)  
     
    1987 1987         """  
    1988 1988         searchOp = SearchReplaceOperation()  
    1989           searchOp.searchStr = u"^" + re.escape(sep) + u"$"  
      1989         searchOp.searchStr = u"^" + re_escape_uni(sep) + u"$"  
    1989 1989         searchOp.booleanOp = False  
    1990 1990         searchOp.caseSensitive = True  
  • branches/mbutscher/work/lib/pwiki/wikidata/WikiDataManager.py

    r115 r116  
    10 10  
    11 11 from pwiki.WikiExceptions import *  
    12   from pwiki.StringOps import mbcsDec  
      12 from pwiki.StringOps import mbcsDec, re_escape_uni  
    12 12 from pwiki.DocPages import WikiPage, FunctionalPage, AliasWikiPage  
    13 13  
     
    669 669             sarOp.wildCard = 'regex'  
    670 670             sarOp.caseSensitive = True  
    671               sarOp.searchStr = ur"\b" + re.escape(wikiWord) + ur"\b"  
      671             sarOp.searchStr = ur"\b" + re_escape_uni(wikiWord) + ur"\b"  
    671 671              
    672 672             for resultWord in self.searchWiki(sarOp):  
     
    677 677                     continue  
    678 678  
    679                   sarOp.replaceStr = re.escape(toWikiWord)  
      679                 sarOp.replaceStr = re_escape_uni(toWikiWord)  
    679 679                 sarOp.replaceOp = True  
    680 680                 sarOp.cycleToStart = False  
  • branches/mbutscher/work/lib/pwiki/SearchAndReplace.py

    r115 r116  
    10 10  
    11 11 from StringOps import utf8Enc, utf8Dec, boolToChar, charToBool, strToBin, \  
    12           binToStr  
      12         binToStr, re_escape_uni  
    12 12          
    13 13  
     
    935 935         else:  
    936 936             if self.wildCard == 'no':  
    937                   searchStr = re.escape(searchStr)  
      937                 searchStr = re_escape_uni(searchStr)  
    937 937  
    938 938             if self.wholeWord:  
  • branches/mbutscher/work/lib/pwiki/StringOps.py

    r112 r116  
    22 22 import srePersistent as _re  
    23 23  
    24   LINEEND_SPLIT_RE = _re.compile(r"\r\n?|\n")  
      24 LINEEND_SPLIT_RE = _re.compile(r"\r\n?|\n", _re.UNICODE)  
    24 24  
    25 25  
     
    313 313             replace("\r", "\\r")  
    314 314  
      315  
      316 ALPHANUM_RE = _re.compile(u"\w", _re.UNICODE)  
      317  
      318 def re_escape_uni(pattern):  
      319     """  
      320     Escape all non-alphanumeric characters in pattern.  
      321     Fixed version of re.escape for unicode characters  
      322     """  
      323     s = list(pattern)  
      324     for i in range(len(pattern)):  
      325         c = pattern[i]  
      326         if not ALPHANUM_RE.match(c):  
      327             if c == "\000":  
      328                 s[i] = "\\000"  
      329             else:  
      330                 s[i] = "\\" + c  
      331     return u"".join(s)  
      332  
      333  
    315 334 def unescapeWithRe(text):  
    316 335     """  
     
    340 359     """  
    341 360     return "#%02X%02X%02X" % (r, g, b)  
    342        
      361  
      362  
      363 def b64Cutter(s):  
      364     """  
      365     Cut a sequence of base64 characters into chunks of 70 characters  
      366     and join them with newlines. Pythons base64 decoder can read this.  
      367     """  
      368     result = []  
      369     while len(s) > 70:  
      370         result.append(s[:70])  
      371         s = s[70:]  
      372  
      373     if len(s) > 0:  
      374         result.append(s)  
      375  
      376     return "\n".join(result)  
      377  
      378  
    343 379      
    344 380 def splitpath(path):