Repository navigation
Suggest non-existing default filename (Implement #3608) - #4221
Conversation
There was a problem hiding this comment.
Can't use this type of string formatting. It was introduced in py2.7 and we support py2.6. You will need "{0}-{1}.{2}" instead.
There was a problem hiding this comment.
Thanks for the catch! It has been fixed via 4da2db8.
|
Can you also add a test? I would suggest something like import tempfile
@cleanup
def test_filename():
test_dir = tempfile.mkdtemp()
rcParams['saving.directory'] = test_dir
target_name = os.path.join(test_dir, 'figure_1.png')
target_name2 = os.path.join(test_dir, 'figure_1-1.png')
fig = plt.figure()
fn = fig.get_default_filename()
assert_equal(fn, target_name)
fig.save_fig(fn)
fn2 = fig.get_default_filename()
assert_equal(fn2, target_name2) |
|
Done. Should the created temp directories/files be cleaned up after the test? From Python docs: "The user of mkdtemp() is responsible for deleting the temporary directory and its contents when done with it." |
|
Yes please to cleaning up the temp directory. On Mon, Mar 16, 2015, 05:13 Umair Idris notifications@github.com wrote:
|
Done. |
ENH : Suggest non-existing default filename in gui save window closes #3608
|
Thanks! |
No description provided.