pytwine.core.DocChunk

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

Bases: pytwine.core.Chunk

A non-code-block.

Keyword Arguments
  • contents – string content

  • number – what number docchunk this is in the document

  • startLineNum – what line the chunk started on

>>> d = DocChunk(contents="foo bar", number=3, startLineNum=10)
>>> d
DocChunk(chunkType='doc', contents='foo bar', number=3, startLineNum=10)
__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

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