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


Python stdout.green函数代码示例

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


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

示例1: initramfs

def initramfs(temproot, extract, to, verbose):
    """
    Extract user initramfs

    @return: bool
    """
    # copy initramfs to /usr/src/linux/usr/initramfs_data.cpio.gz, should we care?
    print green(' * ') + turquoise('initramfs.extract.initramfs ') + 'to ' + to

    # clean previous root
    if os.path.isdir(to):
        from time import strftime
        os.system('mv %s %s-%s ' % (to, to, strftime("%Y-%m-%d-%H-%M-%S")))
    process('mkdir -p %s' % to, verbose)

    # create dir if needed
    if not os.path.isdir(to):
        os.makedirs(to)

    process('cp %s %s/initramfs_data.cpio.gz' % (extract, to), verbose)

    # extract gzip archive
    process('gzip -d -f %s/initramfs_data.cpio.gz' % to, verbose)

    # extract cpio archive
    os.chdir(to)
    os.system('cpio -id < initramfs_data.cpio &>/dev/null')
    os.system('rm initramfs_data.cpio')
开发者ID:ac1965,项目名称:kigen,代码行数:28,代码来源:extract.py

示例2: import_user_initramfs

    def import_user_initramfs(self, initramfs_from_cli_or_config):
        """
        Import user initramfs into the kernel

        @return: bool
        """
        kinitramfsdir = self.temp['initramfs']

        # copy initramfs to /usr/src/linux/usr/initramfs_data.cpio.gz, should we care?
        print green(' * ') + turquoise('kernel.import_user_initramfs ') + initramfs_from_cli_or_config
        process('cp %s %s/usr/initramfs_data.cpio.gz' % (initramfs_from_cli_or_config, self.kerneldir), self.verbose)

        # extract gzip archive
        process('gzip -d -f %s/usr/initramfs_data.cpio.gz' % self.kerneldir, self.verbose)

        # clean previous root
        if os.path.isdir(kinitramfsdir):
            from time import strftime
            os.system('mv %s %s-%s ' % (kinitramfsdir, kinitramfsdir, str(strftime("%Y-%m-%d-%H-%M-%S"))))
        process('mkdir -p %s' % kinitramfsdir, self.verbose)

        # copy initramfs to /usr/src/initramfs/
        os.system('cp %s/usr/initramfs_data.cpio %s ' % (self.kerneldir, kinitramfsdir))

        # extract cpio archive
        self.chgdir(kinitramfsdir)
        os.system('cpio -id < initramfs_data.cpio &>/dev/null')
        os.system('rm initramfs_data.cpio')
开发者ID:ac1965,项目名称:kigen,代码行数:28,代码来源:kernel.py

示例3: strip

    def strip(self):
        """
        Busybox binary strip routine
        """
        print green(" * ") + "... busybox.strip"
        self.chgdir(self.bb_tmp)

        return os.system("strip %s/busybox " % (self.bb_tmp))
开发者ID:ac1965,项目名称:kigen,代码行数:8,代码来源:busybox.py

示例4: extract

 def extract(self):
     """
     screen tarball extraction routine
 
     @return: bool
     """
     print green(' * ') + '... screen.extract'
 
     os.system('tar xvfz %s/screen-%s.tar.gz -C %s %s' % (get_distdir(self.temp), str(self.screen_ver), self.temp['work'], self.verbose['std']))
开发者ID:ac1965,项目名称:kigen,代码行数:9,代码来源:screen.py

示例5: rsakey

    def rsakey(self):
        """
        dropbear rsakey creation
        """
        print green(' * ') + '... dropbear.rsakey'
        self.chgdir(self.dropbeartmp)
        process('mkdir -p %s/etc/dropbear' % self.dropbeartmp, self.verbose)

        return process('./dropbearkey -t rsa -s 4096 -f %s/etc/dropbear/dropbear_rsa_host_key' % self.dropbeartmp, self.verbose)
开发者ID:ac1965,项目名称:kigen,代码行数:9,代码来源:dropbear.py

示例6: extract

    def extract(self):
    	"""
    	lvm2 tarball extraction routine
    
    	@return: bool
    	"""
    	print green(' * ') + '... lvm2.extract'

    	os.system('tar xvfz %s/LVM2.%s.tgz -C %s %s' % (get_distdir(self.temp), self.lvm2_ver, self.temp['work'], self.verbose['std']))
开发者ID:ac1965,项目名称:kigen,代码行数:9,代码来源:lvm2.py

示例7: extract

 def extract(self):
     """
     dmraid tarball extraction routine
 
     @return: bool
     """
     print green(' * ') + '... dmraid.extract'
 
     os.system('tar xvfj %s/dmraid-%s.tar.bz2 -C %s %s' % (get_distdir(self.temp), str(self.dmraid_ver), self.temp['work'], self.verbose['std']))
开发者ID:ac1965,项目名称:kigen,代码行数:9,代码来源:dmraid.py

示例8: patch_debug_header

    def patch_debug_header(self):
        """
        Patch debug.h by adding
        #define DEBUG_TRACE
        """
        print green(' * ') + '... dropbear.patch_debug_header #define DEBUG_TRACE'
        self.chgdir(self.dropbeartmp)

        return os.system('mv debug.h debug.h.tmp && echo "#define DEBUG_TRACE" > debug.h && cat debug.h.tmp >> debug.h && rm debug.h.tmp')
开发者ID:ac1965,项目名称:kigen,代码行数:9,代码来源:dropbear.py

示例9: dsskey

    def dsskey(self):
        """
        dropbear dsskey creation
        """
        print green(' * ') + '... dropbear.dsskey'
        self.chgdir(self.dropbeartmp)
        process('mkdir -p %s/etc/dropbear' % self.dropbeartmp, self.verbose)

        return process('./dropbearkey -t dss -f %s/etc/dropbear/dropbear_dss_host_key' % self.dropbeartmp, self.verbose)
开发者ID:ac1965,项目名称:kigen,代码行数:9,代码来源:dropbear.py

示例10: extract

    def extract(self):
    	"""
    	Extract device-mapper tarball
    
    	@return: bool
    	"""
    	print green(' * ') + '... device_mapper.extract'

    	os.system('tar xvfz %s/device-mapper.%s.tgz -C %s %s' % (utils.get_distdir(self.temp), self.dm_ver, self.temp['work'], self.verbose['std']))
开发者ID:ac1965,项目名称:kigen,代码行数:9,代码来源:device_mapper.py

示例11: strip

 def strip(self):
 	"""
 	Strip dmsetup binary
 
 	@return: bool
 	"""
 	print green(' * ') + '... device_mapper.strip'
 	self.chgdir(self.temp['work'])
 
 	return os.system('strip %s/device-mapper/sbin/dmsetup' % (self.temp['work']))
开发者ID:ac1965,项目名称:kigen,代码行数:10,代码来源:device_mapper.py

示例12: configure

    def configure(self):
    	"""
    	Configure device-mapper source code

    	@return: bool
    	"""
    	print green(' * ') + '... device_mapper.configure'
    	self.chgdir(self.dm_tmp)
    
    	return os.system('./configure --prefix=%s/device-mapper --enable-static_link --disable-selinux %s' % (self.temp['work'], self.verbose['std']))
开发者ID:ac1965,项目名称:kigen,代码行数:10,代码来源:device_mapper.py

示例13: configure

 def configure(self):
     """
     dmraid Makefile interface to configure
 
     @return: bool
     """
     print green(' * ') + '... dmraid.configure'
     self.chgdir(self.dmraidtmp)
 
     return os.system('LIBS=-ldevmapper ./configure --enable-static_link %s' % self.verbose['std'])
开发者ID:ac1965,项目名称:kigen,代码行数:10,代码来源:dmraid.py

示例14: cache

 def cache(self):
     """
     dmraid tarball cache routine
 
     @return: bool
     """
     print green(' * ') + '... dmraid.cache'
     self.chgdir(self.dmraidtmp)
 
     return process('mv %s/tools/dmraid.bz2 %s/dmraid.static-%s.bz2' % (self.dmraidtmp, self.temp['cache'], self.dmraid_ver), self.verbose)
开发者ID:ac1965,项目名称:kigen,代码行数:10,代码来源:dmraid.py

示例15: compress

    def compress(self):
        """
        blkid compression routine
    
        @return: bool
        """
        print green(" * ") + "... luks.compress"
        self.chgdir(self.lukstmp)

        return process("bzip2 %s/src/cryptsetup" % self.lukstmp, self.verbose)
开发者ID:ac1965,项目名称:kigen,代码行数:10,代码来源:luks.py


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