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


Python Block.append方法代码示例

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


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

示例1: __merge

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import append [as 别名]
 def __merge(self,ns_list):
     block_li = []                 # 文本块列表
     block = Block()               # 文本块
     for i in range(len(ns_list)):
         if ns_list[i]['offset'] >= 1:#thr:                
             # 大于或等于阈值,保存上一个块,划给新块
             if not block.is_empty():
                 block_li.append( block )
                 block = Block()               # 新增文本块
         if ns_list[i]['node'] and ns_list[i]['node'].string.strip():
             block.append( ns_list[i]['node'] )
     return block_li
开发者ID:ICTBigDataBench,项目名称:web-classify,代码行数:14,代码来源:partitioner.py

示例2: polarArray

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import append [as 别名]
def polarArray(geom,numberOfCopies,totalAngle=2*pi,center=Point(0,0)):
    '''
    array geometric entity in a polar pattern
    '''
    b = Block()
    theta_step = totalAngle / numberOfCopies
    theta = 0.0
    for i in range(numberOfCopies):
        g = rotateAboutPoint(geom,center,theta)
        b.append(g)
        theta += theta_step
    return b
开发者ID:gfsmith,项目名称:gears,代码行数:14,代码来源:twod_operations.py

示例3: rectArray

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import append [as 别名]
def rectArray(geom,xNum,xStep,yNum=1,yStep=None):
    '''
    array geometric entity in a rectangular pattern
    '''
    b = Block()
    y = 0.0
    for j in range(yNum):
        x = 0.0
        for i in range(xNum):
            t = AffineMatrix().translation(Vector(x,y,0.0))
            b.append(t * geom)
            x += xStep
        y += yStep
    return b
开发者ID:gfsmith,项目名称:gears,代码行数:16,代码来源:twod_operations.py

示例4: split_blocks

# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import append [as 别名]
def split_blocks(lines):
	block = None

	for line in lines:
		line = line.strip()
		idx = line.find(';') # comment
		if idx != -1:
			line = line[:idx]
		tokens = line.split()
		if len(tokens) == 0:
			continue

		label = inst = None
		if tokens[0][-1:] == ':':
			label = tokens.pop(0)[:-1]
		if len(tokens) > 0:
			opcode = tokens.pop(0)
			oprands = tokens
			inst = Instruction(opcode, oprands)

		if label:
			if block is None: # the first run
				block = Block(label)
			else:
				block.set_passthru(Block.NEXT_BLOCK)
				if len(block.instructions) == 0:
					block.relabel(label)
				else:
					block = Block(label)
		elif block is None:
			block = Block(label)

		if inst and inst.opcode[:1] != '.':
			block.append(inst)
			if inst.opcode[:1] == 'b': # branch
				block.set_branch(inst.oprands[0])
				block.set_passthru(Block.NEXT_BLOCK)
				block = None
			elif inst.opcode == 'jmp': # jump
				block.set_passthru(inst.oprands[0])
				block = None
			elif inst.opcode == 'rts': # return subroutine
				block.set_return(True)
				block = None
开发者ID:maczniak,项目名称:game_reverse_engineering,代码行数:46,代码来源:code_blocker.py


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