Permalink
Browse files

Added a copy method to the Directory class.

  • Loading branch information...
Anomareh committed Mar 15, 2012
1 parent 74918cc commit 31c30f778dd628f208011ba002b1fa7fb292f77b
Showing with 10 additions and 0 deletions.
  1. +10 −0 mynt/fs.py
View
@@ -18,6 +18,16 @@ def __init__(self, path):
self.path = abspath(path)
+ def cp(self, dest):
+ dest = Directory(dest)
+
+ if dest.exists:
+ dest.rm()
+
+ logger.debug('.. cp: {0}\n.. dest: {1}'.format(self.path, dest.path))
+
+ shutil.copytree(self.path, dest.path)
+
def empty(self):
if self.exists:
for root, dirs, files in walk(self.path):

0 comments on commit 31c30f7

Please sign in to comment.