• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(2391)  |  Call(2260)  |  Derive(0)  |  Import(131)
Copy data and mode bits ("cp src dst").

The destination may be a directory.

        def copy(src, dst):
    """Copy data and mode bits ("cp src dst").

    The destination may be a directory.

    """
    if os.path.isdir(dst):
        dst = os.path.join(dst, os.path.basename(src))
    copyfile(src, dst)
    copymode(src, dst)
        


src/p/l/plugnplay-HEAD/examples/filecopy/main.py   plugnplay(Download)
#!/usr/bin/env python
# encoding: utf-8
 
import sys, os
from shutil import copy
from glob import glob
from interfaces import HashChecker
  print "Exiting..."
  sys.exit(1)
 
copy(original_file, where_to_duplicate)
 
for listener in HashChecker.implementors():
  if not listener.check(original_file, where_to_duplicate):

src/i/k/ika-HEAD/trunk/makedist.py   ika(Download)
import sys
import os, os.path
import shutil
import pysvn
 
from shutil import copy, copyfile
from zipfile import ZipFile, is_zipfile
# core.zip
print "Assembling core.zip"
 
copy("engine/Release/ika.exe", core_path)
copy("ikamap/Release/ikaMap.exe", core_path)
 
# Compress exes.
# Windows ZIP
print "Assembling Windows distribution"
 
copy("3rdparty/dlls/corona.dll", win_path)
#copy("3rdparty/dlls/msvcp90.dll", demo_path)
#copy("3rdparty/dlls/msvcr90.dll", demo_path)
copy("3rdparty/dlls/msvcp71.dll", win_path)
copy("3rdparty/dlls/msvcr71.dll", win_path)
copy("3rdparty/dlls/python25.dll", win_path)
copy("3rdparty/dlls/zlib.dll", win_path)
copy("3rdparty/dlls/sdl.dll", win_path)
#copy("3rdparty/dlls/Microsoft.VC90.CRT.manifest", demo_path)
copy("ikamap/Release/ikaMap.exe", win_path)
#copy("3rdparty/dlls/Microsoft.VC90.CRT.manifest", demo_path)
copy("ikamap/Release/ikaMap.exe", win_path)
 
copy("3rdparty/dlls/audiere.dll", demo_path)
copy("3rdparty/dlls/corona.dll", demo_path)
copy("3rdparty/dlls/msvcp71.dll", demo_path)
copy("3rdparty/dlls/msvcr71.dll", demo_path)
copy("3rdparty/dlls/python25.dll", demo_path)
copy("3rdparty/dlls/sdl.dll", demo_path)
copy("3rdparty/dlls/zlib.dll", demo_path)
copy("engine/Release/ika.exe", demo_path)

src/g/a/gajim-HEAD/setup_osx.py   gajim(Download)
from setuptools import setup
import sys, glob, os, commands, types
from os import system, unlink, symlink, getcwd, mkdir, utime
from shutil import move, copy, copytree, rmtree
 
###
### Globals
def setupPrep():
	copy("src/osx/prep_py2app.py", APP_RS)
	move("dist/Gajim.app/Contents/Resources/__boot__.py",
		 "dist/Gajim.app/Contents/Resources/__boot__.py.org")
	new = open("dist/Gajim.app/Contents/Resources/__boot__.py", "w+")
	org = open("dist/Gajim.app/Contents/Resources/__boot__.py.org")
	for line in org:
def finishApp():
	# setup gajim dirs
	copytree("build/inst/share/gajim/data", APP_RS + "/data")
	copy("data/pixmaps/gajim.icns", APP_RS + "/data/pixmaps")
	copytree("build/inst/share/locale", APP_RS + "/locale")
	copytree("build/inst/share/man", APP_RS + "/man")
	force(lambda:unlink("dist/Gajim.app/Contents/data"))
	symlink("Resources/data", "dist/Gajim.app/Contents/data")
	copy("src/gajim-remote.py", "dist/Gajim.app/Contents/Resources")
def distApp():
	force(lambda:rmtree("dist/Gajim"))
	force(lambda:rmtree("dist/Gajim.tar.bz2"))
	mkdir("dist/Gajim")
	check(system("tar -cf - -C dist Gajim.app | tar -xf - -C dist/Gajim"))
	copy("README.osx", "dist/Gajim/README")
	copy("TODO.osx", "dist/Gajim/TODO")

src/i/k/ika-HEAD/makedist.py   ika(Download)
import sys
import os, os.path
import shutil
import pysvn
 
from shutil import copy, copyfile
from zipfile import ZipFile, is_zipfile
# core.zip
print "Assembling core.zip"
 
copy("engine/Release/ika.exe", core_path)
copy("ikamap/Release/ikaMap.exe", core_path)
 
# Compress exes.
# Windows ZIP
print "Assembling Windows distribution"
 
copy("3rdparty/dlls/corona.dll", win_path)
#copy("3rdparty/dlls/msvcp90.dll", demo_path)
#copy("3rdparty/dlls/msvcr90.dll", demo_path)
copy("3rdparty/dlls/msvcp71.dll", win_path)
copy("3rdparty/dlls/msvcr71.dll", win_path)
copy("3rdparty/dlls/python25.dll", win_path)
copy("3rdparty/dlls/zlib.dll", win_path)
copy("3rdparty/dlls/sdl.dll", win_path)
#copy("3rdparty/dlls/Microsoft.VC90.CRT.manifest", demo_path)
copy("ikamap/Release/ikaMap.exe", win_path)
#copy("3rdparty/dlls/Microsoft.VC90.CRT.manifest", demo_path)
copy("ikamap/Release/ikaMap.exe", win_path)
 
copy("3rdparty/dlls/audiere.dll", demo_path)
copy("3rdparty/dlls/corona.dll", demo_path)
copy("3rdparty/dlls/msvcp71.dll", demo_path)
copy("3rdparty/dlls/msvcr71.dll", demo_path)
copy("3rdparty/dlls/python25.dll", demo_path)
copy("3rdparty/dlls/sdl.dll", demo_path)
copy("3rdparty/dlls/zlib.dll", demo_path)
copy("engine/Release/ika.exe", demo_path)

src/l/a/lasttag-HEAD/trunk/lasttag/install.py   lasttag(Download)
 
import os
import sys
from shutil import copy
 
from lasttag import scriptdir, datadir, etcdir, docdir, APPNAME, APPVERSION
 
                    uninstall()   
        print 'Copying lasttag.py to %s...' % (scriptdir)
        os.mkdir(scriptdir)
        copy(os.path.join('scripts', 'lasttag.py'), os.path.join(scriptdir, 'last.tag.py'))
        print 'Copying data files to %s...' % (datadir)
        os.mkdir(datadir)
        copy(os.path.join('data', 'config.dtd'), datadir)
       	copy(os.path.join('data', 'tags.dtd'), datadir)
        print 'Copying etc files to %s...' % (etcdir)
        os.mkdir(etcdir)
        copy(os.path.join('etc', 'config_nt.xml'), os.path.join(etcdir, 'config.xml'))
        copy(os.path.join('etc', 'tags_nt.xml'), os.path.join(etcdir, 'tags.xml'))
        copy(os.path.join('etc', 'tags_nt.xml'), os.path.join(etcdir, 'tags.xml'))
        print 'Copying docs to %s...' % (docdir)
        os.mkdir(docdir)
        copy('AUTHORS', docdir)
        copy('CHANGELOG', docdir)
        copy('COPYING', docdir)
        copy('INSTALL', docdir)
        copy('README', docdir)
        copy('TODO', docdir)
                    print 'Very well. I will remove your config files.'
                    uninstall()   
        print 'Creating last.tag symlink in /usr/bin/...'
        copy(os.path.join('scripts', 'lasttag.py'), os.path.join('/', 'usr', 'lib', 'python2.5', 'site-packages', '%s-%s-py2.5.egg' % (APPNAME, APPVERSION)))
        os.symlink(os.path.join('/', 'usr', 'lib', 'python2.5', 'site-packages', '%s-%s-py2.5.egg' % (APPNAME, APPVERSION), 'lasttag.py'), os.path.join(scriptdir, 'last.tag'))
        print 'Copying data files to %s...' % (datadir)
        os.mkdir(datadir)
        copy(os.path.join('data', 'config.dtd'), datadir)
        copy(os.path.join('data', 'tags.dtd'), datadir)
        print 'Copying etc files to %s...' % (etcdir)
        os.mkdir(etcdir)
        copy(os.path.join('etc', 'config_posix.xml'), os.path.join(etcdir, 'config.xml'))
        copy(os.path.join('etc', 'tags_posix.xml'), os.path.join(etcdir, 'tags.xml'))
        copy(os.path.join('etc', 'tags_posix.xml'), os.path.join(etcdir, 'tags.xml'))
        print 'Copying docs to %s...' % (docdir)
        os.mkdir(docdir)
        copy('AUTHORS', docdir)
        copy('CHANGELOG', docdir)
        copy('COPYING', docdir)
        copy('INSTALL', docdir)
        copy('README', docdir)
        copy('TODO', docdir)

src/l/a/lasttag-HEAD/lasttag/install.py   lasttag(Download)
 
import os
import sys
from shutil import copy
 
from lasttag import scriptdir, datadir, etcdir, docdir, APPNAME, APPVERSION
 
                    uninstall()   
        print 'Copying lasttag.py to %s...' % (scriptdir)
        os.mkdir(scriptdir)
        copy(os.path.join('scripts', 'lasttag.py'), os.path.join(scriptdir, 'last.tag.py'))
        print 'Copying data files to %s...' % (datadir)
        os.mkdir(datadir)
        copy(os.path.join('data', 'config.dtd'), datadir)
       	copy(os.path.join('data', 'tags.dtd'), datadir)
        print 'Copying etc files to %s...' % (etcdir)
        os.mkdir(etcdir)
        copy(os.path.join('etc', 'config_nt.xml'), os.path.join(etcdir, 'config.xml'))
        copy(os.path.join('etc', 'tags_nt.xml'), os.path.join(etcdir, 'tags.xml'))
        copy(os.path.join('etc', 'tags_nt.xml'), os.path.join(etcdir, 'tags.xml'))
        print 'Copying docs to %s...' % (docdir)
        os.mkdir(docdir)
        copy('AUTHORS', docdir)
        copy('CHANGELOG', docdir)
        copy('COPYING', docdir)
        copy('INSTALL', docdir)
        copy('README', docdir)
        copy('TODO', docdir)
                    print 'Very well. I will remove your config files.'
                    uninstall()   
        print 'Creating last.tag symlink in /usr/bin/...'
        copy(os.path.join('scripts', 'lasttag.py'), os.path.join('/', 'usr', 'lib', 'python2.5', 'site-packages', '%s-%s-py2.5.egg' % (APPNAME, APPVERSION)))
        os.symlink(os.path.join('/', 'usr', 'lib', 'python2.5', 'site-packages', '%s-%s-py2.5.egg' % (APPNAME, APPVERSION), 'lasttag.py'), os.path.join(scriptdir, 'last.tag'))
        print 'Copying data files to %s...' % (datadir)
        os.mkdir(datadir)
        copy(os.path.join('data', 'config.dtd'), datadir)
        copy(os.path.join('data', 'tags.dtd'), datadir)
        print 'Copying etc files to %s...' % (etcdir)
        os.mkdir(etcdir)
        copy(os.path.join('etc', 'config_posix.xml'), os.path.join(etcdir, 'config.xml'))
        copy(os.path.join('etc', 'tags_posix.xml'), os.path.join(etcdir, 'tags.xml'))
        copy(os.path.join('etc', 'tags_posix.xml'), os.path.join(etcdir, 'tags.xml'))
        print 'Copying docs to %s...' % (docdir)
        os.mkdir(docdir)
        copy('AUTHORS', docdir)
        copy('CHANGELOG', docdir)
        copy('COPYING', docdir)
        copy('INSTALL', docdir)
        copy('README', docdir)
        copy('TODO', docdir)

src/e/z/ezgallery-HEAD/trunk/util/create_dist.py   ezgallery(Download)
import os
from os.path import join
import re
from shutil import copy, copytree, rmtree
import sys
import zipfile
 
        if can_compile:
            compile(name, join(prog_dir, name + 'c'))
        else:
            copy(name, join(prog_dir, name))
 
    # copy the main script
    #
    copy(main, join(prog_dir, main))
    # copy any important text files
    #
    for filename in text_files:
        copy(filename, join(prog_dir, filename))
 
    # create a zip file of the distribution directory
    #
    #
    path_to_file = join(win_dir, win_file)
    if os.access(path_to_file, os.F_OK):
        copy(path_to_file, join(dist_dir, win_file.lower()))
    else:
        print 'No windows files found'
 

src/e/z/ezgallery-HEAD/util/create_dist.py   ezgallery(Download)
import os
from os.path import join
import re
from shutil import copy, copytree, rmtree
import sys
import zipfile
 
        if can_compile:
            compile(name, join(prog_dir, name + 'c'))
        else:
            copy(name, join(prog_dir, name))
 
    # copy the main script
    #
    copy(main, join(prog_dir, main))
    # copy any important text files
    #
    for filename in text_files:
        copy(filename, join(prog_dir, filename))
 
    # create a zip file of the distribution directory
    #
    #
    path_to_file = join(win_dir, win_file)
    if os.access(path_to_file, os.F_OK):
        copy(path_to_file, join(dist_dir, win_file.lower()))
    else:
        print 'No windows files found'
 

src/s/e/Selenium-HEAD/webdriver/chrome/driver.py   Selenium(Download)
from os.path import expanduser, join, dirname, abspath, isdir, isfile
from sys import platform
from tempfile import mkdtemp
from shutil import copytree, rmtree, copy
from os import environ
 
INITIAL_HTML = '''
            manifest = "manifest-win.json"
        else:
            manifest = "manifest-nonwin.json"
        copy(join(extension_dir, manifest),
             join(extension_dir, "manifest.json"))
        return extension_dir
 
            dll = r"..\..\prebuilt\Win32\Release\npchromedriver.dll"
            assert isfile(dll), "can't find dll"
 
        copy(dll, path)
        manifest = "manifest-win.json"
    else:
        manifest = "manifest-nonwin.json"
    copy(join(path, manifest), join(path, "manifest.json"))

src/i/t/itools-HEAD/fs/lfs.py   itools(Download)
from os.path import exists, getatime, getctime, getmtime ,getsize
from os.path import isfile, isdir, join, basename, dirname
from os.path import abspath, relpath
from shutil import rmtree, copytree, copy as shutil_copy, move as shutil_move
 
# Import from itools
from itools.uri import Path
            copytree(source, target)
        else:
            # Will overwrite target file
            shutil_copy(source, target)
 
 
    def move(self, source, target):

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next