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

Python install.run函数代码示例

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

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



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

示例1: run

    def run(self):
        """Runs the install and post-install actions"""
        install.run(self)

        log.info("Preparing/extracting location database and data for import...")
        self.prep_location_data()

        log.info("Importing location data into location database...")
        database = sqlite3.connect(self.install_lib+'cahoots/parsers/location/data/location.sqlite')
        database.text_factory = str
        cursor = database.cursor()

        log.info("Importing city data...")
        self.import_city_data(cursor)

        log.info("Importing country data...")
        self.import_country_data(cursor)

        log.info("Importing street suffix data...")
        self.import_street_suffix_data(cursor)

        log.info("Importing landmark data...")
        self.import_landmark_data(cursor)

        database.commit()
        database.close()

        log.info('Cleaning up location import temporary files...')
        self.cleanup_location_data()

        log.info('Done!')
开发者ID:SerenitySoftwareLLC,项目名称:cahoots,代码行数:31,代码来源:setup.py


示例2: run

    def run(self):
        '''
        We override the basic install command. First we download jars then
        we run the basic install then we check whether the jars are present
        in this package. If they aren't present we warn the user and give
        them some advice on how to retry getting the jars.
        '''
        downloader = MavenJarDownloader()
        downloader.download_files()
        if 'do_egg_install' in dir(install):
            '''
            setuptools.command.install checks if it was called
            directly by setup or by some other code by inspecting the call
            stack. They do this for backwards compatability.

            Anyway, when "install" is overriden it calls an older form of
            install (distutils.command.install) otherwise they call do_egg_install
            so we try to call do_egg_install otherwise we call install normally
            (since it should always be present).
            '''
            install.do_egg_install(self)
        else:
            install.run(self)
        missing_jars = downloader.missing_jars()
        if len(missing_jars) > 0:
            print(self.warning_string(missing_jars))
开发者ID:a8m,项目名称:amazon-kinesis-client-python,代码行数:26,代码来源:setup.py


示例3: _run_install

def _run_install(self):
    """
    The definition of the "run" method for the CustomInstallCommand metaclass.
    """
    # Get paths
    tethysapp_dir = get_tethysapp_directory()
    destination_dir = os.path.join(tethysapp_dir, self.app_package)

    # Notify user
    print('Copying App Package: {0} to {1}'.format(self.app_package_dir, destination_dir))

    # Copy files
    try:
        shutil.copytree(self.app_package_dir, destination_dir)

    except:
        try:
            shutil.rmtree(destination_dir)
        except:
            os.remove(destination_dir)

        shutil.copytree(self.app_package_dir, destination_dir)

    # Install dependencies
    for dependency in self.dependencies:
        subprocess.call(['pip', 'install', dependency])

    # Run the original install command
    install.run(self)
开发者ID:astraiophos,项目名称:tethys,代码行数:29,代码来源:app_installation.py


示例4: run

  def run(self):
    _install.run(self)

    # the second parameter, [], can be replaced with a set of 
    # parameters if _post_install needs any
    self.execute(_post_install, [],  
                 msg="Running post install task")
开发者ID:pavelvelikhov,项目名称:pythonql,代码行数:7,代码来源:setup.py


示例5: run

    def run(self):
        # Call subprocess to run te 'pip' command.
        # Only works, when user installs from sdist
        call(['pip', 'install', '-r', 'requirements.txt'])

        # Run 'install' to install lyrico
        install.run(self)
开发者ID:abhimanyuPathania,项目名称:lyrico,代码行数:7,代码来源:setup.py


示例6: run

 def run(self):
     _install.run(self)
     self.execute(
         self.__post_install,
         (self.install_lib,),
         msg="installing auto completion"
         )
开发者ID:mad01,项目名称:examples,代码行数:7,代码来源:setup.py


示例7: run

    def run(self):
        this_dir = os.path.dirname(os.path.realpath(__file__))
        self.C_SOURCE = os.path.join(this_dir, 'word2vec', 'c')

        self.TARGET_DIR = 'bin'
        if sys.platform == 'win32':
            self.TARGET_DIR = 'Scripts'

        if not os.path.exists(self.TARGET_DIR):
            os.makedirs(self.TARGET_DIR)

        if sys.platform == 'win32':
            self.compile_c('win32/word2vec.c', 'word2vec.exe')
            self.compile_c('win32/word2phrase.c', 'word2phrase.exe')
            self.compile_c('win32/distance.c', 'word2vec-distance.exe')
            self.compile_c('win32/word-analogy.c', 'word2vec-word-analogy.exe')
            self.compile_c('win32/compute-accuracy.c', 'word2vec-compute-accuracy.exe')
        else:
            self.compile_c('word2vec.c', 'word2vec')
            self.compile_c('word2phrase.c', 'word2phrase')
            self.compile_c('distance.c', 'word2vec-distance')
            self.compile_c('word-analogy.c', 'word2vec-word-analogy')
            self.compile_c('compute-accuracy.c', 'word2vec-compute-accuracy')
            self.compile_c('word2vec-sentence2vec.c', 'word2vec-doc2vec')

        _install.run(self)
开发者ID:xhrwang,项目名称:word2vec,代码行数:26,代码来源:setup.py


示例8: run

    def run(self):
        if sys.platform not in ('linux3', 'linux2', 'win32', 'darwin'):
            msg = "**Error: Can't install on this platform: %s" % sys.platform
            print msg
            sys.exit(1)

        # create build/share directory
        dir_util.mkpath(os.path.join(self.build_base, 'share', 'bauble'))

        if not self.single_version_externally_managed:
            self.do_egg_install()
        else:
            _install.run(self)

        # install bauble.desktop and icons
        if sys.platform in ('linux3', 'linux2'):
            # install everything in share
            dir_util.copy_tree(os.path.join(self.build_base, 'share'),
                               os.path.join(self.install_data, 'share'))
        elif sys.platform == 'win32':
            # install only i18n files
            locales = os.path.dirname(locale_path)
            install_cmd = self.get_finalized_command('install')
            build_base = install_cmd.build_base
            src = os.path.join(build_base, locales)
            dir_util.copy_tree(src, os.path.join(self.install_data, locales))

        file_util.copy_file(
            "LICENSE",
            os.path.join(self.install_data, 'share', 'bauble', 'LICENSE'))
开发者ID:mfrasca,项目名称:bauble.classic,代码行数:30,代码来源:setup.py


示例9: run

 def run(self):
     subprocess.check_call(['patch', '-d', CHDKPTP_PATH, '-i',
                            CHDKPTP_PATCH, '-p', '1'])
     os.symlink(os.path.join(CHDKPTP_PATH, 'config-sample-linux.mk'),
                os.path.join(CHDKPTP_PATH, 'config.mk'))
     subprocess.check_call(['make', '-C', CHDKPTP_PATH])
     InstallCommand.run(self)
开发者ID:jbaiter,项目名称:chdkptp.py,代码行数:7,代码来源:setup.py


示例10: run

    def run(self):
        # Note(Kevin): On Python 2, Bajoo should uses the stable 'Classic'
        # version. This version must be installed manually by the user
        # (usually the package manager of the distribution).
        # On python 3, Bajoo uses the 'Phoenix' version of wxPython.
        # At this time, the Phoenix version is not stable yet, and only daily
        # snapshots are available.

        # About wxVersion:
        # Some systems allowed several version of wxPython to be installed
        # wxVersion allows to pick a version.
        # If wxVersion is not available, either wxPython is not installed,
        # either the system only allows only one version of wxPython.

        if not self.force and sys.version_info[0] is 2:
            try:
                import wxversion
                try:
                    wxversion.select(['3.0', '2.9', '2.8'])
                except wxversion.VersionError:
                    pass
            except ImportError:
                pass

            try:
                import wx  # noqa
            except ImportError:
                print("""\
Bajoo depends on the library wxPython. This library is not available in the
Python Package Index (pypi), and so can't be automatically installed.
On Linux, you can install it from your distribution's package repositories.
On Windows, you can download it from http://wxpython.org/download.php""")
                raise Exception('wxPython not found.')
        InstallCommand.run(self)
开发者ID:Bajoo,项目名称:client-pc,代码行数:34,代码来源:setup.py


示例11: run

 def run(self):
     if not self.no_jars:
         import cmmnbuild_dep_manager
         mgr = cmmnbuild_dep_manager.Manager()
         mgr.install('pytimber')
         print('registered pytimber with cmmnbuild_dep_manager')
     _install.run(self)
开发者ID:levens,项目名称:pytimber,代码行数:7,代码来源:setup.py


示例12: run

 def run(self):
     install.run(self)
     try:
         # ignore failures since the tray icon is an optional component:
         call(['gtk-update-icon-cache', theme_base])
     except OSError:
         logging.warn(sys.exc_info()[1])
开发者ID:cherti,项目名称:udiskie,代码行数:7,代码来源:setup.py


示例13: run

 def run(self):
     _install.run(self)
     try:
         import server_manager.client
         import server_manager.contrail
         client_dir = os.path.dirname(server_manager.client.__file__)
         json_files = client_dir+'/*.json'
         json_list = glob.glob(json_files)
         dst_location = '/etc/contrail_smgr'
         if not os.path.exists(dst_location):
             os.makedirs(dst_location)
         print ("Coping to %s") % (dst_location)
         for jfile in json_list:
             shutil.copy(jfile, dst_location)
             print jfile
         ini_files = client_dir+'/*.ini'
         ini_list = glob.glob(ini_files)
         for ifile in ini_list:
             shutil.copy(ifile, dst_location)
             print ifile
         contrail_dir = os.path.dirname(server_manager.contrail.__file__)
         xml_files = contrail_dir+'/*.xml'
         xml_list = glob.glob(xml_files)
         for xmlfile in xml_list:
             shutil.copy(xmlfile, dst_location)
             print xmlfile
     except:
         print "Post installation failed"
开发者ID:Akilesh1597,项目名称:contrail-server-manager,代码行数:28,代码来源:setup.py


示例14: run

 def run(self):
     install.run(self)
     OS = system()
     if OS == 'Windows':
         call(["toxygen", "--configure"])
     elif OS == 'Linux':
         call(["toxygen", "--clean"])
开发者ID:supercoeus,项目名称:toxygen,代码行数:7,代码来源:setup.py


示例15: run

 def run(self):
     install.run(self)
     try:
         import oil_library
     except ImportError:
         print "oil_library not found - installing it now \n"
         build_oil_lib("install")
开发者ID:satcomlabs,项目名称:PyGnome,代码行数:7,代码来源:setup.py


示例16: run

 def run(self):
     # Perform a normal install.
     install.run(self)
     # Change permissions of the installed .py and .pyc files.
     for fileName in self.get_outputs():
         if fileName.endswith(('.py', '.pyc')):
             chmod(fileName, 420)  # 420 decimal = 644 octal
开发者ID:xashes,项目名称:study,代码行数:7,代码来源:setup.py


示例17: run

    def run(self):
        install.run(self)
        import sys

        # check about wxwidgets
        try:
            import wxversion

            wxversion.select("3.0")
        except:
            with open("install-wxpython.sh", "w") as shell_script:
                shell_script.write(
                    """#!/bin/sh
				echo 'Prerrequisites'
				apt-get --yes --force-yes install libgconf2-dev libgtk2.0-dev libgtk-3-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libgconfmm-2.6-dev libwebkitgtk-dev python-gtk2
				mkdir -p external
				cd external
				echo "Downloading wxPython 3.0.2.0"
				wget http://downloads.sourceforge.net/project/wxpython/wxPython/3.0.2.0/wxPython-src-3.0.2.0.tar.bz2
				echo "Done"
				echo 'Uncompressing ...'
				tar -xjvf wxPython-src-3.0.2.0.tar.bz2
				echo 'Patching  ...'
				cd wxPython-src-3.0.2.0
				cd wxPython
				sed -i -e 's/PyErr_Format(PyExc_RuntimeError, mesg)/PyErr_Format(PyExc_RuntimeError, "%s\", mesg)/g' src/gtk/*.cpp contrib/gizmos/gtk/*.cpp
				python ./build-wxpython.py --build_dir=../bld --install
				ldconfig
				cd ../../..
				rm -rf external
			"""
                )
            os.system("sh ./install-wxpython.sh")
开发者ID:melviso,项目名称:beatle,代码行数:33,代码来源:setup.py


示例18: run

    def run(self):
        from distutils import log
        from os.path import abspath
        from os import chdir, getcwd
        self.distribution.run_command('build')
        current_cwd = getcwd()
        build_dir = join(dirname(abspath(__file__)), self.build_base)
        cmake = cmake_executable()
        pkg = abspath(self.install_lib)
        log.info("CMake: Installing package to %s" % pkg)
        try:
            chdir(build_dir)
            self.spawn([cmake,
                '-DPYTHON_PKG_DIR=\'%s\'' % pkg,
                '-DPYPACKED=TRUE',
                '..'
            ])
            self.spawn([cmake, '--build', '.', '--target', 'install'])
        finally: chdir(current_cwd)

        try:
            prior = getattr(self.distribution, 'running_binary', False)
            self.distribution.running_binary = True
            self.distribution.have_run['egg_info'] = 0
            dInstall.run(self)
        finally: self.distribution.running_binary = prior
开发者ID:mdavezac,项目名称:bempp,代码行数:26,代码来源:setup.py


示例19: run

  def run(self):
    # Update the defaults if needed.
    if self.config_file:
      with open("grr/defaults.py", "wb") as fd:
        fd.write(self.DEFAULT_TEMPLATE % dict(CONFIG_FILE=self.config_file))

    install.run(self)
开发者ID:carriercomm,项目名称:grr,代码行数:7,代码来源:setup.py


示例20: run

 def run(self):
     if (not check_system_dependencies() or
         not check_version_dependencies() or
         not check_py_dependencies()):
         print 'Can not find all requires'
         #raise EnvironmentError
     _install.run(self)
开发者ID:andresriancho,项目名称:w3af-webui,代码行数:7,代码来源:setup.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python install_lib.run函数代码示例发布时间:2022-05-27
下一篇:
Python install.initialize_options函数代码示例发布时间: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