当前位置: 首页>>代码示例>>Python>>正文


Python fuse.Fuse方法代码示例

本文整理汇总了Python中fuse.Fuse方法的典型用法代码示例。如果您正苦于以下问题:Python fuse.Fuse方法的具体用法?Python fuse.Fuse怎么用?Python fuse.Fuse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fuse的用法示例。


在下文中一共展示了fuse.Fuse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Fuse [as 别名]
def main():

    usage = """
Userspace nullfs-alike: mirror the filesystem tree from some point on.

""" + fuse.Fuse.fusage

    server = AccessFS(version="%prog " + fuse.__version__,
                      usage=usage,
                      dash_s_do='setsingle')

    server.parser.add_option(mountopt="root", metavar="PATH", default='/',
                             help="mirror filesystem from under PATH [default: %default]")
    server.parse(values=server, errex=1)

    try:
        if server.fuse_args.mount_expected():
            os.chdir(server.root)
    except OSError:
        print("can't enter root of underlying filesystem", file=sys.stderr)
        sys.exit(1)

    server.main() 
开发者ID:apache,项目名称:allura,代码行数:25,代码来源:accessfs.py

示例2: __init__

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Fuse [as 别名]
def __init__(self, *args, **kw):
        fuse.Fuse.__init__(self, *args, **kw)

        # Currently we have to run in single-threaded mode to prevent
        # the cache becoming corrupted
        self.parse(['-s'])

        self.parser.add_option('-c', '--cache-dir', dest='cache_dir', help="Specifies the directory where cached data should be stored. This will be created if it does not exist.")
        self.parser.add_option('-t', '--target-dir', dest='target_dir', help="The directory which we are caching. The content of this directory will be mirrored and all reads cached.")
        self.parser.add_option('-v', '--virtual-dir', dest='virtual_dir', help="The folder in the mount dir in which the virtual filesystem controlling pcachefs will reside.")

        self.cache_dir = None
        self.target_dir = None
        self.virtual_dir = None
        self.cacher = None
        self.vfs = None 
开发者ID:ibizaman,项目名称:pcachefs,代码行数:18,代码来源:pcachefs.py

示例3: main

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Fuse [as 别名]
def main(self, args=None):
        options = self.cmdline[0]

        if options.cache_dir is None:
            self.parser.error('Need to specify --cache-dir')
        if options.target_dir is None:
            self.parser.error('Need to specify --target-dir')

        self.cache_dir = options.cache_dir
        self.target_dir = options.target_dir
        self.virtual_dir = options.virtual_dir or '.pcachefs'

        self.cacher = Cacher(self.cache_dir, UnderlyingFs(self.target_dir))
        self.vfs = vfs.VirtualFS(self.virtual_dir, self.cacher)

        signal.signal(signal.SIGINT, signal.SIG_DFL)
        fuse.Fuse.main(self, args) 
开发者ID:ibizaman,项目名称:pcachefs,代码行数:19,代码来源:pcachefs.py

示例4: main

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Fuse [as 别名]
def main():
    usage = """
spreadsheetfs

""" + fuse.Fuse.fusage
    init_fs_data()
    server = SpreadsheetFS(version="%prog " + fuse.__version__,
                           usage=usage,
                           dash_s_do="setsingle")
    server.parse(errex=1)
    server.main() 
开发者ID:GunshipPenguin,项目名称:spreadsheetfs,代码行数:13,代码来源:main.py

示例5: __init__

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Fuse [as 别名]
def __init__(self, top):
        fuse.Fuse.__init__(self)
        self.top = top 
开发者ID:omererdem,项目名称:honeything,代码行数:5,代码来源:fuse-cmd.py

示例6: __init__

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Fuse [as 别名]
def __init__(self, *args, **kw):
        fuse.Fuse.__init__(self, *args, **kw)

        self.output = ReadThread.Output(TEMP_FILE)
        self.hasMoreData = threading.Condition()
        
        pulseaudio_monitor = os.popen("pactl list | grep -A2 '^Source #' "
            " | grep 'Name: .*\.monitor$' | awk '{print $NF}' | tail -n1").read().strip()
            
        print "Using PulseAudio monitor", pulseaudio_monitor
        
        live_filter = os.path.abspath(os.path.join(os.getcwd(), "matroska_live_filter.py"))

        cmd = ("parec -d %(pulseaudio_monitor)s"
            " | ffmpeg -f s16le -ac 2 -ar 44100 -i - -f x11grab -r 20 -s 1024x576"
            " -i :0.0+128,224 -acodec ac3 -ac 1 -vcodec libx264 -vpre fast"
            " -threads 0 -f matroska - "
            " | %(live_filter)s - ") % locals()
            
        print "Running capture command:", cmd
        self.process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                                        stderr=subprocess.PIPE,
                                        shell=True)
        
        t = ReadThread(self.process, self.process.stdout,
                       self.output, self.hasMoreData)
        t.setDaemon(True)
        t.start()

        stderr_thrd = ReadThread(self.process, self.process.stderr, None, None)
        stderr_thrd.setDaemon(True)
        stderr_thrd.start()

        # Read some data so that it's ready immediately when the player requests
        # it (my player appears to have a short timeout and gives up when it
        # has to wait too long for the metadata).        
        self.read("", 1024 * 1024, 0) 
开发者ID:mfoetsch,项目名称:dlna_live_streaming,代码行数:39,代码来源:dlna_fuse.py


注:本文中的fuse.Fuse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。