def main(): parser = optparse.OptionParser() parser.set_usage('''\ %prog --name APPLICATIONNAME [--out DIRECTORY] [--namespace NAMESPACE] [-logfile LOGFILE] [--skeleton-path PATH] Script to create a new qooxdoo application. Example: For creating a regular GUI application \'myapp\' you could execute: %prog --name myapp''') parser.add_option( "-n", "--name", dest="name", metavar="APPLICATIONNAME", help="Name of the application. An application folder with identical name will be created. (Required)" ) parser.add_option( "-o", "--out", dest="out", metavar="DIRECTORY", default=".", help="Output directory for the application folder. (Default: %default)" ) parser.add_option( "-s", "--namespace", dest="namespace", metavar="NAMESPACE", default=None, help="Applications's top-level namespace. (Default: APPLICATIONNAME)" ) parser.add_option( "-l", "--logfile", dest="logfile", metavar="LOGFILE", default=None, type="string", help="Log file" ) parser.add_option( "-p", "--skeleton-path", dest="skeleton_path", metavar="PATH", default=SKELETON_DIR, help="(Advanced) Path where the script looks for skeletons. " + "The directory must contain sub directories named by " + "the application types. (Default: %default)" ) (options, args) = parser.parse_args(sys.argv[1:]) if not options.name: parser.print_help() sys.exit(1) else: options.name = options.name.decode('utf-8') # Initialize console global console console = Log(options.logfile, "info") checkNamespace(options) getQxVersion() outDir = createApplication(options) runNpmIf(outDir, options) console.log("DONE") return
def main(): parser = optparse.OptionParser() parser.set_usage('''\ %prog --name APPLICATIONNAME [--out DIRECTORY] [--namespace NAMESPACE] [--type TYPE] [-logfile LOGFILE] [--skeleton-path PATH] Script to create a new qooxdoo application. Example: For creating a regular GUI application \'myapp\' you could execute: %prog --name myapp''') parser.add_option( "-n", "--name", dest="name", metavar="APPLICATIONNAME", help="Name of the application. An application folder with identical name will be created. (Required)" ) parser.add_option( "-o", "--out", dest="out", metavar="DIRECTORY", default=".", help="Output directory for the application folder. (Default: %default)" ) parser.add_option( "-s", "--namespace", dest="namespace", metavar="NAMESPACE", default=None, help="Applications's top-level namespace. (Default: APPLICATIONNAME)" ) parser.add_option( "-t", "--type", dest="type", metavar="TYPE", default="desktop", help=skeletonsHelpString() ) parser.add_option( "-l", "--logfile", dest="logfile", metavar="LOGFILE", default=None, type="string", help="Log file" ) parser.add_option( "-p", "--skeleton-path", dest="skeleton_path", metavar="PATH", default=SKELETON_DIR, help="(Advanced) Path where the script looks for skeletons. " + "The directory must contain sub directories named by " + "the application types. (Default: %default)" ) parser.add_option( "--cache", dest="cache", metavar="PATH", default="${TMPDIR}/qx${QOOXDOO_VERSION}/cache", help="Path to the cache directory; will be entered into config.json's CACHE macro (Default: %default)" ) (options, args) = parser.parse_args(sys.argv[1:]) if not options.name: parser.print_help() sys.exit(1) else: options.name = options.name.decode('utf-8') # Initialize console global console console = Log(options.logfile, "info") checkNamespace(options) getQxVersion() outDir = createApplication(options) npm_install(outDir, options) console.log("DONE")
def main(): parser = optparse.OptionParser() parser.set_usage('''\ %prog --name APPLICATIONNAME [--out DIRECTORY] [--namespace NAMESPACE] [--type TYPE] [-logfile LOGFILE] [--skeleton-path PATH] Script to create a new qooxdoo application. Example: For creating a regular GUI application \'myapp\' you could execute: %prog --name myapp''') parser.add_option( "-n", "--name", dest="name", metavar="APPLICATIONNAME", help="Name of the application. An application folder with identical name will be created. (Required)" ) parser.add_option( "-o", "--out", dest="out", metavar="DIRECTORY", default=".", help="Output directory for the application folder. (Default: %default)" ) parser.add_option( "-s", "--namespace", dest="namespace", metavar="NAMESPACE", default=None, help="Applications's top-level namespace. (Default: APPLICATIONNAME)" ) parser.add_option( "-t", "--type", dest="type", metavar="TYPE", default="gui", help="Type of the application to create, one of: "+str(map(str, sorted(APP_INFOS.keys())))+"." + str(", ".join(["'%s' %s" % (x, y) for x,y in sorted(APP_INFOS.items())])) + ". (Default: %default)" ) parser.add_option( "-l", "--logfile", dest="logfile", metavar="LOGFILE", default=None, type="string", help="Log file" ) parser.add_option( "-p", "--skeleton-path", dest="skeleton_path", metavar="PATH", default=SKELETON_DIR, help="(Advanced) Path where the script looks for skeletons. " + "The directory must contain sub directories named by " + "the application types. (Default: %default)" ) parser.add_option( "--cache", dest="cache", metavar="PATH", default="${TMPDIR}/qx${QOOXDOO_VERSION}/cache", help="Path to the cache directory; will be entered into config.json's CACHE macro (Default: %default)" ) (options, args) = parser.parse_args(sys.argv[1:]) if not options.name: parser.print_help() sys.exit(1) else: options.name = options.name.decode('utf-8') # Initialize console global console console = Log(options.logfile, "info") checkNamespace(options) getQxVersion() createApplication(options) console.log("DONE")
def main(): parser = optparse.OptionParser() parser.set_usage('''\ %prog --name APPLICATIONNAME [--out DIRECTORY] [--namespace NAMESPACE] [--type TYPE] [-logfile LOGFILE] [--skeleton-path PATH] Script to create a new qooxdoo application. Example: For creating a regular GUI application \'myapp\' you could execute: %prog --name myapp''') parser.add_option( "-n", "--name", dest="name", metavar="APPLICATIONNAME", help="Name of the application. An application folder with identical name will be created. (Required)" ) parser.add_option( "-o", "--out", dest="out", metavar="DIRECTORY", default=".", help="Output directory for the application folder. (Default: %default)" ) parser.add_option( "-s", "--namespace", dest="namespace", metavar="NAMESPACE", default=None, help="Applications's top-level namespace. (Default: APPLICATIONNAME)" ) parser.add_option( "-t", "--type", dest="type", metavar="TYPE", default="gui", help="Type of the application to create, one of: "+str(map(str, sorted(APP_INFOS.keys())))+"." + str(", ".join(["'%s' %s" % (x, y) for x,y in sorted(APP_INFOS.items())])) + ". (Default: %default)" ) parser.add_option( "-l", "--logfile", dest="logfile", metavar="LOGFILE", default=None, type="string", help="Log file" ) parser.add_option( "-p", "--skeleton-path", dest="skeleton_path", metavar="PATH", default=SKELETON_DIR, help="(Advanced) Path where the script looks for skeletons. " + "The directory must contain sub directories named by " + "the application types. (Default: %default)" ) parser.add_option( "--cache", dest="cache", metavar="PATH", default="${TMPDIR}/cache", help="Path to the cache directory; will be entered into config.json's CACHE macro (Default: %default)" ) (options, args) = parser.parse_args(sys.argv[1:]) if not options.name: parser.print_help() sys.exit(1) else: options.name = options.name.decode('utf-8') # Initialize console global console console = Log(options.logfile, "info") if not options.namespace: if R_ILLEGAL_NS_CHAR.search(options.name): convertedName = R_ILLEGAL_NS_CHAR.sub("_", options.name) console.log("WARNING: Converted illegal characters in name (from %s to %s)" % (options.name, convertedName)) options.name = convertedName options.namespace = convertedName.lower() else: options.namespace = options.name.lower() else: options.namespace = options.namespace.decode('utf-8') if R_ILLEGAL_NS_CHAR.search(options.namespace): convertedNamespace = R_ILLEGAL_NS_CHAR.sub("_", options.namespace) console.log("WARNING: Converted illegal characters in namespace (from %s to %s)" % (options.namespace, convertedNamespace)) options.namespace = convertedNamespace getQxVersion() createApplication(options) console.log("DONE")
def main(): parser = optparse.OptionParser() parser.set_usage('''\ %prog --name APPLICATIONNAME [--out DIRECTORY] [--namespace NAMESPACE] [--type TYPE] [-logfile LOGFILE] [--skeleton-path PATH] Script to create a new qooxdoo application. Example: For creating a regular GUI application \'myapp\' you could execute: %prog --name myapp''') parser.add_option( "-n", "--name", dest="name", metavar="APPLICATIONNAME", help="Name of the application. An application folder with identical name will be created. (Required)" ) parser.add_option( "-o", "--out", dest="out", metavar="DIRECTORY", default=".", help="Output directory for the application folder. (Default: %default)" ) parser.add_option( "-s", "--namespace", dest="namespace", metavar="NAMESPACE", default=None, help="Applications's top-level namespace. (Default: APPLICATIONNAME)" ) parser.add_option( "-t", "--type", dest="type", metavar="TYPE", default="gui", help="Type of the application to create, one of: "+str(APP_TYPES)+"." + "'gui' builds a standard qooxdoo GUI application, " + "'inline' builds a inline qooxdoo GUI application, " + "'migration' should " + "be used to migrate qooxdoo 0.7 applications and " + "'bom' can be used " + "to build low-level qooxdoo applications. (Default: %default)" ) parser.add_option( "-l", "--logfile", dest="logfile", metavar="LOGFILE", default=None, type="string", help="Log file" ) parser.add_option( "-p", "--skeleton-path", dest="skeleton_path", metavar="PATH", default=SKELETON_DIR, help="(Advanced) Path where the script looks for skeletons. " + "The directory must contain sub directories named by " + "the application types. (Default: %default)" ) (options, args) = parser.parse_args(sys.argv[1:]) if not options.name: parser.print_help() sys.exit(1) if not options.namespace: options.namespace = options.name.lower().replace(" ", "_") # Initialize console global console console = Log(options.logfile, "info") createApplication( options.name, options.out, options.namespace, options.type, options.skeleton_path ) console.log("DONE")
def main(): parser = optparse.OptionParser() parser.set_usage('''\ %prog --name APPLICATIONNAME [--out DIRECTORY] [--namespace NAMESPACE] [--type TYPE] [-logfile LOGFILE] [--skeleton-path PATH] Script to create a new qooxdoo application. Example: For creating a regular GUI application \'myapp\' you could execute: %prog --name myapp''') parser.add_option( "-n", "--name", dest="name", metavar="APPLICATIONNAME", help= "Name of the application. An application folder with identical name will be created. (Required)" ) parser.add_option( "-o", "--out", dest="out", metavar="DIRECTORY", default=".", help="Output directory for the application folder. (Default: %default)" ) parser.add_option( "-s", "--namespace", dest="namespace", metavar="NAMESPACE", default=None, help="Applications's top-level namespace. (Default: APPLICATIONNAME)") parser.add_option( "-t", "--type", dest="type", metavar="TYPE", default="gui", help="Type of the application to create, one of: " + str(APP_TYPES) + "." + "'gui' builds a standard qooxdoo GUI application, " + "'with-contrib' builds a standard qooxdoo GUI application that " + "also uses a qooxdoo-contrib library, " + "'migration' should " + "be used to migrate qooxdoo 0.7 applications and " + "'bom' can be used " + "to build low-level qooxdoo applications. (Default: %default)") parser.add_option("-l", "--logfile", dest="logfile", metavar="LOGFILE", default=None, type="string", help="Log file") parser.add_option( "-p", "--skeleton-path", dest="skeleton_path", metavar="PATH", default=SKELETON_DIR, help="(Advanced) Path where the script looks for skeletons. " + "The directory must contain sub directories named by " + "the application types. (Default: %default)") (options, args) = parser.parse_args(sys.argv[1:]) if not options.name: parser.print_help() sys.exit(1) if not options.namespace: options.namespace = options.name.lower().replace(" ", "_") # Initialize console global console console = Log(options.logfile, "info") createApplication(options.name, options.out, options.namespace, options.type, options.skeleton_path) console.log("DONE")