當前位置: 首頁>>代碼示例>>Python>>正文


Python util.execute方法代碼示例

本文整理匯總了Python中distutils.util.execute方法的典型用法代碼示例。如果您正苦於以下問題:Python util.execute方法的具體用法?Python util.execute怎麽用?Python util.execute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在distutils.util的用法示例。


在下文中一共展示了util.execute方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run

# 需要導入模塊: from distutils import util [as 別名]
# 或者: from distutils.util import execute [as 別名]
def run(self):
        if not (os.system('pip show capstone') == 0):
            os.system('pip install git+https://github.com/aquynh/capstone@next#subdirectory=bindings/python')
        build_py.run(self)


# class PkgInstall(install_lib):
#     def run(self):
#         install_lib.run(self)
#         pth = os.path.dirname(os.path.realpath(__file__))
#         img = os.path.join(pth, 'fiddle/hw_info/bbxm/beagleboard-xm-orig.img')

#         os.system("cp %s %s" % (img, os.path.join(self.install_base,"fiddle/hw_info/bbxm/")))



# I'm guessing the following block of commented-out code is not a kosher
# way of installing capstone...
# execute(os.system, ('git clone https://github.com/aquynh/capstone',))
# execute(os.system, ('cd capstone; git checkout -b next',))
# os.environ['PREFIX'] = sys.prefix
# execute(os.system, ('cd capstone; ./make.sh',))
# execute(os.system, ('cd capstone; ./make.sh install',)) 
開發者ID:bx,項目名稱:bootloader_instrumentation_suite,代碼行數:25,代碼來源:setup.py

示例2: execute

# 需要導入模塊: from distutils import util [as 別名]
# 或者: from distutils.util import execute [as 別名]
def execute(self, func, args, msg=None, level=1):
        util.execute(func, args, msg, dry_run=self.dry_run) 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:4,代碼來源:cmd.py

示例3: make_file

# 需要導入模塊: from distutils import util [as 別名]
# 或者: from distutils.util import execute [as 別名]
def make_file(self, infiles, outfile, func, args,
                  exec_msg=None, skip_msg=None, level=1):
        """Special case of 'execute()' for operations that process one or
        more input files and generate one output file.  Works just like
        'execute()', except the operation is skipped and a different
        message printed if 'outfile' already exists and is newer than all
        files listed in 'infiles'.  If the command defined 'self.force',
        and it is true, then the command is unconditionally run -- does no
        timestamp checks.
        """
        if skip_msg is None:
            skip_msg = "skipping %s (inputs unchanged)" % outfile

        # Allow 'infiles' to be a single string
        if isinstance(infiles, str):
            infiles = (infiles,)
        elif not isinstance(infiles, (list, tuple)):
            raise TypeError, \
                  "'infiles' must be a string, or a list or tuple of strings"

        if exec_msg is None:
            exec_msg = "generating %s from %s" % \
                       (outfile, ', '.join(infiles))

        # If 'outfile' must be regenerated (either because it doesn't
        # exist, is out-of-date, or the 'force' flag is true) then
        # perform the action that presumably regenerates it
        if self.force or dep_util.newer_group(infiles, outfile):
            self.execute(func, args, exec_msg, level)

        # Otherwise, print the "skip" message
        else:
            log.debug(skip_msg)

# XXX 'install_misc' class not currently used -- it was the base class for
# both 'install_scripts' and 'install_data', but they outgrew it.  It might
# still be useful for 'install_headers', though, so I'm keeping it around
# for the time being. 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:40,代碼來源:cmd.py

示例4: execute

# 需要導入模塊: from distutils import util [as 別名]
# 或者: from distutils.util import execute [as 別名]
def execute(self, func, args, msg=None, level=1):
        execute(func, args, msg, self.dry_run) 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:4,代碼來源:ccompiler.py

示例5: make_file

# 需要導入模塊: from distutils import util [as 別名]
# 或者: from distutils.util import execute [as 別名]
def make_file(self, infiles, outfile, func, args,
                  exec_msg=None, skip_msg=None, level=1):
        """Special case of 'execute()' for operations that process one or
        more input files and generate one output file.  Works just like
        'execute()', except the operation is skipped and a different
        message printed if 'outfile' already exists and is newer than all
        files listed in 'infiles'.  If the command defined 'self.force',
        and it is true, then the command is unconditionally run -- does no
        timestamp checks.
        """
        if skip_msg is None:
            skip_msg = "skipping %s (inputs unchanged)" % outfile

        # Allow 'infiles' to be a single string
        if isinstance(infiles, str):
            infiles = (infiles,)
        elif not isinstance(infiles, (list, tuple)):
            raise TypeError(
                  "'infiles' must be a string, or a list or tuple of strings")

        if exec_msg is None:
            exec_msg = "generating %s from %s" % (outfile, ', '.join(infiles))

        # If 'outfile' must be regenerated (either because it doesn't
        # exist, is out-of-date, or the 'force' flag is true) then
        # perform the action that presumably regenerates it
        if self.force or dep_util.newer_group(infiles, outfile):
            self.execute(func, args, exec_msg, level)
        # Otherwise, print the "skip" message
        else:
            log.debug(skip_msg)

# XXX 'install_misc' class not currently used -- it was the base class for
# both 'install_scripts' and 'install_data', but they outgrew it.  It might
# still be useful for 'install_headers', though, so I'm keeping it around
# for the time being. 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:38,代碼來源:cmd.py

示例6: make_file

# 需要導入模塊: from distutils import util [as 別名]
# 或者: from distutils.util import execute [as 別名]
def make_file(self, infiles, outfile, func, args,
                  exec_msg=None, skip_msg=None, level=1):
        """Special case of 'execute()' for operations that process one or
        more input files and generate one output file.  Works just like
        'execute()', except the operation is skipped and a different
        message printed if 'outfile' already exists and is newer than all
        files listed in 'infiles'.  If the command defined 'self.force',
        and it is true, then the command is unconditionally run -- does no
        timestamp checks.
        """
        if skip_msg is None:
            skip_msg = "skipping %s (inputs unchanged)" % outfile

        # Allow 'infiles' to be a single string
        if isinstance(infiles, str):
            infiles = (infiles,)
        elif not isinstance(infiles, (list, tuple)):
            raise TypeError(
                  "'infiles' must be a string, or a list or tuple of strings")

        if exec_msg is None:
            exec_msg = "generating %s from %s" % (outfile, ', '.join(infiles))

        # If 'outfile' must be regenerated (either because it doesn't
        # exist, is out-of-date, or the 'force' flag is true) then
        # perform the action that presumably regenerates it
        if self.force or dep_util.newer_group(infiles, outfile):
            self.execute(func, args, exec_msg, level)
        # Otherwise, print the "skip" message
        else:
            log.debug(skip_msg) 
開發者ID:CedricGuillemet,項目名稱:Imogen,代碼行數:33,代碼來源:cmd.py


注:本文中的distutils.util.execute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。