All Samples(1049) | Call(1018) | Derive(0) | Import(31)
Copy data and all stat info ("cp -p src dst").
The destination may be a directory.
def copy2(src, dst):
"""Copy data and all stat info ("cp -p 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)
copystat(src, dst)
def copy2(self, src, dst):
return shutil.copy2(src, dst)
def copytree(self, src, dst, symlinks=False):
return shutil.copytree(src, dst, symlinks)
def move(self, src, dst):
src/p/y/pycopia-QA-1.0/pycopia/remote/PosixServer.py pycopia-QA(Download)
def copy2(self, src, dst):
return shutil.copy2(src, dst)
def copytree(self, src, dst, symlinks=False):
return shutil.copytree(src, dst, symlinks)
def move(self, src, dst):
src/p/y/pycopia-HEAD/QA/pycopia/remote/WindowsServer.py pycopia(Download)
def copy2(self, src, dst):
return shutil.copy2(src, dst)
def copytree(self, src, dst, symlinks=False):
return shutil.copytree(src, dst, symlinks)
def move(self, src, dst):
src/p/y/pycopia-QA-1.0/pycopia/remote/WindowsServer.py pycopia-QA(Download)
def copy2(self, src, dst):
return shutil.copy2(src, dst)
def copytree(self, src, dst, symlinks=False):
return shutil.copytree(src, dst, symlinks)
def move(self, src, dst):
src/t/r/translate-HEAD/src/trunk/tools/mozilla/moz_l10n_builder.py translate(Download)
dest = join(temp_po, buildlang, 'browser', 'installer')
for src in srcs:
shutil.copy2(src, dest)
old = join(temp_po, buildlang)
new = join(podir_updated, buildlang)
if os.path.isfile(inst_inc_po):
tempdir = tempfile.mkdtemp()
tmp_po = join(tempdir, 'installer.%s.properties.po' % (lang))
shutil.copy2(inst_po, tmp_po)
inst_inc = join(l10ndir, 'en-US', 'mail', 'installer', 'installer.inc')
tmp_properties = join(tempdir, 'installer.properties')
shutil.copy2(inst_inc, tmp_properties)
except OSError:
pass # Don't worry if the directory already exists
shutil.copy2(
join(enUS, dir, filename),
join(l10ndir, language, dir)
)
src/v/o/votv-HEAD/trunk/platform/windows-xul/setup.py votv(Download)
componentDir = os.path.join(self.dist_dir, 'components')
if not os.access(componentDir, os.F_OK):
os.makedirs(componentDir)
shutil.copy2(self.typeLibrary, componentDir)
# Copy the files indicated in the manifest to create a complete
# application package.
if not os.access(destDir, os.F_OK):
os.makedirs(destDir)
dirsCreated.add(destDir)
shutil.copy2(source, dest)
# Copy required DLLs.
# NEEDS: shared library dependency scan, starting with pyloader
dllDistDir = self.dist_dir
allRuntimes = PYTHON_RUNTIMES + BOOST_RUNTIMES + COMPILER_RUNTIMES
for runtime in allRuntimes:
shutil.copy2(runtime, dllDistDir)
# Copy in our application's resources.
log.info("copying application resources")
copyTreeExceptSvn(self.appResources,
os.path.join(self.dist_dir, 'resources'),
filterOut=['unittest', 'testdata'])
self.copyMovieDataUtil()
shutil.copy2("Democracy.nsi", self.dist_dir)
shutil.copy2("Miro.ico", os.path.join(self.dist_dir, "%s.ico" % (self.getTemplateVariable('shortAppName'))))
# see it in the process list (and in firewall/antivirus
# dialogs, etc.)
log.info("creating executable")
shutil.copy2(os.path.join(STUB_PATH, "%s.exe" % (self.getTemplateVariable('shortAppName'))), self.dist_dir)
os.rename(os.path.join(self.xulrunnerOut, "xulrunner.exe"),
os.path.join(self.xulrunnerOut, "%s.exe" % (self.getTemplateVariable('shortAppName'))))
os.remove(os.path.join(self.xulrunnerOut, "xulrunner-stub.exe"))
def buildDownloadDaemon(self, baseDir):
print "building download daemon"
os.system("%s setup_daemon.py py2exe --dist-dir daemon --bundle-files 1" % PYTHON_BINARY)
shutil.copy2(os.path.join("daemon","%s_Downloader.exe" % (self.getTemplateVariable('shortAppName'))), baseDir)
def buildMovieDataUtil(self):
print "building movie data utility"
def copyMovieDataUtil(self):
print "building movie data utility to dist"
built_exe = os.path.join(self.bdist_base, 'Miro_MovieData.exe')
shutil.copy2(built_exe, self.dist_dir)
shutil.copy2("moviedata_util.py", self.dist_dir)
# NEEDS: if you look at the usage of this function, we're dropping
pluginFiles = ['libvlc.dll', 'npvlc.dll', 'vlcintf.xpt']
for f in pluginFiles:
shutil.copy2(os.path.join(VLC_MOZ_PLUGIN_DIR, f), destDir)
vlcPluginDest = os.path.join(baseDir, "vlc-plugins")
if not os.access(vlcPluginDest, os.F_OK):
os.mkdir(vlcPluginDest)
vlcPlugins = os.listdir(VLC_PLUGINS_DIR)
for f in vlcPlugins:
if f[0] != '.' and f != '_svn':
shutil.copy2(os.path.join(VLC_PLUGINS_DIR, f), vlcPluginDest)
def copyMiscFiles(self, destDir):
shutil.copy2(os.path.join(root,"license.txt"),destDir)
def compileIDL(self):
buildDir = os.path.join(self.bdist_base, "idl")
pattern = re.compile(r"(.*)\.idl$")
xpidl = os.path.join(IDL_TOOLS_PATH, "xpidl")
if os.path.isdir(srcname):
copyTreeExceptSvn(srcname, destname, filterOut)
else:
shutil.copy2(srcname, destname)
if __name__ == "__main__":
setup(
src/a/u/audiere-HEAD/trunk/audiere/third-party/scons-local-1.2.0/SCons/compat/__init__.py audiere(Download)
shutil.copytree(src, dst, symlinks=True)
shutil.rmtree(src)
else:
shutil.copy2(src,dst)
os.unlink(src)
shutil.move = move
del move
src/m/r/mrv-1-1.0.0-preview2/path.py MRV(Download)
def copy2(self, dest): """Shutil.copy2 self to dest :return: Path to dest""" shutil.copy2( self._expandvars(), dest ) return type(self)(dest)
src/a/u/audiere-HEAD/audiere/third-party/scons-local-1.2.0/SCons/compat/__init__.py audiere(Download)
shutil.copytree(src, dst, symlinks=True)
shutil.rmtree(src)
else:
shutil.copy2(src,dst)
os.unlink(src)
shutil.move = move
del move
src/v/o/votv-HEAD/platform/windows-xul/setup.py votv(Download)
componentDir = os.path.join(self.dist_dir, 'components')
if not os.access(componentDir, os.F_OK):
os.makedirs(componentDir)
shutil.copy2(self.typeLibrary, componentDir)
# Copy the files indicated in the manifest to create a complete
# application package.
if not os.access(destDir, os.F_OK):
os.makedirs(destDir)
dirsCreated.add(destDir)
shutil.copy2(source, dest)
# Copy required DLLs.
# NEEDS: shared library dependency scan, starting with pyloader
dllDistDir = self.dist_dir
allRuntimes = PYTHON_RUNTIMES + BOOST_RUNTIMES + COMPILER_RUNTIMES
for runtime in allRuntimes:
shutil.copy2(runtime, dllDistDir)
# Copy in our application's resources.
log.info("copying application resources")
copyTreeExceptSvn(self.appResources,
os.path.join(self.dist_dir, 'resources'),
filterOut=['unittest', 'testdata'])
self.copyMovieDataUtil()
shutil.copy2("Democracy.nsi", self.dist_dir)
shutil.copy2("Miro.ico", os.path.join(self.dist_dir, "%s.ico" % (self.getTemplateVariable('shortAppName'))))
# see it in the process list (and in firewall/antivirus
# dialogs, etc.)
log.info("creating executable")
shutil.copy2(os.path.join(STUB_PATH, "%s.exe" % (self.getTemplateVariable('shortAppName'))), self.dist_dir)
os.rename(os.path.join(self.xulrunnerOut, "xulrunner.exe"),
os.path.join(self.xulrunnerOut, "%s.exe" % (self.getTemplateVariable('shortAppName'))))
os.remove(os.path.join(self.xulrunnerOut, "xulrunner-stub.exe"))
def buildDownloadDaemon(self, baseDir):
print "building download daemon"
os.system("%s setup_daemon.py py2exe --dist-dir daemon --bundle-files 1" % PYTHON_BINARY)
shutil.copy2(os.path.join("daemon","%s_Downloader.exe" % (self.getTemplateVariable('shortAppName'))), baseDir)
def buildMovieDataUtil(self):
print "building movie data utility"
def copyMovieDataUtil(self):
print "building movie data utility to dist"
built_exe = os.path.join(self.bdist_base, 'Miro_MovieData.exe')
shutil.copy2(built_exe, self.dist_dir)
shutil.copy2("moviedata_util.py", self.dist_dir)
# NEEDS: if you look at the usage of this function, we're dropping
pluginFiles = ['libvlc.dll', 'npvlc.dll', 'vlcintf.xpt']
for f in pluginFiles:
shutil.copy2(os.path.join(VLC_MOZ_PLUGIN_DIR, f), destDir)
vlcPluginDest = os.path.join(baseDir, "vlc-plugins")
if not os.access(vlcPluginDest, os.F_OK):
os.mkdir(vlcPluginDest)
vlcPlugins = os.listdir(VLC_PLUGINS_DIR)
for f in vlcPlugins:
if f[0] != '.' and f != '_svn':
shutil.copy2(os.path.join(VLC_PLUGINS_DIR, f), vlcPluginDest)
def copyMiscFiles(self, destDir):
shutil.copy2(os.path.join(root,"license.txt"),destDir)
def compileIDL(self):
buildDir = os.path.join(self.bdist_base, "idl")
pattern = re.compile(r"(.*)\.idl$")
xpidl = os.path.join(IDL_TOOLS_PATH, "xpidl")
if os.path.isdir(srcname):
copyTreeExceptSvn(srcname, destname, filterOut)
else:
shutil.copy2(srcname, destname)
if __name__ == "__main__":
setup(
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next