-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe0d3cb
commit e37444b
Showing
4 changed files
with
120 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from tempfile import ( | ||
_get_candidate_names, | ||
_get_default_tempdir | ||
) | ||
from os import ( | ||
path as os_path, | ||
remove as os_remove | ||
) | ||
def tmp_filepath(suffix=''): | ||
return os_path.join( | ||
_get_default_tempdir(), | ||
next(_get_candidate_names()) | ||
) + suffix | ||
|
||
def clean_file(fn): | ||
if os_path.exists(fn): | ||
# f.close() | ||
os_remove(fn) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters