Add an optional parameter to domo for installing into directories other than /usr/share/locale

This commit is contained in:
Ozan Çağlayan
2009-07-01 07:42:48 +00:00
parent f155f85051
commit 2e77f4185e
+3 -3
View File
@@ -146,14 +146,14 @@ def doman(*sourceFiles):
else:
uncompress(compressed, targetDir=manPDIR)
def domo(sourceFile, locale, destinationFile ):
def domo(sourceFile, locale, destinationFile, localeDirPrefix = '/usr/share/locale'):
'''inserts the mo files in the list of files into /usr/share/locale/LOCALE/LC_MESSAGES'''
'''example call: pisitools.domo("po/tr.po", "tr", "pam_login.mo")'''
system('msgfmt %s' % sourceFile)
makedirs('%s/usr/share/locale/%s/LC_MESSAGES/' % (get.installDIR(), locale))
move('messages.mo', '%s/usr/share/locale/%s/LC_MESSAGES/%s' % (get.installDIR(), locale, destinationFile))
makedirs('%s%s/%s/LC_MESSAGES/' % (get.installDIR(), localeDirPrefix, locale))
move('messages.mo', '%s%s/%s/LC_MESSAGES/%s' % (get.installDIR(), localeDirPrefix, locale, destinationFile))
def domove(sourceFile, destination, destinationFile = ''):
'''moves sourceFile/Directory into destinationFile/Directory'''