Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
import os,subprocess,shutil,sys
from configparser import ConfigParser
from s3fuse.privsep import fs
"""
let's make an original conf file 
and let user replace the file
"""
class fuse:
    """
    Read the vault.conf file
    """
    def __init__(self,file='vault.conf'):
    # def __init__(self,file='vault.conf')
        self.source = os.path.dirname(os.path.abspath(file)) + "/vault.conf"
        config = ConfigParser()
        config.read(self.source)
        self.mp = config['DEFAULT']['vault_data_directory']
        self.cache = config['DEFAULT']['vault_data_directory_old']
    
    def update_conf(file):
        
        parser.set('SETTINGS', 'value', '15')

    """
    Create mount point and cache location
    """
    def mount(self):
        # build a flag containing configuration file info
        # and export it as an environment variable
        flag = '--config-file=' + self.source
        os.environ['FLAG'] = flag
        from . import s3vaultfuse
        s3vaultfuse
        
    """
    when the mount function stops running, it actually performs umount. This is just to clean the folders
    """
    def umount(self):
        fs.remove(self.mp)
        fs.remove(self.cahce)
    
    """
    FIX REQUIRD.
        There is a bug that build one additional mount points. 
        For now, this function will remove the files and folders from this mountpoint
    """
    def clean(self):
        subprocess.call('find . -empty -type d -delete'.split())