当前位置: 首页>>代码示例>>Python>>正文


Python install.run函数代码示例

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


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


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