pytwine.core.CodeChunk

class pytwine.core.CodeChunk(*args, **kwargs)[source]

Bases: pytwine.core.Chunk

A code block Chunk.

block_start_line

stores the start-of-code-block demarcator line.

Type

str

block_end_line

stores the end-of-code-block demarcator line.

Type

str

>>> c = CodeChunk(contents="foo bar", number=3, startLineNum=10, block_start_line="``` python", block_end_line="```")
>>> c
CodeChunk(chunkType='code', contents='foo bar', number=3, startLineNum=10, block_start_line='``` python', block_end_line='```')
__init__()

Methods

__init__()

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

Attributes

chunkType

Alias for field number 0

contents

Alias for field number 1

number

Alias for field number 2

startLineNum

Alias for field number 3

block_start_line

block_end_line

chunkType: str

Alias for field number 0

contents: str

Alias for field number 1

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

number: int

Alias for field number 2

startLineNum: int

Alias for field number 3