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


Python swob.multi_range_iterator函数代码示例

本文整理汇总了Python中swift.common.swob.multi_range_iterator函数的典型用法代码示例。如果您正苦于以下问题:Python multi_range_iterator函数的具体用法?Python multi_range_iterator怎么用?Python multi_range_iterator使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: app_iter_ranges

 def app_iter_ranges(self, ranges, content_type,
                     boundary, content_size,
                     *_args, **_kwargs):
     for chunk in multi_range_iterator(
             ranges, content_type, boundary, content_size,
             self._chunked_app_iter_range):
         yield chunk
开发者ID:fvennetier,项目名称:oio-swift,代码行数:7,代码来源:obj.py

示例2: app_iter_ranges

 def app_iter_ranges(self, ranges, content_type, boundary, size):
     """Returns an iterator over the data file for a set of ranges"""
     if not ranges:
         yield ""
     else:
         try:
             self.suppress_file_closing = True
             for chunk in multi_range_iterator(ranges, content_type, boundary, size, self.app_iter_range):
                 yield chunk
         finally:
             self.suppress_file_closing = False
             self.close()
开发者ID:schatt,项目名称:swift,代码行数:12,代码来源:server.py

示例3: app_iter_ranges

 def app_iter_ranges(self, ranges, content_type, boundary, size):
     if not ranges:
         yield ''
     else:
         try:
             self._suppress_file_closing = True
             for chunk in multi_range_iterator(
                     ranges, content_type, boundary, size,
                     self.app_iter_range):
                 yield chunk
         finally:
             self._suppress_file_closing = False
             try:
                 self.close()
             except DiskFileQuarantined:
                 pass
开发者ID:bebule,项目名称:swift,代码行数:16,代码来源:mem_diskfile.py

示例4: app_iter_ranges

    def app_iter_ranges(self, ranges, content_type, boundary, content_size):
        """
        This method assumes that iter(self) yields all the data bytes that
        go into the response, but none of the MIME stuff. For example, if
        the response will contain three MIME docs with data "abcd", "efgh",
        and "ijkl", then iter(self) will give out the bytes "abcdefghijkl".

        This method inserts the MIME stuff around the data bytes.
        """
        si = Spliterator(self)
        mri = multi_range_iterator(
            ranges, content_type, boundary, content_size,
            lambda start, end_plus_one: si.take(end_plus_one - start))
        try:
            for x in mri:
                yield x
        finally:
            self.close()
开发者ID:nadeemsyed,项目名称:swift,代码行数:18,代码来源:request_helpers.py


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