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


Python Block.from_full_name方法代码示例

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


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

示例1: _block_name

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import from_full_name [as 别名]
 def _block_name(self):
     if type(self._block) is str:
         return Block.from_full_name(self._block)[1]
     elif self._block is None:
         return None
     else:
         return self._block.name
开发者ID:SmartDataProjects,项目名称:dynamo,代码行数:9,代码来源:lfile.py

示例2: _dataset_name

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import from_full_name [as 别名]
 def _dataset_name(self):
     if type(self._block) is str:
         return Block.from_full_name(self._block)[0]
     elif self._block is None:
         return None
     else:
         return self._block.dataset.name
开发者ID:SmartDataProjects,项目名称:dynamo,代码行数:9,代码来源:lfile.py

示例3: _block_real_name

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import from_full_name [as 别名]
 def _block_real_name(self):
     if type(self._block) is str:
         return Block.to_real_name(Block.from_full_name(self._block)[1])
     elif self._block is None:
         return None
     else:
         return self._block.real_name()
开发者ID:SmartDataProjects,项目名称:dynamo,代码行数:9,代码来源:lfile.py

示例4: find_items

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import from_full_name [as 别名]
    def find_items(self, inventory, invalid_items = None):
        """
        Find datasets and blocks in the items list from the inventory.
        @param inventory     DynamoInventory object
        @param invalid_items If set to a list, fill with item names not found in the inventory.

        @return  {dataset: set of blocks or None}, None if the item is a dataset.
        """

        datasets = {}
    
        for item in self.items:
            try:
                dataset = inventory.datasets[item]
            except KeyError:
                try:
                    dataset_name, block_name = Block.from_full_name(item)
                except ObjectError:
                    if invalid_items is not None:
                        invalid_items.append(item)
                    continue

                try:
                    dataset = inventory.datasets[dataset_name]
                except KeyError:
                    if invalid_items is not None:
                        invalid_items.append(item)
                    continue

                if dataset in datasets and datasets[dataset] is None:
                    continue

                block = dataset.find_block(block_name)
                if block is None:
                    if invalid_items is not None:
                        invalid_items.append(item)
                    continue

                if dataset in datasets:
                    datasets[dataset].add(block)
                else:
                    datasets[dataset] = set([block])
    
            else:
                datasets[dataset] = None

        return datasets
开发者ID:SmartDataProjects,项目名称:dynamo,代码行数:49,代码来源:request.py


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