|
tuple | ALLOWED_MODES = frozenset(['r', 'rb', 'U', 'rU']) |
|
tuple | ALLOWED_FILES |
|
tuple | ALLOWED_DIRS |
|
tuple | os_source_location = inspect.getsourcefile(os) |
|
File sub-class that enforces the restrictions of production.
def google.appengine.tools.devappserver2.python.stubs.FakeFile.__init__ |
( |
|
self, |
|
|
|
filename, |
|
|
|
mode = 'r' , |
|
|
|
bufsize = -1 , |
|
|
|
kwargs |
|
) |
| |
Initializer. See file built-in documentation.
def google.appengine.tools.devappserver2.python.stubs.FakeFile.is_file_accessible |
( |
|
filename | ) |
|
|
static |
Determines if a file is accessible.
set_allowed_paths(), set_skip_files() and SetStaticFileConfigMatcher() must
be called before this method or else all file accesses will raise an error.
Args:
filename: Path of the file to check (relative or absolute). May be a
directory, in which case access for files inside that directory will
be checked.
Returns:
True if the file is accessible, False otherwise.
Raises:
TypeError: filename is not a basestring.
def google.appengine.tools.devappserver2.python.stubs.FakeFile.set_allowed_paths |
( |
|
root_path, |
|
|
|
application_paths |
|
) |
| |
|
static |
Configures which paths are allowed to be accessed.
Must be called at least once before any file objects are created in the
hardened environment.
Args:
root_path: Absolute path to the root of the application.
application_paths: List of additional paths that the application may
access, this must include the App Engine runtime but not the Python
library directories.
def google.appengine.tools.devappserver2.python.stubs.FakeFile.set_skip_files |
( |
|
skip_files | ) |
|
|
static |
Configure the skip_files regex.
Files that match this regex are inaccessible in the hardened environment.
Must be called at least once before any file objects are created in the
hardened environment.
Args:
skip_files: A str containing a regex to match against file paths.
def google.appengine.tools.devappserver2.python.stubs.FakeFile.set_static_files |
( |
|
static_files | ) |
|
|
static |
Configure the static_files regex.
Files that match this regex are inaccessible in the hardened environment.
Must be called at least once before any file objects are created in the
hardened environment.
Args:
static_files: A str containing a regex to match against file paths.
tuple google.appengine.tools.devappserver2.python.stubs.FakeFile.ALLOWED_DIRS |
|
static |
Initial value:
2 os.path.normcase(os.path.realpath(os.path.dirname(os.__file__))),
3 os.path.normcase(os.path.abspath(os.path.dirname(os.__file__))),
4 os.path.normcase(os.path.dirname(os.path.realpath(os.__file__))),
5 os.path.normcase(os.path.dirname(os.path.abspath(os.__file__))),
tuple google.appengine.tools.devappserver2.python.stubs.FakeFile.ALLOWED_FILES |
|
static |
Initial value: 1 = set(os.path.normcase(filename)
2 for filename
in mimetypes.knownfiles
3 if os.path.isfile(filename))
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/tools/devappserver2/python/stubs.py