# See the License for the specific language governing permissions and
# limitations under the License.
-version = '0.1.14'
+version = '0.1.15'
# TODO add package version filling commit id with 0's; e.g.: '5.0.0.post11+00000000.dirty-1'
-date_version = '2018-11-27'
+date_version = '2018-12-05'
def mkdir(self, folder):
raise FsException("Method 'mkdir' not implemented")
+ def dir_rename(self, src, dst):
+ raise FsException("Method 'dir_rename' not implemented")
+
def file_exists(self, storage):
raise FsException("Method 'file_exists' not implemented")
except Exception as e:
raise FsException(str(e), http_code=HTTPStatus.INTERNAL_SERVER_ERROR)
+ def dir_rename(self, src, dst):
+ """
+ Rename one directory name. If dst exist, it replaces (deletes) existing directory
+ :param src: source directory
+ :param dst: destination directory
+ :return: None or raises and exception
+ """
+ try:
+ if os.path.exists(self.path + dst):
+ rmtree(self.path + dst)
+
+ os.rename(self.path + src, self.path + dst)
+
+ except Exception as e:
+ raise FsException(str(e), http_code=HTTPStatus.INTERNAL_SERVER_ERROR)
+
def file_exists(self, storage, mode=None):
"""
Indicates if "storage" file exist
def file_delete(self, storage, ignore_non_exist=False):
"""
- Delete storage content recursivelly
+ Delete storage content recursively
:param storage: can be a str or list of str
:param ignore_non_exist: not raise exception if storage does not exist
:return: None