Author: johannes
Date: 2007-12-07 07:13:32 -0600 (Fri, 07 Dec 2007)
New Revision: 9841
Modified:
trunk/gnue-common/setup.py
Log:
No need to build translations on sdist as it will done by the
release-script
Modified: trunk/gnue-common/setup.py
===================================================================
--- trunk/gnue-common/setup.py 2007-12-06 15:37:09 UTC (rev 9840)
+++ trunk/gnue-common/setup.py 2007-12-07 13:13:32 UTC (rev 9841)
@@ -86,73 +86,7 @@
strip_dirs = 1, # This is a number, not true/false
preserve_path = 1)]
-# -----------------------------------------------------------------------------
-# Build files to be distributed and installed:
-# Should generate the files that go in a distribution but aren't in SVN.
-# Gets called on sdist (always) and on build/install (only when run from SVN).
-# FIXME: Better to build files in target directory directly.
-# -----------------------------------------------------------------------------
-def build_files(action):
-
- if os.name == 'posix':
-
- # First check if we have everything installed we need to build the
- # distribution
-
- if os.path.isdir('po'):
- # xgettext
- if os.system("pygettext --version > /dev/null") != 0:
- log.fatal("Could not find 'pygettext'. Strange.")
- log.fatal("It should be included in the Python distribution.")
- sys.exit(1)
-
- # msgmerge
- if os.system("msgmerge --version > /dev/null") != 0:
- log.fatal("Could not find 'msgmerge'. Please install Gettext.")
- sys.exit(1)
-
- # msgfmt
- if os.system("msgfmt --version > /dev/null") != 0:
- log.fatal("Could not find 'msgfmt'. Please install Gettext.")
- sys.exit(1)
-
- # ---------------------------------------------------------------------
-
- # build translations
- if os.path.isdir('po'):
- log.info("building translations")
- if os.system("cd po && make gmo") != 0:
- sys.exit(1)
-
- else:
- # on non posix systems just run msgfmt on existing .po files
- if os.path.isdir('po'):
- # msgfmt.py
- argv0_path = os.path.dirname(os.path.abspath(sys.executable))
- sys.path.append(argv0_path + "\\tools\\i18n")
-
- msgfmtOK = 0
- try:
- import msgfmt
- msgfmtOK = 1
- except:
- pass
-
- if msgfmtOK == 1:
- # pygettext.py exist in Python, but no msgmerge, so
- # just create a placeholder...
- potfile = open('po/'+ PACKAGE.lower() +'.pot', 'w')
- potfile.write("#placeholder")
- potfile.close()
-
- # build translations
- log.info("building translations")
- for f in os.listdir('po'):
- if f[-3:] == '.po':
- msgfmt.make('po/'+f, 'po/'+f[:-3]+'.gmo')
- msgfmt.MESSAGES = {}
-
# -----------------------------------------------------------------------------
# Build the svnrev.py file.
# Gets called on sdist (always) and on build/install (only when run from SVN).
@@ -255,10 +189,6 @@
class sdist(distutils.command.sdist.sdist):
- def run(self):
- build_files('sdist')
- distutils.command.sdist.sdist.run(self)
-
def prune_file_list(self):
distutils.command.sdist.sdist.prune_file_list(self)
self.filelist.exclude_pattern('*.dist_template', anchor=0)
@@ -328,9 +258,7 @@
class build(distutils.command.build.build):
def run(self):
- # TODO: Some smarter way to generate files. Maybe build a sdist object?
- if not os.path.isfile("PKG-INFO"): # downloaded from SVN?
- build_files('build')
+
distutils.command.build.build.run(self)
if not os.path.isfile("PKG-INFO"):
build_svnrev(os.path.join(self.build_lib, 'gnue', 'common',
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.