directories module¶
Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
directories.
getAllOfAFile
(file_dir, ext)[source]¶ Returns a list of all the files the direcotry with the specified file extenstion :param file_dir: Directory to search :param ext: The file extension (IE: ”.py”)
-
directories.
getCacheDir
()[source]¶ Returns the path to the cache folder. This folder is the Application Support folder on OS X, and the Documents Folder on Windows. :return unicode
-
directories.
getDataDir
(path='')[source]¶ Returns the directory where the executable is located (This function is only ran on Windows OS’s)
Parameters: path – Additional directories/files to join to the data directory path :return unicode
-
directories.
getMinecraftLauncherDirectory
()[source]¶ Returns the /minecraft directory, note: may not contain the /saves folder!
-
directories.
getMinecraftProfileDirectory
(profileName)[source]¶ Returns the path to the sent minecraft profile directory
-
directories.
getMinecraftProfileJSON
()[source]¶ Returns a dictionary object with the minecraft profile information
-
directories.
getNewDataDir
(path='')[source]¶ Returns the directory where the executable is located (This function is only ran on Windows OS’s)
Parameters: path – Additional directories/files to join to the data directory path :return unicode
-
directories.
win32_utf8_argv
()[source]¶ Uses shell32.GetCommandLineArgvW to get sys.argv as a list of UTF-8 strings.
Versions 2.5 and older of Python don’t support Unicode in sys.argv on Windows, with the underlying Windows API instead replacing multi-byte characters with ‘?’.
Returns None on failure.
Example usage:
>>> def main(argv=None): ... if argv is None: ... argv = win32_utf8_argv() or sys.argv ...