1
# Copyright 2007 Joe Wreschnig
3
# This software and accompanying documentation, if any, may be freely
4
# used, distributed, and/or modified, in any form and for any purpose,
5
# as long as this notice is preserved. There is no warranty, either
6
# express or implied, for this software.
8
"""core support for gdist packages
10
This module exists to avoid circular imports within gdist.
15
from distutils.core import Command
17
class GCommand(Command):
18
"""An abstract base class for commands in gdist"""
22
def initialize_options(self):
25
def finalize_options(self):
26
self.po_directory = self.distribution.po_directory
28
def capture(self, args):
29
write, read = os.popen2(args, mode="r")
33
"""Exit if translation is needed and not available"""
34
if not (self.po_directory and os.path.isdir(self.po_directory)):
35
raise SystemExit("PO directory %r not found." % self.po_directory)
37
__all__ = ["GCommand"]