def copyfile(src, dst):
"""Copy data from src to dst"""
if _samefile(src, dst):
raise Error("`%s` and `%s` are the same file" % (src, dst))
for fn in [src, dst]:
try:
st = os.stat(fn)
except OSError:
# File most likely does not exist
pass
else:
# XXX What about other special files? (sockets, devices...)
if stat.S_ISFIFO(st.st_mode):
raise SpecialFileError("`%s` is a named pipe" % fn)
with open(src, 'rb') as fsrc:
with open(dst, 'wb') as fdst:
copyfileobj(fsrc, fdst)
import os, os.path, sys, re import sismaker.utils as utils from shutil import copyfile, rmtree APP_TEMPLATE_FILE = "pyapp_template.tmp" APP_TEMPLATE_FILE_PRE = "pyapp_template_pre_SDK20.tmp"
pkgtmpl = open(os.path.join(tmpldir, PKG_TEMPLATE_FILE)).read()
## copy resource file to temp
copyfile(rsctmpl, os.path.join(self.tempdir, appname+".rsc"))
## copy application files to temp
if os.path.isdir(src):
dstdir = os.path.dirname(dst)
if not os.path.exists(dstdir):
os.makedirs(dstdir)
copyfile(path, dst)
os.path.walk(src, copysrcfile, None)
else:
copyfile(src, os.path.join(self.tempdir, "default.py"))
src/c/p/cpacman-HEAD/cpacman/bundles/trunk-bundle/cpacman/cpacman/pycli/utils.py cpacman(Download)
import getopt import os from shutil import copyfile,copystat from logging import logger
def copy_file(src,dst,test_run=0):
if test_run: return
copyfile(src,dst)
copystat(src,dst)
def delete_file(src,test_run=0):
if test_run: return
src/c/p/cpacman-HEAD/cpacman/bundles/stabilizing-0.7/cpacman/cpacman/pycli/utils.py cpacman(Download)
import getopt import os import re from shutil import copyfile,copystat from logging import logger
def copy_file(src,dst,test_run=0):
if test_run: return
copyfile(src,dst)
copystat(src,dst)
def delete_file(src,test_run=0):
if test_run: return
src/c/p/cpacman-HEAD/cpacman/bundles/release-0.6/cpacman/cpacman/pycli/utils.py cpacman(Download)
import getopt
import os
from shutil import copyfile,copystat
def printDbg(*kwargs):
return
def copy_file(src,dst,test_run=0):
if test_run: return
copyfile(src,dst)
copystat(src,dst)
def delete_file(src,test_run=0):
if test_run: return
src/p/y/pycli-HEAD/dvd_backup/bundles/trunk_bundle/dvd_backup/pycli/utils.py pycli(Download)
import getopt import os from shutil import copyfile,copystat from logging import logger
def copy_file(src,dst,test_run=0):
if test_run: return
copyfile(src,dst)
copystat(src,dst)
def delete_file(src,test_run=0):
if test_run: return
src/p/y/pycli-HEAD/pycli/trunk/lib/utils.py pycli(Download)
import getopt import os from shutil import copyfile,copystat from logging import logger
def copy_file(src,dst,test_run=0):
if test_run: return
copyfile(src,dst)
copystat(src,dst)
def delete_file(src,test_run=0):
if test_run: return
src/b/a/badger-lib-HEAD/packages/sorl-thumbnail/sorl/thumbnail/base.py badger-lib(Download)
import os from os.path import isfile, isdir, getmtime, dirname, splitext, getsize from tempfile import mkstemp from shutil import copyfile from PIL import Image, ImageFilter
format = 'JPEG'
if (self.source_filetype and self.source_filetype == dest_extension and
self.source_data == self.data):
copyfile(self.source, self.dest)
else:
try:
im.save(self.dest, format=format, quality=self.quality,
src/p/y/python-code-snippets-HEAD/CodeSnippets/PyAdmin/modules/editor.py python-code-snippets(Download)
#~ print "Error: backup file exists!"
#~ sys.exit()
from shutil import copyfile
try:
copyfile( file_name, backup_file )
except IOError:
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
copy_files(full_src, full_dest)
else:
copyfile(src_path + "/" + file, dest_path + "/" + file)
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
copy_files(full_src, full_dest)
else:
copyfile(src_path + "/" + file, dest_path + "/" + file)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 Next