[Zope-Checkins] CVS: Zope/lib/python/StructuredText - DocumentClass.py:1.54 DocumentWithImages.py:1.10 ST.py:1.21

Andreas Jung andreas@andreas-jung.com
Sun, 25 May 2003 16:40:40 -0400


Update of /cvs-repository/Zope/lib/python/StructuredText
In directory cvs.zope.org:/tmp/cvs-serv10443/StructuredText

Modified Files:
	DocumentClass.py DocumentWithImages.py ST.py 
Log Message:
reverted checkin of STX i18n patch. This should have gone to a private
branch *damn CVS*


=== Zope/lib/python/StructuredText/DocumentClass.py 1.53 => 1.54 ===
--- Zope/lib/python/StructuredText/DocumentClass.py:1.53	Sun May 25 16:00:37 2003
+++ Zope/lib/python/StructuredText/DocumentClass.py	Sun May 25 16:40:10 2003
@@ -304,7 +304,7 @@
         'doc_xref',
         ]
 
-    def __call__(self, doc): 
+    def __call__(self, doc):
         if type(doc) in StringTypes:
             doc=ST.StructuredText(doc)
             doc.setSubparagraphs(self.color_paragraphs(
@@ -786,7 +786,7 @@
 
     def doc_literal(
         self, s,
-        expr = re.compile(r"(\W+|^)'((?:\w|[%s%s\s])+)'([%s]+|$)" % (digits, literal_punc, phrase_delimiters), re.U).search,):
+        expr = re.compile(r"(\W+|^)'([%s%s%s\s]+)'([%s]+|$)" % (letters, digits, literal_punc, phrase_delimiters)).search,):
 
         # old expr... failed to cross newlines.
         #        expr=re.compile(
@@ -804,9 +804,7 @@
 
     def doc_emphasize(
         self, s,
-        # i18nal variant
-        expr = re.compile(r'\*((?:\w|[%s\s])+?)\*' % (strongem_punc), re.U).search
-        #expr = re.compile(r'\*([%s%s%s\s]+?)\*' % (letters, digits, strongem_punc)).search
+        expr = re.compile(r'\*([%s%s%s\s]+?)\*' % (letters, digits, strongem_punc)).search
         #expr = re.compile(r'\s*\*([ \n\r%s0-9.:/;,\'\"\?\-\_\/\=\-\>\<\(\)]+)\*(?!\*|-)' % letters).search       # old expr, inconsistent punctuation
         ):
 
@@ -852,7 +850,7 @@
 
     def doc_underline(self,
                       s,
-                      expr=re.compile(r'_((?:\w|[%s\s])+)_([\s%s]|$)' % (under_punc,phrase_delimiters), re.U).search):
+                      expr=re.compile(r'_([%s%s%s\s]+)_([\s%s]|$)' % (letters, digits, under_punc,phrase_delimiters)).search):
 
         result = expr(s)
         if result:
@@ -866,7 +864,7 @@
 
     def doc_strong(self,
                    s,
-                   expr = re.compile(r'\*\*((?:\w|[%s%s\s])+?)\*\*' % (digits, strongem_punc), re.U).search
+                   expr = re.compile(r'\*\*([%s%s%s\s]+?)\*\*' % (letters, digits, strongem_punc)).search
                    #expr = re.compile(r'\s*\*\*([ \n\r%s0-9.:/;,\'\"\?\-\_\/\=\-\>\<\(\)]+)\*\*(?!\*|-)' % letters).search, # old expr, inconsistent punc, failed to cross newlines.
         ):
 
@@ -878,7 +876,7 @@
             return None
 
     ## Some constants to make the doc_href() regex easier to read.
-    _DQUOTEDTEXT = r'("(?:\w|[ 0-9\n\r%s])+")' % (dbl_quoted_punc) ## double quoted text
+    _DQUOTEDTEXT = r'("[ %s0-9\n\r%s]+")' % (letters,dbl_quoted_punc) ## double quoted text
     _ABSOLUTE_URL=r'((http|https|ftp|mailto|file|about)[:/]+?[%s0-9_\@\.\,\?\!\/\:\;\-\#\~\=\&\%%\+]+)' % letters
     _ABS_AND_RELATIVE_URL=r'([%s0-9_\@\.\,\?\!\/\:\;\-\#\~\=\&\%%\+]+)' % letters
 
@@ -886,12 +884,12 @@
 
 
     def doc_href1(self, s,
-                  expr=re.compile(_DQUOTEDTEXT + "(:)" + _ABS_AND_RELATIVE_URL + _SPACES, re.U).search
+                  expr=re.compile(_DQUOTEDTEXT + "(:)" + _ABS_AND_RELATIVE_URL + _SPACES).search
                    ):
         return self.doc_href(s, expr)
 
     def doc_href2(self, s,
-                  expr=re.compile(_DQUOTEDTEXT + r'(\,\s+)' + _ABSOLUTE_URL + _SPACES, re.U).search
+                  expr=re.compile(_DQUOTEDTEXT + r'(\,\s+)' + _ABSOLUTE_URL + _SPACES).search
                    ):
         return self.doc_href(s, expr)
 


=== Zope/lib/python/StructuredText/DocumentWithImages.py 1.9 => 1.10 ===
--- Zope/lib/python/StructuredText/DocumentWithImages.py:1.9	Sun May 25 16:00:37 2003
+++ Zope/lib/python/StructuredText/DocumentWithImages.py	Sun May 25 16:40:10 2003
@@ -30,12 +30,12 @@
 
     def doc_img(
         self, s,
-        expr1=re.compile('\"((?:\w|[ *.:/;,\-\n\~])+)\":img:([a-zA-Z0-9\_\-.:/;,\n\~]+)', re.U).search,
-        expr2=re.compile('\"((?:\w|[ *.:/;,\-\n\~])+)\":img:([a-zA-Z0-9\_\-.:/;,\n\~]+):([a-zA-Z0-9_\-.:/;,\n\~]+)', re.U).search
+        expr1=re.compile('\"([ _a-zA-Z0-9*.:/;,\-\n\~]+)\":img:([a-zA-Z0-9\_\-.:/;,\n\~]+)').search,
+        expr2=re.compile('\"([ _a-zA-Z0-9*.:/;,\-\n\~]+)\":img:([a-zA-Z0-9\_\-.:/;,\n\~]+):([a-zA-Z0-9_\-.:/;,\n\~]+)').search
         ):
+
         r = expr2(s)
         if r:
-
 
             # Warning: the regex are getting confused when the string after :img:
             # is an URL containing ":" (Collector #2276)


=== Zope/lib/python/StructuredText/ST.py 1.20 => 1.21 ===
--- Zope/lib/python/StructuredText/ST.py:1.20	Sun May 25 16:00:37 2003
+++ Zope/lib/python/StructuredText/ST.py	Sun May 25 16:40:10 2003
@@ -115,9 +115,6 @@
     which mimics the structure of the paragraphs.
     Structure => [paragraph,[sub-paragraphs]]
     """
-    if type(paragraphs) == type(''):
-        paragraphs = unicode(paragraphs, 'utf-8')
-
 
     currentlevel    = 0
     currentindent  = 0