(self, prefix)
Register directory prefixes where remove() is allowed
Register directory prefixes where remove() is allowed
Register directory prefixes where remove () is allowed
def _register_prefix(self, prefix):
        """Register directory prefixes where remove() is allowed"""
        prefix = os.path.realpath(prefix)
        if prefix not in FileUtil.safe_prefixes:
            filename = prefix
            if os.path.isdir(filename) and not filename.endswith('/'):
                FileUtil.safe_prefixes.append(filename + '/')
                FileUtil.safe_prefixes.append(os.path.realpath(filename) + '/')
            else:
                FileUtil.safe_prefixes.append(filename)
                FileUtil.safe_prefixes.append(os.path.realpath(filename))
def _register_prefix ( self , prefix ) : prefix = os . path . realpath ( prefix ) if prefix not in FileUtil . safe_prefixes : filename = prefix if os . path . isdir ( filename ) and not filename . endswith ( '/' ) : FileUtil . safe_prefixes . append ( filename + '/' ) FileUtil . safe_prefixes . append ( os . path . realpath ( filename ) + '/' ) else : FileUtil . safe_prefixes . append ( filename ) FileUtil . safe_prefixes . append ( os . path . realpath ( filename ) )