本文整理汇总了Python中fuse.Fuse.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Fuse.__init__方法的具体用法?Python Fuse.__init__怎么用?Python Fuse.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fuse.Fuse
的用法示例。
在下文中一共展示了Fuse.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
Fuse.__init__(self, *args, **kw)
print 'Starting the FUSE based file system'
print '\n'
self.root = '/' #if no directory is given the file system is mounted at this directory (now root - can be set to any other).
self.file_class = self.XmpFile #We define the name of the file class since we are using a seperate class.
global home_dir
home_dir = os.getenv("HOME")
#Connect to the database
self.redis_host = 'localhost'
global r
r = redis.StrictRedis(host = self.redis_host, port = 6379, db = 0)
all_dirs = [x[0] for x in os.walk(home_dir + '/AbacusFS/test')]
for directory in all_dirs:
directory_pom = directory.split('/')
if not 'newcalc' in directory_pom and not '.Trash-1001' in directory_pom:
directory_pom = directory_pom[6:]
directory_pom = '/'.join(directory_pom)
r.delete('in_mem_/'+directory_pom)
示例2: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
"""
Init main UNFS class.
"""
self.file_class = None
Fuse.__init__(self, *args, **kw)
示例3: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kwargs):
Fuse.__init__(self, *args, **kwargs)
openlog('pyhesiodfs', 0, LOG_DAEMON)
try:
self.fuse_args.add("allow_other", True)
except AttributeError:
self.allow_other = 1
if sys.platform == 'darwin':
self.fuse_args.add("noappledouble", True)
self.fuse_args.add("noapplexattr", True)
self.fuse_args.add("volname", "MIT")
self.fuse_args.add("fsname", "pyHesiodFS")
self.attachtab = attachtab(self)
self.files = FakeFiles()
self.syslog_unavail = True
self.syslog_unknown = True
self.syslog_success = False
# Cache deletions for half a second - should give `ln -nsf`
# enough time to make a new symlink
self.negcache = defaultdict(negcache)
示例4: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
Fuse.__init__(self, *args, **kw)
self.writeback_time = 0.1
self.lazy_fsdata=True
self.cachedir="/tmp"
self.persistence = "persistence"
self.root = "root"
示例5: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
print "args:", args
print "kw:", kw
Fuse.__init__(self, *args, **kw)
self.conn = PaellaConnection()
self.db = PaellaExporter(self.conn)
print "Init complete"
示例6: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
Fuse.__init__(self, *args, **kw)
self.tdb = TagDB.TagDB(logging)
#tdb.loaddb(None)
self.lldir = "."
TagFS.cur_tagfs = self
self.root = "."
示例7: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kwargs):
Fuse.__init__(self, *args, **kwargs)
self.pathfinder = PathYAVFS()
self.config = ConfigYAVFS()
# try:
if(1):
self.vk_sess = vk_api.VkApi(self.config.login, self.config.passwd, app_id = self.config.app)
self.vk_sess.authorization()
self.vk = self.vk_sess.get_api()
self.users = {}
self.user_friends = {}
self.users['self'] = self.vk.users.get(fields=USER_FIELDS)[0]
print "VK Auth ok."
pass
# except:
else:
sys.exit(-1)
self.dyn = DynamicYAVFS(self)
self.filedict = {
'/': NodeYAVFS(YAVFS_DIR, '/',
dirlist = [
'users'
]
),
'/users': NodeYAVFS(YAVFS_DIR, '/users')
}
self.user_put_prof_to_fs('/users', 'self', uid='self')
示例8: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
'''
Initialize filesystem
'''
self._extract_lock = threading.Lock()
self._getattr_lock = threading.Lock()
self._bextract_status_lock = threading.Lock()
self._bextract_user_intervention_event = threading.Event()
self._initialized = False
# default option values
self.logging = 'info'
self.syslog = False
self.driver = SQL.SQLITE3
self.database = None
self.host = 'localhost'
self.port = 0
self.username = 'bacula'
self.password = None
self.conf = '/etc/bacula/bacula-sd.conf'
self.client = ''
self.fileset = None
self.device = 'FileStorage'
self.datetime = None
self.recent_job = False
self.joblist = None
self.cache_prefix = None
self.user_cache_path = None
self.cleanup = False
self.move_root = False
self.prefetch_attrs = False
self.prefetch_regex = None
self.prefetch_symlinks = False
self.prefetch_recent = False
self.prefetch_diff = None
self.prefetch_difflist = None
self.prefetch_list = None
self.prefetch_everything = False
self.batch_mode = False
self.batch_list = False
self.batch_bsr = False
self.batch_extract = False
self.use_ino = False
self.max_ino = 0
self.dirs = {'/': {'': (FileSystem.null_stat, )}}
self._bextract_status = copy.deepcopy(FileSystem.bextract_done)
self._bextract_status['pending'] = 0
self._bextract_status['failures'] = 0
class File(FileSystem._File):
def __init__(self2, *a, **kw):
FileSystem._File.__init__(self2, self, *a, **kw)
self.file_class = File
Fuse.__init__(self, *args, **kw)
示例9: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kargs):
Fuse.__init__(self, *args, **kargs)
self.m3u=None
self.symlinks={}
self.music=[]
self.unknown=[]
self.m3ufile=None
self.logger=None
示例10: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
Fuse.__init__(self, *args, **kw)
# do stuff to set up your filesystem here, if you want
#import thread
#thread.start_new_thread(self.mythread, ())
self.root = '/'
示例11: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
Fuse.__init__(self, *args, **kw)
self.engine = create_engine("mysql://root:[email protected]/")
self.meta = MetaData()
self.meta.bind = self.engine
self.insp = Inspector.from_engine(self.engine)
print "Init complete."
示例12: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
Fuse.__init__(self, *args, **kw)
self.restore = 0
self.source = '/'
self.shares = 20
self.required = 3
示例13: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
Fuse.__init__(self, *args, **kw)
self.rootNode = Inode('', isDir = True)
self.handles = {}
# self.rootNode += Inode('test', True)
self.rootNode += UsersInode()
print "ready"
示例14: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kw):
Fuse.__init__(self, *args, **kw)
# do stuff to set up your filesystem here, if you want
#import thread
#thread.start_new_thread(self.mythread, ())
self.repo = self.DEFAULT_REPO
self.struct = self.DEFAULT_STRUCT
示例15: __init__
# 需要导入模块: from fuse import Fuse [as 别名]
# 或者: from fuse.Fuse import __init__ [as 别名]
def __init__(self, *args, **kwargs):
if 'handlers' in kwargs:
global HANDLERS
self.handlers = kwargs['handlers']
HANDLERS = self.handlers
del kwargs['handlers']
self.file_class = self.MoshFile
Fuse.__init__(self, *args, **kwargs)