Did I find the right examples for you? yes no

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)
str(object='') -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

src/m/y/mykvm-0.3.8/mykvm/main.py   mykvm(Download)
 
    if command == 'init':
        print bcolors.OKGREEN + 'initialize mykvm' + bcolors.ENDC + '\n'
 
        install_data_dir = '/usr/local/share/mykvm'
 
        if not os.path.isfile('mykvm.yml'):
            print bcolors.OKGREEN + '* create mykvm.yml' + bcolors.ENDC
 
        if not os.path.exists('.mykvm/script'):
            print bcolors.OKGREEN + '* copy vmbuilder script' + bcolors.ENDC
            src = install_data_dir + '/script'
            shutil.copytree(src, '.mykvm/script')
            st = os.stat('.mykvm/script/vmbuilder.sh')
            os.chmod('.mykvm/script/vmbuilder.sh', st.st_mode | stat.S_IEXEC)
 
        if not os.path.exists('.mykvm/ansible'):
            print bcolors.OKGREEN + '* copy ansible files' + bcolors.ENDC
        base_image = BASE_IMAGES_PATH + '/' + "precise64.qcow2"
        if not os.path.isfile(base_image):
            print bcolors.OKGREEN + '* build base image ' + base_image + bcolors.ENDC
            cmd = []
            cmd.append(".mykvm/script/vmbuilder.sh")

src/m/y/mykvm-0.3.8/mykvm/command.py   mykvm(Download)
    def restart(self):
        print bcolors.OKGREEN + '* restart network - ' + self.network.get_name() + bcolors.ENDC
 
        cmd = []
 
 
        if self.idx == 1:
            print bcolors.OKGREEN + '* add new nameserver - ' + self.network.get_ip() + bcolors.ENDC + '\n'
            self.modify_resolv_conf()