|
From: <dwa...@us...> - 2009-05-15 08:17:14
|
Revision: 9738
http://zaf.svn.sourceforge.net/zaf/?rev=9738&view=rev
Author: dwaynebailey
Date: 2009-05-15 08:16:59 +0000 (Fri, 15 May 2009)
Log Message:
-----------
Properly convert all sre to re
Modified Paths:
--------------
trunk/locale/locale-escape
Modified: trunk/locale/locale-escape
===================================================================
--- trunk/locale/locale-escape 2009-05-15 08:13:32 UTC (rev 9737)
+++ trunk/locale/locale-escape 2009-05-15 08:16:59 UTC (rev 9738)
@@ -3,15 +3,15 @@
import sys
import re
-lc_identification = sre.compile("^LC_IDENTIFICATION")
-lc_end_identification = sre.compile("^END\s+?LC_IDENTIFICATION")
-lc_all = sre.compile("^LC_")
-lc_end_all= sre.compile("^END\s+?LC_")
-blank = sre.compile("^\s*$")
-string_segment = sre.compile('"\;"|"')
+lc_identification = re.compile("^LC_IDENTIFICATION")
+lc_end_identification = re.compile("^END\s+?LC_IDENTIFICATION")
+lc_all = re.compile("^LC_")
+lc_end_all= re.compile("^END\s+?LC_")
+blank = re.compile("^\s*$")
+string_segment = re.compile('"\;"|"')
-comment = sre.compile("^(%|#)")
-copy_entity = sre.compile("^copy")
+comment = re.compile("^(%|#)")
+copy_entity = re.compile("^copy")
isLC_IDENTIFICATION=False
process=False
@@ -42,18 +42,18 @@
if copy_entity.search(line):
print line,
continue
- if process and not blank.search(line) and not sre.match("^\w+?\s+?\d+?$", line):
+ if process and not blank.search(line) and not re.match("^\w+?\s+?\d+?$", line):
# Phew now we can encode
- for string in string_segment.split(sre.sub('^[^"]*?"', "", sre.sub('"[^"]*?$', "", sre.sub('/$|";/$', '"', line)))):
- string = sre.sub('\n', "", string)
+ for string in string_segment.split(re.sub('^[^"]*?"', "", re.sub('"[^"]*?$', "", re.sub('/$|";/$', '"', line)))):
+ string = re.sub('\n', "", string)
newstring = ""
if not blank.search(string):
newword = string
- for char in sre.sub("<U[\dA-F]{4,4}>", "", string):
+ for char in re.sub("<U[\dA-F]{4,4}>", "", string):
encode = "<U%04X>" % (ord(char))
- newword = sre.sub(char, encode, newword)
+ newword = re.sub(char, encode, newword)
newstring = newstring + newword
- line = sre.sub(string, newstring, line)
+ line = re.sub(string, newstring, line)
#print "'%s' %s\n%s\n" % (string, newstring, line)
print line,
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|