#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2008 - 2012 1&1 Internet AG, Germany, http://www.1und1.de # # License: # LGPL: http://www.gnu.org/licenses/lgpl.html # EPL: http://www.eclipse.org/org/documents/epl-v10.php # See the LICENSE file in the project's top-level directory for details. # # Authors: # * Thomas Herchenroeder (thron7) # ################################################################################ ## # This is a stub proxy for the real generator.py ## import sys, os, re, subprocess, codecs, optparse CMD_PYTHON = sys.executable QOOXDOO_PATH = 'source/qooxdoo-4.1-sdk' QX_PYLIB = "tool/pylib" ## # A derived OptionParser class that ignores unknown options (The parent # class raises in those cases, and stops further processing). # We need this, as we are only interested in -c/--config on this level, and # want to ignore pot. other options. # class IgnoringUnknownOptionParser(optparse.OptionParser): ## # is the raw argument list. The original _process_args mutates # rargs, processing options into and copying interspersed args # into . This overridden version ignores unknown or ambiguous # options. def _process_args(self, largs, rargs, values): while rargs: try: optparse.OptionParser._process_args(self, largs, rargs, values) except (optparse.BadOptionError, optparse.AmbiguousOptionError): pass def parseArgs(): parser = IgnoringUnknownOptionParser(add_help_option=False) parser.add_option( "-c", "--config", dest="config", metavar="CFGFILE", default="config.json", help="path to configuration file" ) parser.add_option( "-v", "--verbose", dest="verbose", action="store_true", default=False, help="run in verbose mode" ) (options, args) = parser.parse_args(sys.argv[1:]) return options, args ShellOptions, ShellArgs = parseArgs() # this is from misc.json, duplicated for decoupling _eolComment = re.compile(r'(?-1: argList1.append('"%s"' % arg) else: argList1.append(arg) argList = argList1 else: argList = ['"%s"' % x for x in argList] # quote argv elements cmd = " ".join(argList) retval = subprocess.call(cmd, shell=True) sys.exit(retval)