• 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/l/a/Langtangen-HEAD/src/py/examples/q4w/q4w-generate.py   Langtangen(Download)
        if not os.path.isfile(fullname):
            print fullname, 'does not exist - ??'; sys.exit(1)
        else:
            shutil.copy(fullname, file)
    else:
        # we do not have the scripting software available,
        # assume that the q4w files are collected in a directory
        # (the files will then be copied from this (parent) dir)
        fullname = os.path.join(os.pardir,file)
        if not os.path.isfile(fullname):
            print fullname, 'does not exist - ??'; sys.exit(1)
        else:
            shutil.copy(fullname, file)
copy('colorline.gif')
copy('percent.gif')
copy('QAdata.py')
shutil.copy(os.path.join(os.pardir,q4wfilename), os.curdir)
 
# we need language-specific text for the submit and reset buttons:
try:
# write a little script reset that resets the database
# by making empty .dball and ans.html file and copying
# .dbsum.0 to .dbsum
shutil.copy(filenamebase+'.dbsum',filenamebase+'.dbsum'+'.0')
f = open('reset_database', 'w')
f.write("""\
#!/bin/sh -x

src/c/h/changingsong-HEAD/trunk/samples/plugin_sys/yapsy/yapsy/AutoInstallPluginManager.py   changingsong(Download)
			try:
				shutil.copytree(plugin_info.path,
								os.path.join(self.install_dir,os.path.basename(plugin_info.path)))
				shutil.copy(os.path.join(directory, plugin_info_filename),
							self.install_dir)
			except:
				logging.error("Could not install plugin: %s." % plugin_info.name)
				return False
			else:
				return True
		elif os.path.isfile(plugin_info.path+".py"):
			try:
				shutil.copy(plugin_info.path+".py",
			try:
				shutil.copy(plugin_info.path+".py",
							self.install_dir)
				shutil.copy(os.path.join(directory, plugin_info_filename),
						   self.install_dir)
			except:
				logging.error("Could not install plugin: %s." % plugin_info.name)

src/c/h/changingsong-HEAD/samples/plugin_sys/yapsy/yapsy/AutoInstallPluginManager.py   changingsong(Download)
			try:
				shutil.copytree(plugin_info.path,
								os.path.join(self.install_dir,os.path.basename(plugin_info.path)))
				shutil.copy(os.path.join(directory, plugin_info_filename),
							self.install_dir)
			except:
				logging.error("Could not install plugin: %s." % plugin_info.name)
				return False
			else:
				return True
		elif os.path.isfile(plugin_info.path+".py"):
			try:
				shutil.copy(plugin_info.path+".py",
			try:
				shutil.copy(plugin_info.path+".py",
							self.install_dir)
				shutil.copy(os.path.join(directory, plugin_info_filename),
						   self.install_dir)
			except:
				logging.error("Could not install plugin: %s." % plugin_info.name)

src/p/y/pygccxml-HEAD/pyplusplus_dev/examples/pyeasybmp_dev/boost.python/pyeasybmp/build_setup.py   pygccxml(Download)
        files.append( os.path.join( environment.settings.boost_libs_path, 'libboost_python.so.1.33.1' ) )
 
    for f in files:
        shutil.copy( f, target_dir )

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/m/o/modu-HEAD/examples/modusite/modusite/scripts/release.py   modu(Download)
	for item in os.listdir(os.path.join(source, 'dist')):
		if(item not in existing):
			filename = item
			shutil.copy(os.path.join(source, 'dist', item), destination)
			break
	else:
		raise IOError("Tarball not found.")

src/p/y/python-cookbook-HEAD/cb2_examples/cb2_2_29_sol_1.py   python-cookbook(Download)
             new_file = '%s.%03d' % (root, i)
             if not os.path.exists(new_file):
                  if vtype == 'copy':
                      shutil.copy(file_spec, new_file)
                  else:
                      os.rename(file_spec, new_file)
                  return True

src/m/o/modu-1.0.2/examples/modusite/modusite/scripts/release.py   modu(Download)
	for item in os.listdir(os.path.join(source, 'dist')):
		if(item not in existing):
			filename = item
			shutil.copy(os.path.join(source, 'dist', item), destination)
			break
	else:
		raise IOError("Tarball not found.")

src/p/y/pycopia-HEAD/QA/pycopia/remote/PosixServer.py   pycopia(Download)
    def copy(self, src, dst):
        return shutil.copy(src, dst)
 
    def copy2(self, src, dst):
        return shutil.copy2(src, dst)
 
    def copytree(self, src, dst, symlinks=False):

src/c/a/caspin-HEAD/trunk/dev/create_win32_release.py   caspin(Download)
	print ">> extensions"
	files.copy("../tamarin/extensions/*.h",		target + "/caspin/tamarin/extensions/")
 
	shutil.copy("../tamarin/core/builtin.abc",			target + "/caspin/tamarin/core/")
	shutil.copy("../tamarin/shell/avmshell-features.h",	target + "/caspin/tamarin/shell/")
	shutil.copy("../tamarin/utils/asc.jar",				target + "/caspin/tamarin/utils/")
	shutil.copy("../tamarin/utils/nativegen.py",			target + "/caspin/tamarin/utils/")
 
	#vc9_release
	# avmplus
	shutil.copy(obj_dir + "avmplus/Release/avmplus.lib",			lib_release)
	shutil.copy(obj_dir + "avmplus/Debug/avmplus.lib",				lib_debug)
	shutil.copy(obj_dir + "avmplus/Release_Debugger/avmplus.lib",	lib_release + "avmplus_debugger.lib")
	shutil.copy(obj_dir + "avmplus/Debug_Debugger/avmplus.lib",		lib_debug + "avmplus_debugger.lib")
 
	# eval
	shutil.copy(obj_dir + "eval/Release/eval.lib",				lib_release)
	shutil.copy(obj_dir + "eval/Debug/eval.lib",				lib_debug)
	shutil.copy(obj_dir + "eval/Release_Debugger/eval.lib",		lib_release + "eval_debugger.lib")
	shutil.copy(obj_dir + "eval/Debug_Debugger/eval.lib",		lib_debug + "eval_debugger.lib")
	shutil.copy(obj_dir + "eval/Debug_Debugger/eval.lib",		lib_debug + "eval_debugger.lib")
 
	# MMgc
	shutil.copy(obj_dir + "MMgc/Release/MMgc.lib",			lib_release + "MMgc.lib")
	shutil.copy(obj_dir + "MMgc/Debug/MMgc_d.lib",			lib_debug + "MMgc.lib")
	shutil.copy(obj_dir + "MMgc/Release_Debugger/MMgc.lib",	lib_release + "MMgc_debugger.lib")
	shutil.copy(obj_dir + "MMgc/Debug_Debugger/MMgc_d.lib",	lib_debug + "MMgc_debugger.lib")
 
	# nanojit
	shutil.copy(obj_dir + "nanojit/Release/nanojit.lib",			lib_release)
	shutil.copy(obj_dir + "nanojit/Debug/nanojit.lib",				lib_debug)
	shutil.copy(obj_dir + "nanojit/Release_Debugger/nanojit.lib",	lib_release + "nanojit_debugger.lib")
	shutil.copy(obj_dir + "nanojit/Debug_Debugger/nanojit.lib",		lib_debug + "nanojit_debugger.lib")
def copy_tamarin_libs_vc10():
 
	obj_dir = "../tamarin/platform/win32/obj2010/"
	lib_release = "vc10/caspin/lib/Release/"
	lib_debug = "vc10/caspin/lib/Debug/"
 
	shutil.copy(obj_dir + "Release/avm.lib",			lib_release)
	shutil.copy(obj_dir + "Debug/avm.lib",				lib_debug)
	shutil.copy(obj_dir + "Release_Debugger/avm.lib",	lib_release + "avm_debugger.lib")
	shutil.copy(obj_dir + "Debug_Debugger/avm.lib",		lib_debug + "avm_debugger.lib")
files.copy("../lib/Debug/*.lib", target + "/caspin/lib/Debug/")
 
print "copying caspin tools"
shutil.copy("../tools/cspcompile.py", target + "/caspin/tools/")
shutil.copy("../tools/cspgenerate.py", target + "/caspin/tools/")
 
print "copying tamarin headers"

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