Back to index

plone3  3.1.7
Functions | Variables
convertToLocales Namespace Reference

Functions

def getLocalsPath
def svnAdd

Variables

tuple RE_DOMAIN = re.compile(r"\"Domain: ?([a-zA-Z-_]*)\\n\"")
tuple RE_LANGUAGE = re.compile(r"\"Language-[cC]ode: ?([a-zA-Z-_]*)\\n\"")
string base = '.'
tuple i18n = os.path.join(base, 'i18n')
tuple locales = os.path.join(base, 'locales')
tuple po_files = glob.glob(os.path.join(i18n, '*.po'))
tuple pot_files = glob.glob(os.path.join(i18n, '*.pot'))
tuple fd = open(po, 'r')
tuple header = fd.read(5000)
tuple domain = RE_DOMAIN.findall(header)
tuple lang = RE_LANGUAGE.findall(header)
 src = po
tuple dst = os.path.join(po_path, new_po)

Function Documentation

def convertToLocales.getLocalsPath (   lang,
  domain 
)

Definition at line 21 of file convertToLocales.py.

00021 
00022 def getLocalsPath(lang, domain):
00023     po = '%s.po' % domain
00024     path = os.path.join(locales, lang, 'LC_MESSAGES')
00025     return path, po

def convertToLocales.svnAdd (   path)

Definition at line 26 of file convertToLocales.py.

00026 
00027 def svnAdd(path):
00028     path = path.split(os.sep)
00029     for l in range(len(path)):
00030         l+=1
00031         p = os.path.join(*path[:l])
00032         if not os.path.isdir(os.path.join(p, '.svn')):
00033             os.system("svn add %s" % p)


Variable Documentation

string convertToLocales.base = '.'

Definition at line 15 of file convertToLocales.py.

list convertToLocales.domain = RE_DOMAIN.findall(header)

Definition at line 39 of file convertToLocales.py.

tuple convertToLocales.dst = os.path.join(po_path, new_po)

Definition at line 53 of file convertToLocales.py.

tuple convertToLocales.fd = open(po, 'r')

Definition at line 35 of file convertToLocales.py.

tuple convertToLocales.header = fd.read(5000)

Definition at line 36 of file convertToLocales.py.

tuple convertToLocales.i18n = os.path.join(base, 'i18n')

Definition at line 16 of file convertToLocales.py.

list convertToLocales.lang = RE_LANGUAGE.findall(header)

Definition at line 40 of file convertToLocales.py.

tuple convertToLocales.locales = os.path.join(base, 'locales')

Definition at line 17 of file convertToLocales.py.

tuple convertToLocales.po_files = glob.glob(os.path.join(i18n, '*.po'))

Definition at line 18 of file convertToLocales.py.

tuple convertToLocales.pot_files = glob.glob(os.path.join(i18n, '*.pot'))

Definition at line 19 of file convertToLocales.py.

tuple convertToLocales.RE_DOMAIN = re.compile(r"\"Domain: ?([a-zA-Z-_]*)\\n\"")

Definition at line 12 of file convertToLocales.py.

tuple convertToLocales.RE_LANGUAGE = re.compile(r"\"Language-[cC]ode: ?([a-zA-Z-_]*)\\n\"")

Definition at line 13 of file convertToLocales.py.

Definition at line 52 of file convertToLocales.py.