simfile.sm
Simfile & chart classes for SM files.
Attributes
Pseudo-properties of .SM files, named how they are recognized internally. |
|
All simfile-level properties of .SM files recognized by StepMania 5, |
Classes
SM implementation of |
|
SM implementation of |
|
SM implementation of |
|
SM implementation of |
Module Contents
- simfile.sm.SM_CHART_PROPERTIES = ('STEPSTYPE', 'DESCRIPTION', 'DIFFICULTY', 'METER', 'RADARVALUES', 'NOTES')
Pseudo-properties of .SM files, named how they are recognized internally.
This sequence is sorted in the same order dictated by the .SM format.
- class simfile.sm.SMChart
Bases:
simfile.base.BaseChartSM 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: List[str] | None = None
If the chart data contains more than 6 components, the extra components will be stored in this attribute.
- classmethod blank() SMChart
Generate a blank, valid chart populated with standard keys.
This should approximately match blank charts produced by the StepMania editor.
- classmethod from_str(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 inextradata.Raises
ValueErrorif 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 withmsdparserversion 2.0.
- classmethod from_msd(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 inextradata.Raises
ValueErrorif the list contains fewer than six components.Deprecated since version 3.0: Use
from_msd_parameter()instead. This method doesn’t preserve whitespace or comments.
- classmethod from_msd_parameter(param: msdparser.MSDParameter) SMChart
Parse a NOTES parameter from an SM file.
The parameter should contain seven components, corresponding to the “NOTES” key followed by the six base known properties documented in
BaseChart. Any additional components will be stored inextradata.Raises
ValueErrorif the parameter contains <7 components.
- serialize(file)
Write the object to provided text file object as MSD.
- abstract update(*args, **kwargs) None
Raises NotImplementedError.
- abstract pop(property, default=None)
Raises NotImplementedError.
- abstract popitem(last=True)
Raises NotImplementedError.
- abstract values() frozenset[str]
Raises NotImplementedError.
- class simfile.sm.AttachedSMChart
Bases:
SMChart,simfile.base.BaseAttachedChartSM 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.
- class simfile.sm.SMCharts(simfile: S, charts: Iterable[C] | None = None)
Bases:
simfile.base.BaseCharts[AttachedSMChart,SMChart,SMSimfile]SM implementation of
BaseCharts.List elements are
SMChartinstances.
- simfile.sm.SM_SIMFILE_PROPERTIES = ('TITLE', 'SUBTITLE', 'ARTIST', 'TITLETRANSLIT', 'SUBTITLETRANSLIT', 'ARTISTTRANSLIT', 'GENRE',...
All simfile-level properties of .SM files recognized by StepMania 5, including aliases.
This sequence is sorted in the same order produced by the StepMania 5 editor.
- class simfile.sm.SMSimfile(*, file: TextIO | None = None, string: str | None = None, tokens: Iterable[Tuple[msdparser.lexer.MSDToken, str]] | None = None, strict: bool = True)
Bases:
simfile.base.BaseSimfileSM implementation of
BaseSimfile.- stops
Specialized property for STOPS that supports FREEZES as an alias.