simfile.sm

Simfile & chart classes for SM files.

Module Contents

Classes

SMChart

SM implementation of BaseChart.

SMCharts

SM implementation of BaseCharts.

SMSimfile

SM implementation of BaseSimfile.

class simfile.sm.SMChart

Bases: simfile.base.BaseChart

SM implementation of BaseChart.

Unlike SSCChart, SM chart metadata is stored as a fixed list of 6 properties, so this class prohibits adding or deleting keys from its backing OrderedDict.

extradata :Optional[List[str]]

If the chart data contains more than 6 components, the extra components will be stored in this attribute.

classmethod blank(cls: Type[SMChart])SMChart

Generate a blank, valid chart populated with standard keys.

This should approximately match blank charts produced by the StepMania editor.

classmethod from_str(cls: Type[SMChart], string: str)SMChart

Parse the serialized MSD value components of a NOTES property.

The string should contain six colon-separated components, corresponding to each of the base known properties documented in BaseChart. Any additional components will be stored in extradata.

Raises ValueError if the string contains fewer than six components.

Deprecated since version 2.1: This is now a less efficient version of from_msd(), which interoperates better with msdparser version 2.0.

classmethod from_msd(cls: Type[SMChart], values: Sequence[str])SMChart

Parse the MSD value components of a NOTES property.

The list should contain six strings, corresponding to each of the base known properties documented in BaseChart. Any additional components will be stored in extradata.

Raises ValueError if the list contains fewer than six components.

serialize(self, file)

Write the object to provided text file object as MSD.

abstract update(self, *args, **kwargs) → None

Raises NotImplementedError.

abstract pop(self, property, default=None)

Raises NotImplementedError.

abstract popitem(self, last=True)

Raises NotImplementedError.

class simfile.sm.SMCharts(data=None)

Bases: simfile.base.BaseCharts[SMChart]

SM implementation of BaseCharts.

List elements are SMChart instances.

class simfile.sm.SMSimfile(*, file: Optional[Union[TextIO, Iterator[str]]] = None, string: Optional[str] = None, strict: bool = True)

Bases: simfile.base.BaseSimfile

SM implementation of BaseSimfile.

stops

Specialized property for STOPS that supports FREEZES as an alias.

classmethod blank(cls: Type[SMSimfile])SMSimfile

Generate a blank, valid simfile populated with standard keys.

This should approximately match the simfile produced by the StepMania editor in a directory with no .sm or .ssc files.

property charts(self)SMCharts

List of charts associated with this simfile.