Back to index

moin  1.9.0~rc2
Functions | Variables
MoinMoin.i18n.tools.markup15to16 Namespace Reference

Functions

def run

Variables

string DOMAIN = "MoinMoin"

Function Documentation

Definition at line 11 of file markup15to16.py.

00011 
00012 def run():
00013     sys.path.insert(0, '../..')
00014 
00015     lang = sys.argv[1]
00016 
00017     f = codecs.open("%s.%s.po" % (lang, DOMAIN), "r", "utf-8")
00018     text = f.read()
00019     f.close()
00020 
00021     # replace [[Macro(...)]] by <<Macro(...)>>
00022     macro_rule = r"\[\[(?P<macro>.*?)\]\]"
00023     macro_repl = r"<<\g<macro>>>"
00024     macro_re = re.compile(macro_rule, re.U|re.M|re.S)
00025     text = macro_re.sub(macro_repl, text)
00026 
00027     #print repr(text)
00028 
00029     f = codecs.open("%s.%s.po" % (lang, DOMAIN), "w", "utf-8")
00030     f.write(text)
00031     f.close()


Variable Documentation

Definition at line 5 of file markup15to16.py.