mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
44 lines
1.7 KiB
Python
44 lines
1.7 KiB
Python
# Stubs for tempfile
|
|
# Ron Murawski <ron@horizonchess.com>
|
|
|
|
# based on http://docs.python.org/3.3/library/tempfile.html
|
|
# Adapted for Python 2.7 by Michal Pokorny
|
|
|
|
from typing import Tuple, IO
|
|
|
|
# global variables
|
|
tempdir = ... # type: str
|
|
template = ... # type: str
|
|
|
|
# TODO text files
|
|
|
|
# function stubs
|
|
def TemporaryFile(
|
|
mode: basestring = ..., bufsize: int = ..., suffix: basestring = ...,
|
|
prefix: basestring = ..., dir: basestring = ...) -> IO[str]: ...
|
|
def NamedTemporaryFile(
|
|
mode: basestring = ..., bufsize: int = ..., suffix: basestring = ...,
|
|
prefix: basestring = ..., dir: basestring = ..., delete: bool = ...
|
|
) -> IO[str]: ...
|
|
def SpooledTemporaryFile(
|
|
max_size: int = ..., mode: basestring = ..., buffering: int = ...,
|
|
suffix: basestring = ..., prefix: basestring = ..., dir: basestring = ...) -> IO[str]:
|
|
...
|
|
|
|
class TemporaryDirectory:
|
|
name = ... # type: basestring
|
|
def __init__(self, suffix: basestring = ..., prefix: basestring = ...,
|
|
dir: basestring = ...) -> None: ...
|
|
def cleanup(self) -> None: ...
|
|
def __enter__(self) -> basestring: ...
|
|
def __exit__(self, type, value, traceback) -> bool: ...
|
|
|
|
def mkstemp(suffix: basestring = ..., prefix: basestring = ..., dir: basestring = ...,
|
|
text: bool = ...) -> Tuple[int, basestring]: ...
|
|
def mkdtemp(suffix: basestring = ..., prefix: basestring = ...,
|
|
dir: basestring = ...) -> basestring: ...
|
|
def mktemp(suffix: basestring = ..., prefix: basestring = ...,
|
|
dir: basestring = ...) -> basestring: ...
|
|
def gettempdir() -> basestring: ...
|
|
def gettempprefix() -> basestring: ...
|