Example #1
0
 def empty(self):
     if self.exists:
         for root, dirs, files in walk(self.path):
             for d in dirs[:]:
                 if not d.startswith(('.', '_')):
                     Directory(abspath(root, d)).rm()
                 
                 dirs.remove(d)
             
             for f in files:
                 if not f.startswith(('.', '_')):
                     File(abspath(root, f)).rm()
Example #2
0
File: fs.py Project: NaPs/mynt
 def empty(self):
     if self.exists:
         for root, dirs, files in walk(self.path):
             for d in dirs[:]:
                 if not d.startswith(('.', '_')):
                     Directory(abspath(root, d)).rm()
                 
                 dirs.remove(d)
             
             for f in files:
                 if not f.startswith(('.', '_')):
                     File(abspath(root, f)).rm()
Example #3
0
File: fs.py Project: jimfmunro/mynt
 def empty(self):
     if self.exists:
         for root, dirs, files in walk(self.path):
             for d in dirs[:]:
                 if not d.startswith(('.', '_')) and d not in ['img', 'images']:
                     Directory(abspath(root, d)).rm()
                 
                 dirs.remove(d)
             
             for f in files:
                 if not f.startswith(('.', '_')) and not f.endswith('.jpg'):
                     File(abspath(root, f)).rm()
Example #4
0
File: fs.py Project: NaPs/mynt
 def __init__(self, path):
     self.path = abspath(path)
     
     if self.is_root:
         raise FileSystemException('Root is not an acceptible directory.')
Example #5
0
File: fs.py Project: NaPs/mynt
 def __init__(self, path, content = None):
     self.path = abspath(path)
     self.root = Directory(op.dirname(self.path))
     self.name, self.extension = op.splitext(op.basename(self.path))
     self.content = content
Example #6
0
 def __init__(self, path):
     self.path = abspath(path)
Example #7
0
 def __init__(self, path, content = None):
     self.path = abspath(path)
     self.root = Directory(op.dirname(self.path))
     self.name, self.extension = op.splitext(op.basename(self.path))
     self.content = content
Example #8
0
File: fs.py Project: willingc/mynt
    def __init__(self, path):
        self.path = abspath(path)

        if self.is_root:
            raise FileSystemException('Root is not an acceptible directory.')
Example #9
0
    def __init__(self, path):
        self.path = abspath(path)

        if self.is_root:
            raise FileSystemException('Directory cannot be root')