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

All Samples(5234)  |  Call(4906)  |  Derive(0)  |  Import(328)
rename(old, new)

Rename a file or directory.

src/z/o/zope.app.twisted-3.5.0/src/twisted/python/lockfile.py   zope.app.twisted(Download)
    from os import symlink
    from os import readlink
    from os import remove as rmlink
    from os import rename as mvlink
except:
    # XXX Implement an atomic thingamajig for win32
    import shutil
        f.flush()
        f.close()
        try:
            os.rename(newlinkname, filename)
        except:
            os.remove(newvalname)
            os.rmdir(newlinkname)
    def mvlink(src, dest):
        try:
            shutil.rmtree(dest)
        except:
            pass
        os.rename(src,dest)
 

src/e/d/Editra-0.5.72/src/extern/pkg_resources.py   Editra(Download)
except NameError:
    from sets import ImmutableSet
 
from os import utime, rename, unlink    # capture these to bypass sandboxing
from os import open as os_open
 
def get_supported_platform():
            manager.postprocess(tmpnam, real_path)
 
            try:
                rename(tmpnam, real_path)
 
            except os.error:
                if os.path.isfile(real_path):
                        return real_path
                    elif os.name=='nt':     # Windows, del old file and retry
                        unlink(real_path)
                        rename(tmpnam, real_path)
                        return real_path
                raise
 

src/d/i/distribute-0.6.14/pkg_resources.py   distribute(Download)
# capture these to bypass sandboxing
from os import utime
try:
    from os import mkdir, rename, unlink
    WRITE_SUPPORT = True
except ImportError:
    # no write support, probably under GAE
            manager.postprocess(tmpnam, real_path)
 
            try:
                rename(tmpnam, real_path)
 
            except os.error:
                if os.path.isfile(real_path):
                        return real_path
                    elif os.name=='nt':     # Windows, del old file and retry
                        unlink(real_path)
                        rename(tmpnam, real_path)
                        return real_path
                raise
 

src/m/e/meresco-HEAD/meresco-components/workingsets/2.23.5-EduRep/version_9/merescocomponents/oai/oaijazz.py   meresco(Download)
 
from __future__ import with_statement
from os.path import isdir, join
from os import makedirs, listdir, rename
from storage.storage import escapeName, unescapeName
from time import time, strftime, localtime, mktime, strptime
from merescocomponents.sorteditertools import OrIterator, AndIterator, WrapIterable
def _writeLines(filename, lines):
    with open(filename + '.tmp', 'w') as f:
        for line in lines:
            f.write('%s\n' % line)
    rename(filename + '.tmp', filename)
 
def _write(filename, content):
    with open(filename + '.tmp', 'w') as f:
        f.write(content)
    rename(filename + '.tmp', filename)
            existingSetSpecs = newIdentifier2setSpecs.get(identifier, '').split(SETSPEC_SEPARATOR)
            allSetSpecs = [setSpec]+[s for s in existingSetSpecs if s]
            newIdentifier2setSpecs[identifier] = SETSPEC_SEPARATOR.join(allSetSpecs)
    rename(tmpDir, join(aDirectory, 'identifier2setSpecs'))
 
 
 

src/m/e/meresco-HEAD/meresco-components/workingsets/2.23.5-EduRep/version_8/merescocomponents/oai/oaijazz.py   meresco(Download)
 
from __future__ import with_statement
from os.path import isdir, join
from os import makedirs, listdir, rename
from storage.storage import escapeName, unescapeName
from time import time, strftime, localtime, mktime, strptime
from merescocomponents.sorteditertools import OrIterator, AndIterator, WrapIterable
def _writeLines(filename, lines):
    with open(filename + '.tmp', 'w') as f:
        for line in lines:
            f.write('%s\n' % line)
    rename(filename + '.tmp', filename)
 
def _write(filename, content):
    with open(filename + '.tmp', 'w') as f:
        f.write(content)
    rename(filename + '.tmp', filename)
            existingSetSpecs = newIdentifier2setSpecs.get(identifier, '').split(SETSPEC_SEPARATOR)
            allSetSpecs = [setSpec]+[s for s in existingSetSpecs if s]
            newIdentifier2setSpecs[identifier] = SETSPEC_SEPARATOR.join(allSetSpecs)
    rename(tmpDir, join(aDirectory, 'identifier2setSpecs'))
 
 
 

src/m/e/meresco-HEAD/meresco-components/workingsets/3.4.2-CQ2/version_1/meresco/components/msgbox/msgbox.py   meresco(Download)
from __future__ import with_statement
 
from os.path import join, isdir, isfile, basename, abspath
from os import rename, listdir, remove, makedirs, link
from shutil import rmtree
from traceback import format_exc
from sys import stderr
            else:
                with open(tmpFilePath, 'w') as tmpFile:
                    tmpFile.write(filedata)
            rename(tmpFilePath, outFilepath)
        except:
            self._forgivingRemove(tmpFilePath)
            raise

src/m/e/meresco-HEAD/meresco-components/workingsets/3.4.2-CQ2/version_0/meresco/components/msgbox/msgbox.py   meresco(Download)
from __future__ import with_statement
 
from os.path import join, isdir, isfile, basename, abspath
from os import rename, listdir, remove, makedirs, link
from shutil import rmtree
from traceback import format_exc
from sys import stderr
            else:
                with open(tmpFilePath, 'w') as tmpFile:
                    tmpFile.write(filedata)
            rename(tmpFilePath, outFilepath)
        except:
            self._forgivingRemove(tmpFilePath)
            raise

src/m/e/meresco-HEAD/meresco-components/workingsets/3.4.2-CQ2/version_0-lucene3gcj44/meresco/components/msgbox/msgbox.py   meresco(Download)
from __future__ import with_statement
 
from os.path import join, isdir, isfile, basename, abspath
from os import rename, listdir, remove, makedirs, link
from shutil import rmtree
from traceback import format_exc
from sys import stderr
            else:
                with open(tmpFilePath, 'w') as tmpFile:
                    tmpFile.write(filedata)
            rename(tmpFilePath, outFilepath)
        except:
            self._forgivingRemove(tmpFilePath)
            raise

src/m/e/meresco-HEAD/meresco-components/workingsets/3.3-Edurep/version_1/meresco/components/msgbox/msgbox.py   meresco(Download)
from __future__ import with_statement
 
from os.path import join, isdir, isfile, basename, abspath
from os import rename, listdir, remove, makedirs, link
from shutil import rmtree
from traceback import format_exc, print_exc
from sys import stderr
            else:
                with open(tmpFilePath, 'w') as tmpFile:
                    tmpFile.write(filedata)
            rename(tmpFilePath, outFilepath)
        except:
            self._forgivingRemove(tmpFilePath)
            raise

src/m/e/meresco-HEAD/meresco-components/workingsets/3.3-Edurep/version_0/meresco/components/msgbox/msgbox.py   meresco(Download)
from __future__ import with_statement
 
from os.path import join, isdir, isfile, basename, abspath
from os import rename, listdir, remove, makedirs, link
from shutil import rmtree
from traceback import format_exc
from sys import stderr
            else:
                with open(tmpFilePath, 'w') as tmpFile:
                    tmpFile.write(filedata)
            rename(tmpFilePath, outFilepath)
        except:
            self._forgivingRemove(tmpFilePath)
            raise

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