• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python sipconfig.inform函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sipconfig.inform函数的典型用法代码示例。如果您正苦于以下问题:Python inform函数的具体用法?Python inform怎么用?Python inform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了inform函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: create_makefiles

def create_makefiles():
    """Create the additional Makefiles.
    """
    sipconfig.inform("Creating top level Makefile...")

    sipconfig.ParentMakefile(
        configuration=pyqtcfg, subdirs=["qmmp"], installs=("pyqmmpconfig.py", opt_pyqmmpmoddir)
    ).generate()
开发者ID:djdron,项目名称:qmmp,代码行数:8,代码来源:configure.py


示例2: manage_cache

def manage_cache(gendir):
    """
    This function keeps a cache of all sip-generated *.cpp and *.h files
    and restores the stats of the newly generated set whenever the content
    is unchanged
    """
    sipconfig.inform("Managing the module cache: %s" % gendir)

    gendir = path(gendir)
    cache = gendir / 'cache'
    cache.ensure_exists()

    if 'clean' in sys.argv:
        cache.rmtree()

    changed_count = 0
    for newfile in gendir.files('*.cpp') + gendir.files('*.h'):
        oldfile = cache / newfile.name
        if different(newfile, oldfile):
            changed_count += 1
            shutil.copy2(newfile, oldfile)
            if VERBOSE:
                sipconfig.inform("--> changed: %s" % newfile.name)
        else:
            #sipconfig.inform("--> same:    %s" % newfile.name)
            shutil.copystat(oldfile, newfile)

    sipconfig.inform('%d file%s changed.' %
                     (changed_count, 's' if changed_count != 1 else ''))
开发者ID:ifwe,项目名称:wxpy,代码行数:29,代码来源:wxpysetup.py


示例3: create_config

def create_config(module, template):
    """Create the PyQMMP configuration module so that it can be imported
    by build scripts.

    module is the module file name.
    template is the template file name.
    """
    sipconfig.inform("Creating %s..." % module)

    content = {
        "pyqmmp_version": pyqmmp_version,
        "pyqmmp_version_str": pyqmmp_version_str,
        "pyqmmp_mod_dir": opt_pyqmmpmoddir,
        "pyqmmp_sip_dir": opt_pyqmmpsipdir,
        "pyqmmp_qmmp_sip_flags": qmmp_sip_flags,
        # These are internal.
        "_pyqmmp_defines": qmmp_define,
        "_pyqmmp_inc_dir": opt_qmmpincdir,
        "_pyqmmp_lib_dir": opt_qmmplibdir,
    }

    sipconfig.create_config_module(module, template, content)
开发者ID:djdron,项目名称:qmmp,代码行数:22,代码来源:configure.py


示例4: check_qscintilla

def check_qscintilla():
    """See if QScintilla can be found and what its version is.
    """
    # Find the QScintilla header files.
    sciglobal = os.path.join(opts.qsciincdir, "Qsci", "qsciglobal.h")

    if os.access(sciglobal, os.F_OK):
        # Get the QScintilla version string.
        _, sciversstr = sipconfig.read_version(sciglobal, "QScintilla", "QSCINTILLA_VERSION", "QSCINTILLA_VERSION_STR")

        if glob.glob(os.path.join(opts.qscilibdir, "*qscintilla2*")):
            # Because we include the Python bindings with the C++ code we can
            # reasonably force the same version to be used and not bother about
            # versioning.
            if sciversstr != "2.9.1":
                sipconfig.error("QScintilla %s is being used but the Python bindings 2.9.1 are being built.  Please use matching versions." % sciversstr)

            sipconfig.inform("QScintilla %s is being used." % sciversstr)
        else:
            sipconfig.error("The QScintilla library could not be found in %s. If QScintilla is installed then use the -o argument to explicitly specify the correct directory." % opts.qscilibdir)
    else:
        sipconfig.error("Qsci/qsciglobal.h could not be found in %s. If QScintilla is installed then use the -n argument to explicitly specify the correct directory." % opts.qsciincdir)
开发者ID:AEtherSurfer,项目名称:robomongo,代码行数:22,代码来源:configure-old.py


示例5: generate_code

    def generate_code(self, config):
        sip_install_dir = os.path.join(config.default_sip_dir, "skia")
        module_install_dir = os.path.join(config.default_mod_dir, "skia")

        for module in self.MODULES:
            # Calculate SIP module folder and scan for .sip files
            module_dir = os.path.join(self.SIP_DIR, module)

            sipconfig.inform("Processing {}...".format(module_dir))

            # Calculate module paths
            sip_file = os.path.join(module_dir, "{}.sip".format(module))
            build_dir = os.path.join(self.BUILD_DIR, module)
            build_file = os.path.join(build_dir, "{}.sbf".format(module))

            # Creating paths
            if not os.path.exists(build_dir):
                os.makedirs(build_dir)

            # Execute 'sip' command
            cmd = [
                config.sip_bin,
                "-c", build_dir,
                "-b", build_file,
                sip_file
            ]

            if subprocess.call(cmd):
                sipconfig.error(sip_file)
                sys.exit(1)

            # Generate module Makefile
            sipconfig.inform("Generating Makefile for '{}'...".format(module))

            makefile = sipconfig.SIPModuleMakefile(
                config,
                build_file,
                dir=build_dir,
                install_dir=module_install_dir,
                installs=[(sip_file, os.path.join(sip_install_dir, module))],
                makefile=os.path.join(build_dir, "Makefile")
            )

            makefile.extra_lib_dirs = [config.skia_libs_dir]
            makefile.extra_include_dirs = config.skia_includes
            makefile.extra_libs = config.skia_libs
            makefile.extra_lflags = ["-framework ApplicationServices"]

            makefile.generate()

        # Generate parent Makefile
        sipconfig.inform("Generating main Makefile...")
        sipconfig.ParentMakefile(
            configuration=config,
            subdirs=[os.path.join(self.BUILD_DIR, m) for m in self.MODULES],
            installs=[(f, config.skia_mod_dir) for f in self.package_installs],
        ).generate()
开发者ID:expobrain,项目名称:python-skia,代码行数:57,代码来源:configure.py


示例6: create_makefiles

def create_makefiles(macros):
    """Create the Makefiles.

    macros is the dictionary of platform specific build macros.
    """
    # Bootstrap.  Make sure we get the right one.
    sys.path.insert(0, os.path.curdir)
    invalidate_caches()
    import sipconfig

    cfg = sipconfig.Configuration()

    cfg.set_build_macros(macros)

    sipconfig.inform("Creating top level Makefile...")

    sipconfig.ParentMakefile(
        configuration=cfg,
        subdirs=["sipgen", "siplib"],
        installs=(["sipconfig.py", os.path.join(src_dir, "sipdistutils.py")],
                cfg.sip_mod_dir)
    ).generate()

    sipconfig.inform("Creating sip code generator Makefile...")

    sipconfig.ProgramMakefile(
        configuration=cfg,
        build_file=os.path.join(src_dir, "sipgen", "sipgen.sbf"),
        dir="sipgen",
        install_dir=os.path.dirname(cfg.sip_bin),
        console=1,
        warnings=0,
        universal=opts.universal,
        arch=opts.arch,
        deployment_target=opts.deployment_target
    ).generate()

    sipconfig.inform("Creating sip module Makefile...")

    makefile = sipconfig.ModuleMakefile(
        configuration=cfg,
        build_file=os.path.join(src_dir, "siplib", "siplib.sbf"),
        dir="siplib",
        install_dir=cfg.sip_mod_dir,
        installs=([os.path.join(src_dir, "siplib", "sip.h")], cfg.sip_inc_dir),
        console=1,
        warnings=0,
        static=opts.static,
        debug=opts.debug,
        universal=opts.universal,
        arch=opts.arch,
        deployment_target=opts.deployment_target
    )

    makefile.generate()
开发者ID:Narengowda,项目名称:web-mouse,代码行数:55,代码来源:configure.py


示例7: create_makefiles

def create_makefiles(macros):
    """Create the Makefiles.

    macros is the dictionary of platform specific build macros.
    """
    # Bootstrap.
    import sipconfig

    cfg = sipconfig.Configuration()

    cfg.set_build_macros(macros)

    sipconfig.inform("Creating top level Makefile...")

    sipconfig.ParentMakefile(
        configuration=cfg,
        subdirs=["sipgen", "siplib"],
        installs=(["sipconfig.py", "sipdistutils.py"], cfg.sip_mod_dir)
    ).generate()

    sipconfig.inform("Creating sip code generator Makefile...")

    sipconfig.ProgramMakefile(
        configuration=cfg,
        build_file="sipgen.sbf",
        dir="sipgen",
        install_dir=os.path.dirname(cfg.sip_bin),
        console=1,
        warnings=0,
        universal=opts.universal
    ).generate()

    sipconfig.inform("Creating sip module Makefile...")

    makefile = sipconfig.ModuleMakefile(
        configuration=cfg,
        build_file="siplib.sbf",
        dir="siplib",
        install_dir=cfg.sip_mod_dir,
        installs=(["sip.h"], cfg.sip_inc_dir),
        console=1,
        warnings=0,
        static=opts.static,
        debug=opts.debug,
        universal=opts.universal
    )

    makefile.generate()
开发者ID:h4ck3rm1k3,项目名称:sip,代码行数:48,代码来源:configure.py


示例8: manage_cache

def manage_cache(gendir, show_diffs = True):
    """
    This function keeps a cache of all sip-generated *.cpp and *.h files
    and restores the stats of the newly generated set whenever the content
    is unchanged
    """
    sipconfig.inform("Managing the module cache: %s" % gendir)

    gendir = path(gendir)
    cache = gendir / 'cache'
    if not cache.isdir():
        cache.makedirs()

    if 'clean' in sys.argv:
        cache.rmtree()

    changed_count = 0
    for newfile in gendir.files('*.cpp') + gendir.files('*.h'):
        oldfile = cache / newfile.name
        if different(newfile, oldfile):
            changed_count += 1

            if oldfile.isfile():
                assert newfile.mtime > oldfile.mtime


            shutil.copy2(newfile, oldfile) # src, dest
            a, b = newfile.stat().st_mtime, oldfile.stat().st_mtime
            #assert a == b, "copy2 failed: mtimes are different! (%s and %s)" % (a, b)

            sipconfig.inform("--> changed: %s" % newfile.name)
        else:
            #sipconfig.inform("--> same:    %s" % newfile.name)
            shutil.copystat(oldfile, newfile)

    sipconfig.inform('%d file%s changed.' %
                     (changed_count, 's' if changed_count != 1 else ''))

    sys.stdout.flush()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:39,代码来源:cache.py


示例9: inform_user

def inform_user():
    """Tell the user the option values that are going to be used.
    """
    sipconfig.inform("PyQt %s is being used." % pyqt.pyqt_version_str)
    sipconfig.inform("Qt v%s %s edition is being used." % (sipconfig.version_to_string(pyqt.qt_version), pyqt.qt_edition))
    sipconfig.inform("SIP %s is being used." % pyqt.sip_version_str)

    sipconfig.inform("The Fresh module will be installed in %s." % opts.freshmoddir)
    sipconfig.inform("The Fresh API file will be installed in %s." % os.path.join(opts.freshdir, "api", "python"))
    sipconfig.inform("The Fresh .sip files will be installed in %s." % opts.freshsipdir)

    if opts.no_docstrings:
        sipconfig.inform("The Fresh module is being built without generated docstrings.")
    else:
        sipconfig.inform("The Fresh module is being built with generated docstrings.")
开发者ID:hlamer,项目名称:Fresh-framework,代码行数:15,代码来源:configure.py


示例10: inform_user

def inform_user():
    """Tell the user the option values that are going to be used.
    """
    sipconfig.inform("The PyQMMP modules will be installed in %s." % opt_pyqmmpmoddir)
    sipconfig.inform("The PyQMMP .sip files will be installed in %s." % opt_pyqmmpsipdir)
开发者ID:djdron,项目名称:qmmp,代码行数:5,代码来源:configure.py


示例11: main

def main(argv):
    """Create the configuration module module.

    argv is the list of command line arguments.
    """
    try:
        optlist, args = getopt.getopt(argv[1:], "hcd:gj:kn:o:ruv:w")
    except getopt.GetoptError:
        usage()

    global opt_pyqmmpmoddir, opt_pyqmmpsipdir
    global opt_qmmpincdir, opt_qmmplibdir
    global opt_static, opt_debug, opt_concat, opt_releasegil, opt_split
    global opt_tracing, opt_verbose

    """
    for opt, arg in optlist:
        if opt == "-h":
            usage(0)
        elif opt == "-c":
            opt_concat = 1
        elif opt == "-d":
            opt_pyqmmpmoddir = arg
        elif opt == "-g":
            opt_releasegil = 1
        elif opt == "-j":
            try:
                opt_split = int(arg)
            except:
                usage()
        elif opt == "-k":
            opt_static = 1
        elif opt == "-n":
            opt_qmmpincdir = arg
        elif opt == "-o":
            opt_qmmplibdir = arg
        elif opt == "-r":
            opt_tracing = 1
        elif opt == "-u":
            opt_debug = 1
        elif opt == "-v":
            opt_pyqmmpsipdir = arg
        elif opt == "-w":
            opt_verbose = 1

    if args:
        usage()
    """

    # check_license()

    sipconfig.inform("SIP %s is being used." % pyqtcfg.sip_version_str)

    # Check SIP is new enough.
    if pyqtcfg.sip_version_str[:8] != "snapshot":
        minv = None

        if pyqtcfg.sip_version >= 0x040000:
            if pyqtcfg.sip_version < sip_min_v4_version:
                minv = sip_min_v4_version
        else:
            if pyqtcfg.sip_version < sip_min_v3_version:
                minv = sip_min_v3_version

        if minv:
            sipconfig.error("This version of PyQMMP requires SIP v%s or later" % sipconfig.version_to_string(minv))

    # Check for .
    # check_qmmp()

    # If  wasn't found then there is no point carrying on.  An
    # appropriate error message will already have been displayed.
    # if qmmp_version is None:
    #   sys.exit(1)

    # Set the SIP platform, version and feature flags.
    set_sip_flags()

    # Tell the user what's been found.
    inform_user()

    lib_dir = "../../"
    # if opt_qmmplibdir != "../lib":
    #   lib_dir = opt_qmmplibdir

    # Generate the code.
    generate_code(
        "qmmp",
        imports=["PyQt4"],
        extra_define=qmmp_define,
        extra_include_dir=opt_qmmpincdir,
        extra_lib_dir=lib_dir,
        extra_lib="qmmp",
        sip_flags=qmmp_sip_flags,
    )

    # Create the additional Makefiles.
    create_makefiles()

    # Install the configuration module.
#.........这里部分代码省略.........
开发者ID:djdron,项目名称:qmmp,代码行数:101,代码来源:configure.py


示例12: generate_code

def generate_code():
    """Generate the code for the Fresh module.
    """
    mname = "fresh"
    
    sipconfig.inform("Generating the C++ source for the %s module..." % mname)

    # Build the SIP command line.
    argv = ['"' + pyqt.sip_bin + '"']

    argv.extend(sip_flags())

    if not opts.no_docstrings:
        argv.append("-o");

    if opts.concat:
        argv.append("-j")
        argv.append(str(opts.split))

    if opts.tracing:
        argv.append("-r")

    argv.append("-c")
    argv.append(".")

    buildfile = os.path.join("fresh.sbf")
    argv.append("-b")
    argv.append(buildfile)

    if pyqt.pyqt_version >= 0x040000:
        argv.append("../Python/sip/fresh.sip")
    
    os.system(" ".join(argv))

    # Check the result.
    if not os.access(buildfile, os.F_OK):
        sipconfig.error("Unable to create the C++ code.")

    # Generate the Makefile.
    sipconfig.inform("Creating the Makefile for the %s module..." % mname)

    def fix_install(mfile):
        if sys.platform != "darwin" or opts.static:
            return

        mfile.write("\tinstall_name_tool -change libqscintilla2.%u.dylib %s/libqscintilla2.%u.dylib $(DESTDIR)%s/$(TARGET)\n" % (FRESH_API_MAJOR, opts.freshlibdir, FRESH_API_MAJOR, opts.freshmoddir))

    if pyqt.pyqt_version >= 0x040000:
        class Makefile(pyqt4.QtGuiModuleMakefile):
            def generate_target_install(self, mfile):
                pyqt4.QtGuiModuleMakefile.generate_target_install(self, mfile)
                fix_install(mfile)
    else:
        class Makefile(pyqt3.QtModuleMakefile):
            def generate_target_install(self, mfile):
                pyqt3.QtModuleMakefile.generate_target_install(self, mfile)
                fix_install(mfile)

    installs = []
    sipfiles = []

    for s in glob.glob("sip/*.sip"):
        sipfiles.append(os.path.join("sip", os.path.basename(s)))

    installs.append([sipfiles, os.path.join(opts.freshsipdir, mname)])

    installs.append(("fresh.api", os.path.join(opts.freshdir, "api", "python")))

    makefile = Makefile(
        configuration=pyqt,
        build_file="fresh.sbf",
        install_dir=opts.freshmoddir,
        installs=installs,
        static=opts.static,
        debug=opts.debug,
        universal=pyqt.universal)
    
    if fresh_define:
        makefile.extra_defines.append(fresh_define)
    makefile.extra_include_dirs.append('..')
    makefile.extra_include_dirs.append(opts.freshincdir)
    makefile.extra_lib_dirs.append(opts.freshlibdir)
    makefile.extra_lib_dirs.append('../build')
    makefile.extra_libs.append("cppfresh")

    makefile.generate()
开发者ID:hlamer,项目名称:Fresh-framework,代码行数:86,代码来源:configure.py


示例13: check_license

def check_license():
    """Handle the validation of the PyQMMP license.
    """
    try:
        import license

        ltype = license.LicenseType
        lname = license.LicenseName

        try:
            lfile = license.LicenseFile
        except AttributeError:
            lfile = None
    except ImportError:
        ltype = None

    if ltype is None:
        ltype = "GPL"
        lname = "GNU General Public License"
        lfile = None

    sipconfig.inform(
        "This is the %s version of PyQMMP %s (licensed under the %s) for Python %s on %s."
        % (ltype, pyqmmp_version_str, lname, string.split(sys.version)[0], sys.platform)
    )

    # Common checks.
    if ltype == "GPL" and sys.platform == "win32":
        error("You cannot use the GPL version of PyQMMP under Windows.")

    try:
        qted = pyqtcfg.qt_edition
    except AttributeError:
        qted = None

    if qted:
        if (qted == "free" and ltype != "GPL") or (qted != "free" and ltype == "GPL"):
            sipconfig.error("This version of PyQMMP and the %s edition of Qt have incompatible licenses." % qted)

    # Confirm the license.
    print
    print "Type 'L' to view the license."
    print "Type 'yes' to accept the terms of the license."
    print "Type 'no' to decline the terms of the license."
    print

    while 1:
        try:
            resp = raw_input("Do you accept the terms of the license? ")
        except:
            resp = ""

        resp = string.lower(string.strip(resp))

        if resp == "yes":
            break

        if resp == "no":
            sys.exit(0)

        if resp == "l":
            os.system("more LICENSE")

    # If there should be a license file then check it is where it should be.
    if lfile:
        if os.access(os.path.join("sip", lfile), os.F_OK):
            sipconfig.inform("Found the license file %s." % lfile)
        else:
            sipconfig.error("Please copy the license file %s to the sip directory." % lfile)
开发者ID:djdron,项目名称:qmmp,代码行数:69,代码来源:configure.py


示例14: build_file

	return params

def build_file():
	return os.path.join(options.build_path, "%s.sbf" % options.module_name)

def parse_options():
	from optparse import OptionParser

	parser = OptionParser()
	parser.add_option("", "--module-name", dest="module_name", help="the python module name of the lib")
	parser.add_option("", "--sip-file", dest="sip_file", help="the sip file of the lib")
	parser.add_option("", "--lib", dest="lib", help="the name without extension of the lib")
	parser.add_option("", "--lib-path", dest="lib_path", help="the path where the lib dynamic library can be found")
	parser.add_option("", "--include-path", dest="include_path", help="the path where the lib headers can be found")
	parser.add_option("", "--build-path", dest="build_path", help="the path where the Makefile can be found")
	options, args = parser.parse_args()

	return options

options = None

if __name__ == '__main__':
	options = parse_options()

	config = pyqtconfig.Configuration()
	sipconfig.inform("Generating bindings")
	run_sip(config)
	sipconfig.inform("Generating Makefile")
	generate_makefile(config)
	sipconfig.inform("Makefile generated. Run \"nmake\" now.")
开发者ID:zoujyjs,项目名称:traitsQt,代码行数:30,代码来源:configure-sip.py


示例15: inform_user

def inform_user():
    """Tell the user the option values that are going to be used.
    """
    sipconfig.inform("PyQt %s is being used." % pyqt.pyqt_version_str)
    sipconfig.inform("Qt v%s %s edition is being used." % (sipconfig.version_to_string(pyqt.qt_version), pyqt.qt_edition))
    sipconfig.inform("SIP %s is being used." % pyqt.sip_version_str)

    sipconfig.inform("The QScintilla module will be installed in %s." % opts.qscimoddir)
    sipconfig.inform("The QScintilla API file will be installed in %s." % os.path.join(opts.qscidir, "api", "python"))
    sipconfig.inform("The QScintilla .sip files will be installed in %s." % opts.qscisipdir)

    if opts.no_docstrings:
        sipconfig.inform("The QScintilla module is being built without generated docstrings.")
    else:
        sipconfig.inform("The QScintilla module is being built with generated docstrings.")

    if opts.prot_is_public:
        sipconfig.inform("The QScintilla module is being built with 'protected' redefined as 'public'.")
开发者ID:AEtherSurfer,项目名称:robomongo,代码行数:18,代码来源:configure-old.py


示例16: create_makefiles

def create_makefiles(macros):
    """Create the Makefiles.

    macros is the dictionary of platform specific build macros.
    """
    # Bootstrap.  Make sure we get the right one.
    sys.path.insert(0, os.path.curdir)
    invalidate_caches()
    import sipconfig

    cfg = sipconfig.Configuration()

    cfg.set_build_macros(macros)

    if opts.no_tools:
        subdirs = ["siplib"]
        installs = None
    else:
        subdirs = ["sipgen", "siplib"]
        installs = (["sipconfig.py", os.path.join(src_dir, "sipdistutils.py")], cfg.sip_mod_dir)

    if opts.use_qmake:
        sipconfig.inform("Creating top level .pro file...")

        pro = open("sip.pro", "w")

        pro.write("TEMPLATE = subdirs\n")
        pro.write("SUBDIRS = %s\n" % " ".join(subdirs))

        if installs is not None:
            files, path = installs
            pro.write("\n")
            pro.write("build_system.files = %s\n" % " ".join(files))
            pro.write("build_system.path = %s\n" % quote(path))
            pro.write("INSTALLS += build_system\n")

        pro.close()
    else:
        sipconfig.inform("Creating top level Makefile...")

        sipconfig.ParentMakefile(configuration=cfg, subdirs=subdirs, installs=installs).generate()

    if opts.use_qmake:
        sipconfig.inform("Creating sip code generator .pro file...")

        pro = open(os.path.join("sipgen", "sipgen.pro"), "w")

        pro.write("TEMPLATE = app\n")
        pro.write("TARGET = sip\n")
        pro.write("CONFIG -= qt app_bundle\n")
        pro.write("CONFIG += warn_off exceptions_off console %s\n" % (("debug" if opts.debug else "release")))

        pro.write("\n")
        pro.write("# Work around QTBUG-39300.\n")
        pro.write("CONFIG -= android_install\n")

        pro.write("\n")
        pro.write("target.path = %s\n" % os.path.dirname(cfg.sip_bin))
        pro.write("INSTALLS += target\n")

        c_sources = get_sources("sipgen", "*.c")
        pro.write("\n")
        pro.write("SOURCES = %s\n" % " ".join(c_sources))

        headers = get_sources("sipgen", "*.h")
        pro.write("\n")
        pro.write("HEADERS = %s\n" % " ".join(headers))

        pro.close()
    else:
        sipconfig.inform("Creating sip code generator Makefile...")

        sipconfig.ProgramMakefile(
            configuration=cfg,
            build_file=os.path.join(src_dir, "sipgen", "sipgen.sbf"),
            dir="sipgen",
            install_dir=os.path.dirname(cfg.sip_bin),
            console=1,
            warnings=0,
            universal=opts.universal,
            arch=opts.arch,
            deployment_target=opts.deployment_target,
        ).generate()

    if opts.use_qmake:
        sipconfig.inform("Creating sip module .pro file...")

        pro = open(os.path.join("siplib", "siplib.pro"), "w")

        pro.write("TEMPLATE = lib\n")
        pro.write("TARGET = %s\n" % sip_module_base)
        pro.write("CONFIG -= qt\n")
        pro.write(
            "CONFIG += warn_on exceptions_off %s %s\n"
            % (("staticlib" if opts.static else "plugin"), ("debug" if opts.debug else "release"))
        )

        pro.write("\n")
        pro.write("# Work around QTBUG-39300.\n")
        pro.write("CONFIG -= android_install\n")
#.........这里部分代码省略.........
开发者ID:z80,项目名称:lcu03,代码行数:101,代码来源:configure.py


示例17: generate_code

def generate_code():
    """Generate the code for the QScintilla module.
    """
    if pyqt.pyqt_version >= 0x040000:
        mname = "Qsci"
    else:
        mname = "qsci"

    sipconfig.inform("Generating the C++ source for the %s module..." % mname)

    # Build the SIP command line.
    argv = ['"' + pyqt.sip_bin + '"']

    argv.extend(sip_flags())

    if opts.no_timestamp:
        argv.append("-T")

    if not opts.no_docstrings:
        argv.append("-o");

    if opts.prot_is_public:
        argv.append("-P");

    if opts.concat:
        argv.append("-j")
        argv.append(str(opts.split))

    if opts.tracing:
        argv.append("-r")

    argv.append("-c")
    argv.append(".")

    buildfile = os.path.join("qsci.sbf")
    argv.append("-b")
    argv.append(buildfile)

    if pyqt.pyqt_version >= 0x040000:
        argv.append("sip/qscimod4.sip")
    else:
        argv.append("sip/qscimod3.sip")

    os.system(" ".join(argv))

    # Check the result.
    if not os.access(buildfile, os.F_OK):
        sipconfig.error("Unable to create the C++ code.")

    # Generate the Makefile.
    sipconfig.inform("Creating the Makefile for the %s module..." % mname)

    def fix_install(mfile):
        if sys.platform != "darwin" or opts.static:
            return

        mfile.write("\tinstall_name_tool -change libqscintilla2.%u.dylib %s/libqscintilla2.%u.dylib $(DESTDIR)%s/$(TARGET)\n" % (QSCI_API_MAJOR, opts.qscilibdir, QSCI_API_MAJOR, opts.qscimoddir))

    if pyqt.pyqt_version >= 0x040000:
        class Makefile(pyqt4.QtGuiModuleMakefile):
            def generate_target_install(self, mfile):
                pyqt4.QtGuiModuleMakefile.generate_target_install(self, mfile)
                fix_install(mfile)
    else:
        class Makefile(pyqt3.QtModuleMakefile):
            def generate_target_install(self, mfile):
                pyqt3.QtModuleMakefile.generate_target_install(self, mfile)
                fix_install(mfile)

    installs = []
    sipfiles = []

    for s in glob.glob("sip/*.sip"):
        sipfiles.append(os.path.join("sip", os.path.basename(s)))

    installs.append([sipfiles, os.path.join(opts.qscisipdir, mname)])

    installs.append(("QScintilla2.api", os.path.join(opts.qscidir, "api", "python")))

    # PyQt v4.2 and later can handle MacOS/X universal binaries.
    if pyqt.pyqt_version >= 0x040200:
        makefile = Makefile(
            configuration=pyqt,
            build_file="qsci.sbf",
            install_dir=opts.qscimoddir,
            installs=installs,
            static=opts.static,
            debug=opts.debug,
            universal=pyqt.universal,
            arch=pyqt.arch,
            prot_is_public=opts.prot_is_public,
            deployment_target=pyqt.deployment_target
        )
    else:
        makefile = Makefile(
            configuration=pyqt,
            build_file="qsci.sbf",
            install_dir=opts.qscimoddir,
            installs=installs,
            static=opts.static,
#.........这里部分代码省略.........
开发者ID:AEtherSurfer,项目名称:robomongo,代码行数:101,代码来源:configure-old.py


示例18: generate_code

def generate_code(
    mname,
    imports=None,
    extra_cflags=None,
    extra_cxxflags="-I%s/Qt3Support/ -I%s/QtXml/ -I%s/QtGui/ -I%s -I../../ -L../../"
    % (pyqtcfg.qt_inc_dir, pyqtcfg.qt_inc_dir, pyqtcfg.qt_inc_dir, pyqtcfg.qt_inc_dir),
    extra_define=None,
    extra_include_dir=None,
    extra_lflags="-lQt3Support",
    extra_lib_dir=None,
    extra_lib=None,
    sip_flags=None,
):
    """Generate the code for a module.

    mname is the name of the module.
    imports is the list of PyQt modules that this one %Imports.
    extra_cflags is a string containing additional C compiler flags.
    extra_cxxflags is a string containing additional C++ compiler flags.
    extra_define is a name to add to the list of preprocessor defines.
    extra_include_dir is the name of a directory to add to the list of include
    directories.
    extra_lflags is a string containing additional linker flags.
    extra_lib_dir is the name of a directory to add to the list of library
    directories.
    extra_lib is the name of an extra library to add to the list of libraries.
    sip_flags is the list of sip flags to use instead of the defaults.
    """
    sipconfig.inform("Generating the C++ source for the %s module..." % mname)

    try:
        shutil.rmtree(mname)
    except:
        pass

    try:
        os.mkdir(mname)
    except:
        sipconfig.error("Unable to create the %s directory." % mname)

    # Build the SIP command line.
    argv = [pyqtcfg.sip_bin]

    if sip_flags:
        argv.extend(sip_flags)

    if opt_concat:
        argv.append("-j")
        argv.append(str(opt_split))

    if opt_tracing:
        argv.append("-r")

    if opt_releasegil:
        argv.append("-g")

    argv.append("-c")
    argv.append(mname)

    buildfile = os.path.join(mname, mname + ".sbf")
    argv.append("-b")
    argv.append(buildfile)

    argv.append("-I")
    argv.append(pyqtcfg.pyqt_sip_dir)

    # SIP assumes POSIX style path separators.
    argv.append(string.join(["sip", mname, mname + "mod.sip"], "/"))

    os.system(string.join(argv))

    # Check the result.
    if not os.access(buildfile, os.F_OK):
        sipconfig.error("Unable to create the C++ code.")

    # Compile the Python stub.
    if pyqtcfg.sip_version < 0x040000:
        sipconfig.inform("Compiling %s.py..." % mname)
        py_compile.compile(os.path.join(mname, mname + ".py"), os.path.join(mname, mname + ".pyc"))

    # Generate the Makefile.
    sipconfig.inform("Creating the Makefile for the %s module..." % mname)

    installs = []

    if pyqtcfg.sip_version >= 0x040000:
        warnings = 1
    else:
        warnings = 0
        installs.append([[mname + ".py", mname + ".pyc"], opt_pyqmmpmoddir])

    sipfiles = []

    for s in glob.glob("sip/" + mname + "/*.sip"):
        sipfiles.append(os.path.join("..", "sip", mname, os.path.basename(s)))

    installs.append([sipfiles, os.path.join(opt_pyqmmpsipdir, mname)])

    makefile = sipconfig.SIPModuleMakefile(
        configuration=pyqtcfg,
#.........这里部分代码省略.........
开发者ID:djdron,项目名称:qmmp,代码行数:101,代码来源:configure.py



注:本文中的sipconfig.inform函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python UA.UA类代码示例发布时间:2022-05-27
下一篇:
Python sip.wrapinstance函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap