From 95edc4d397a44310679ef0999b63698a97e5b38a Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 23 Sep 2018 14:54:56 -0700 Subject: [PATCH] Add method Photo.move_file. --- etiquette/objects.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etiquette/objects.py b/etiquette/objects.py index 5c00b92..c344821 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -906,6 +906,14 @@ class Photo(ObjectBase): hopeful_filepath = folder.with_child(basename + '.jpg') return hopeful_filepath + # Photo.rename_file already has @required_feature + # Photo.rename_file already has @transaction + def move_file(self, directory, commit=True): + directory = pathclass.Path(directory) + directory.assert_is_directory() + new_path = directory.with_child(self.real_path.basename).absolute_path + self.rename_file(new_path, move=True, commit=commit) + #@decorators.time_me @decorators.required_feature('photo.reload_metadata') @decorators.transaction