Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Functions | |
def | normcase |
def | isabs |
def | join |
def | splitdrive |
def | split |
def | splitext |
def | basename |
def | dirname |
def | commonprefix |
def | getsize |
def | getmtime |
def | getatime |
def | islink |
def | exists |
def | isdir |
def | isfile |
def | ismount |
def | walk |
def | expanduser |
def | expandvars |
def | normpath |
def | abspath |
Variables | |
list | __all__ |
realpath = abspath | |
Common operations on DOS pathnames.
def dospath.abspath | ( | path) |
Return an absolute path.
Definition at line 334 of file dospath.py.
References isabs(), join(), and normpath().
def dospath.commonprefix | ( | m) |
def dospath.dirname | ( | p) |
def dospath.exists | ( | path) |
Does a path exist? This is false for dangling symbolic links.
Definition at line 147 of file dospath.py.
def dospath.expanduser | ( | path) |
Expand paths beginning with '~' or '~user'. '~' means $HOME; '~user' means that user's home directory. If the path doesn't begin with '~', or if the user or $HOME is unknown, the path is returned unchanged (leaving error reporting to whatever function is called with the expanded path as argument). See also module 'glob' for expansion of *, ? and [...] in pathnames. (A function should also be defined to do full *sh-style environment variable expansion.)
Definition at line 213 of file dospath.py.
def dospath.expandvars | ( | path) |
Expand paths containing shell variable substitutions. The following rules apply: - no expansion within single quotes - no escape character, except for '$$' which is translated into '$' - ${varname} is accepted. - varnames can be made out of letters, digits and the character '_'
Definition at line 237 of file dospath.py.
def dospath.getatime | ( | filename) |
Return the last access time of a file, reported by os.stat().
Definition at line 134 of file dospath.py.
def dospath.getmtime | ( | filename) |
Return the last modification time of a file, reported by os.stat().
Definition at line 129 of file dospath.py.
def dospath.getsize | ( | filename) |
Return the size of a file, reported by os.stat().
Definition at line 124 of file dospath.py.
def dospath.isabs | ( | s) |
Return whether a path is absolute. Trivial in Posix, harder on the Mac or MS-DOS. For DOS it is absolute if it starts with a slash or backslash (current volume), or if a pathname after the volume letter and colon starts with a slash or backslash.
Definition at line 24 of file dospath.py.
References splitdrive().
def dospath.isdir | ( | path) |
def dospath.isfile | ( | path) |
def dospath.islink | ( | path) |
Is a path a symbolic link? This will always return false on systems where posix.lstat doesn't exist.
Definition at line 140 of file dospath.py.
def dospath.ismount | ( | path) |
Is a path a mount point?
Definition at line 178 of file dospath.py.
References isabs(), and splitdrive().
def dospath.join | ( | a, | |
p | |||
) |
def dospath.normcase | ( | s) |
Normalize the case of a pathname. On MS-DOS it maps the pathname to lowercase, turns slashes into backslashes. Other normalizations (such as optimizing '../' away) are not allowed (this is done by normpath). Previously, this version mapped invalid consecutive characters to a single '_', but this has been removed. This functionality should possibly be added as a new function.
Definition at line 11 of file dospath.py.
References string.lower().
def dospath.normpath | ( | path) |
Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B. Also, components of the path are silently truncated to 8+3 notation.
Definition at line 298 of file dospath.py.
References join(), split(), and splitdrive().
def dospath.split | ( | p) |
Split a path into head (everything up to the last '/') and tail (the rest). After the trailing '/' is stripped, the invariant join(head, tail) == p holds. The resulting head won't end in '/' unless it is the root.
Definition at line 59 of file dospath.py.
References splitdrive().
def dospath.splitdrive | ( | p) |
Split a path into a drive specification (a drive letter followed by a colon) and path specification. It is always true that drivespec + pathspec == p.
Definition at line 49 of file dospath.py.
def dospath.splitext | ( | p) |
Split a path into root and extension. The extension is everything starting at the first dot in the last pathname component; the root is everything before that. It is always true that root + ext == p.
Definition at line 79 of file dospath.py.
def dospath.walk | ( | top, | |
func, | |||
arg | |||
) |
Directory tree walk with callback function. For each directory in the directory tree rooted at top (including top itself, but excluding '.' and '..'), call func(arg, dirname, fnames). dirname is the name of the directory, and fnames a list of the names of the files and subdirectories in dirname (excluding '.' and '..'). func may modify the fnames list in-place (e.g. via del or slice assignment), and walk will only recurse into the subdirectories whose names remain in fnames; this can be used to implement a filter, or to impose a specific order of visiting. No semantics are defined for, or required of, arg, beyond that arg is always passed to func. It can be used, e.g., to pass a filename pattern, or a mutable object designed to accumulate statistics. Passing None for arg is common.
Definition at line 185 of file dospath.py.
References isdir(), and join().
list __all__ |
Definition at line 6 of file dospath.py.
realpath = abspath |
Definition at line 341 of file dospath.py.