Back to index

plone3  3.1.7
Functions
setdomain Namespace Reference

Functions

def main

Detailed Description

   Usage: setdomain.py <product> <domain>

Function Documentation

def setdomain.main ( )

Definition at line 12 of file setdomain.py.

00012 
00013 def main():
00014     if len(sys.argv) < 3:
00015         print 'You have to specify the product and the new text for domain.'
00016         sys.exit(1)
00017 
00018     product = getLongProductName(sys.argv[1])
00019     domain = sys.argv[2]
00020 
00021     os.chdir('..')
00022     os.chdir('i18n')
00023 
00024     poFiles = getPoFiles(product, all=True)
00025     if poFiles == []:
00026         print 'No po-files were found for the given product.'
00027         sys.exit(2)
00028 
00029     for poFile in poFiles:
00030         try:
00031             po_ctl = catalog.MessageCatalog(filename=poFile)
00032         except IOError, e:
00033             print >> sys.stderr, 'I/O Error: %s' % e
00034         po_ctl.mime_header['Domain'] = domain
00035         file = open(poFile, 'w')
00036         writer = catalog.POWriter(file, po_ctl)
00037         writer.write(sort=False)

Here is the call graph for this function: