| Trees | Index | Help |
|
|---|
|
|
|
|||
| LockError | The generic error for locking - it is a subclass of IOError. | ||
| Lock | A simple file lock, compatible with windows and Unixes. | ||
| LockFile | A file like object with an exclusive lock, whilst it is open. | ||
|
|||
|
readlines(filename)
Passed a filename, it reads it, and returns a list of lines. |
|||
|
writelines(filename,
infile,
newline=False)
Given a filename and a list of lines it writes the file. |
|||
|
readbinary(filename)
Given a filename, read a file in binary mode. |
|||
|
writebinary(filename,
infile)
Given a filename and a string, write the file in binary mode. |
|||
|
readfile(filename)
Given a filename, read a file in text mode. |
|||
|
writefile(filename,
infile)
Given a filename and a string, write the file in text mode. |
|||
|
tslash(apath)
Add a trailing slash (/) to a path if it lacks one. |
|||
|
relpath(origin,
dest)
Return the relative path between origin and dest. |
|||
|
splitall(loc)
Return a list of the path components in loc. |
|||
|
walkfiles(D)
Yields full file paths. |
|||
|
walkdirs(thisdir)
Walk through all the subdirectories in a tree. |
|||
|
walkemptydirs(thisdir)
Recursively yield names of empty directories. |
|||
|
formatbytes(sizeint,
configdict=None,
**configs)
Given a file size as an integer, return a nicely formatted string that represents the size. |
|||
|
stringround(main,
rest)
Given a file size in either (mb, kb) or (kb, bytes) - round it appropriately. |
|||
|
bytedivider(nbytes)
Given an integer (probably a long integer returned by os.getsize() ) it returns a tuple of (megabytes, kilobytes, bytes). |
|||
|
fullcopy(src,
dst)
Copy file from src to dst. |
|||
|
import_path(fullpath,
strict=True)
Import a file from the full path. |
|||
|
main_is_frozen()
Return True if we're running from a frozen program. |
|||
|
get_main_dir()
Return the script directory - whether we're frozen or not. |
|||
|
onerror(func,
path,
exc_info)
Error handler for shutil.rmtree. |
|||
|
|||
| __version__ | |||
| join | |||
| isdir | |||
| isfile | |||
| generators | |||
Imports: os, sys, time
|
|||
|
Given a filename and a list of lines it writes the file. (In text mode) If newline is True (default is False) it adds a newline to each line. |
|
|
|
|
Add a trailing slash (/) to a path if it lacks one. It doesn't use os.sep because you end up in trouble on windoze, when you want separators for URLs. |
Return the relative path between origin and dest. If it's not possible return dest. If they are identical return os.curdir Adapted from path.py by Jason Orendorff. |
Return a list of the path components in loc. (Used by relpath_).
The first item in the list will be either ``os.curdir``, ``os.pardir``, empty,
or the root directory of loc (for example, ``/`` or ``C:\).
The other items in the list will be strings.
Adapted from *path.py* by Jason Orendorff.
|
Yields full file paths. Adapted from path.py by Jason Orendorff.
|
|
Recursively yield names of empty directories. These are the only paths omitted when using walkfiles. |
Given a file size as an integer, return a nicely formatted string that represents the size. Has various options to control it's output. You can pass in a dictionary of arguments or keyword arguments. Keyword arguments override the dictionary and there are sensible defaults for options you don't set. Options and defaults are as follows :
of kilobytes and bytes only.
1 Mbytes, 307 Kbytes, 478 bytes it outputs using only the largest denominator - e.g. 1.3 Mbytes or 17.2 Kbytes
notice there is no space. Example outputs : 19Mbytes, 75Kbytes, 255bytes 2Kbytes, 0bytes 23.8Mbytes Note It currently uses the plural form even for singular. |
|
Given an integer (probably a long integer returned by os.getsize() ) it returns a tuple of (megabytes, kilobytes, bytes). This can be more easily converted into a formatted string to display the size of the file. |
Copy file from src to dst. If the dst directory doesn't exist, we will attempt to create it using makedirs. |
Import a file from the full path. Allows you to import from anywhere, something __import__ does not do. If strict is True (the default), raise an ImportError if the module is found in the "wrong" directory. Taken from firedrop2 by Hans Nowak |
|
|
Error handler for shutil.rmtree. If the error is due to an access error (read only file) it attempts to add write permission and then retries. If the error is for another reason it re-raises the error. Usage : shutil.rmtree(path, onerror=onerror) |
|
|||
__version__
|
join
|
isdir
|
isfile
|
generators
|
| Trees | Index | Help |
|
|---|
| Generated by Epydoc 3.0alpha2 on Sat Apr 29 11:03:35 2006 | http://epydoc.sf.net |