Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(21)  |  Call(16)  |  Derive(0)  |  Import(5)
<comment-ja>
??????????

@param src_file: ?????????
@param dest_file: ?????????
@return: ?????????
</comment-ja>
<comment-en>
Copy file
(more...)

        def copy_file(src_file,dest_file):
    """
    
    ??????????

    @param src_file: ?????????
    @param dest_file: ?????????
    @return: ?????????
    
    
    Copy file

    @param src_file: Path to the source file
    @param dest_file: The destination path
    @return: The destination path
    
    """
    #ret = shutil.copy2(src_file, dest_file)
    ret = False
    if os.path.exists(src_file):
        try:
            if dest_file[0] != "/":
                dest_path = "%s/%s" % (os.getcwd(),os.path.dirname(dest_file),)
            else:
                dest_path = os.path.dirname(dest_file)
            if not os.path.exists(dest_path):
                os.makedirs(dest_path)

            (ret, res) = execute_command(["cp","-rfp",src_file,dest_file])
            if ret == 0:
                ret = True
        except:
            return False
    else:
        return False

    return ret
        


src/k/a/karesansui-HEAD/karesansui/lib/virt/virt.py   karesansui(Download)
from karesansui.lib.utils import next_number          as NextNumber
from karesansui.lib.utils import create_disk_img      as MakeDiskImage
from karesansui.lib.utils import copy_file            as CopyFile
from karesansui.lib.net.http import wget              as DownloadFile
from karesansui.lib.utils import is_uuid, get_ifconfig_info, r_chgrp, r_chmod, \
            copy_file_cb(orig_files, dest_files, progresscb, each=False)
        else:
            CopyFile(orig_files, dest_files)
 
        # symlink
 
                    if not os.path.exists(new_disk_path):
                        CopyFile(s_disk_path,new_disk_path)
            except:
                pass
        try:
            # ゲストOSイメージのコピー
            CopyFile(source_disk,disk)
 
            # Storage pool directory, OS image set symlink
                    copy_file_cb(src_files,dst_files,progresscb,each=False)
                else:
                    CopyFile(disk_dir, export_disk_dir)
 
            # -----------------------

src/k/a/karesansui-HEAD/bin/add_bonding.py   karesansui(Download)
    import karesansui
    from karesansui import __version__
    from karesansui.lib.utils import load_locale, execute_command, \
        get_ifconfig_info, is_writable, create_file, \
        copy_file,         move_file,   get_bridge_info, \
        for dev in dev_list:
            if os.path.isfile("%s/ifcfg-%s" % (NETWORK_IFCFG_DIR, dev)):
                copy_file("%s/ifcfg-%s" % (NETWORK_IFCFG_DIR, dev), VENDOR_DATA_BONDING_EVACUATION_DIR)
            if os.path.isfile("%s/ifcfg-p%s" % (NETWORK_IFCFG_DIR, dev)):
                move_file("%s/ifcfg-p%s" % (NETWORK_IFCFG_DIR, dev), VENDOR_DATA_BONDING_EVACUATION_DIR)

src/k/a/karesansui-HEAD/bin/write_conf.py   karesansui(Download)
    from karesansui import __version__
    from karesansui.lib.utils import load_locale
    from karesansui.lib.utils import copy_file
    from karesansui.lib.utils import execute_command
    from karesansui.lib.utils import preprint_r, base64_decode
                for _afile in source_file:
                    _bak_afile = "%s.%s" % (_afile,uniq_id)
                    copy_file(_afile,_bak_afile)
                source_files = source_files + source_file
 
                _bak_afile = "%s.%s" % (_afile,uniq_id)
                os.unlink(_afile)
                copy_file(_bak_afile,_afile)
                os.unlink(_bak_afile)
            raise KssCommandOptException("ERROR: write configure failure")

src/k/a/karesansui-HEAD/bin/apply_lighttpdconf.py   karesansui(Download)
    import karesansui
    from karesansui import __version__
    from karesansui.lib.utils import load_locale, copy_file, remove_file
    from karesansui.lib.const import LIGHTTPD_CONF_TEMP_DIR,\
        LIGHTTPD_PORT_CONFIG, LIGHTTPD_ACCESS_CONFIG, LIGHTTPD_SSL_CONFIG
        try:
            for dest, src in tmp_configfiles.items():
                copy_file(src, opts.dest + '/' + dest)
                remove_file(src)
 

src/k/a/karesansui-HEAD/bin/initialize_collectd_conf.py   karesansui(Download)
    from karesansui import __version__
    from karesansui.lib.utils import load_locale
    from karesansui.lib.utils import copy_file
    from karesansui.lib.utils import execute_command
    from karesansui.lib.utils import preprint_r, base64_decode