earwax.cmd.subcommands.story module¶
Provides the story subcommand.
-
earwax.cmd.subcommands.story.build_story(args: argparse.Namespace) → None¶ Build the world.
-
earwax.cmd.subcommands.story.copy_action(action: earwax.story.world.WorldAction, destination: pathlib.Path, index: int) → None¶ Copy the sound for the given action.
Parameters: - action – The action whose sound will be copied.
- destination –
The destination the sound will be copied to.
If this directory does not exist, it will be created before the copy.
- index – The number to base the resulting file name on.
-
earwax.cmd.subcommands.story.copy_actions(actions: List[earwax.story.world.WorldAction], destination: pathlib.Path) → None¶ Copy the sounds from a list of action objects.
Parameters: - actions – The list of actions whose sounds will be copied.
- destination –
The destination for the copied sounds.
If this directory does not exist, it will be created before the copy.
-
earwax.cmd.subcommands.story.copy_ambiances(ambiances: List[earwax.story.world.WorldAmbiance], destination: pathlib.Path) → None¶ Copy all ambiance files.
Parameters: - ambiances – The ambiances whose sounds will be copied.
- destination –
The ambiances directory to copy into.
If this directory does not exist, it will be created before copying begins.
-
earwax.cmd.subcommands.story.copy_path(source: Union[str, pathlib.Path], destination: pathlib.Path) → str¶ Copy the given file or folder to the given destination.
Parameters: - source – Where to copy from.
- destination – The destination for the new file.
-
earwax.cmd.subcommands.story.create_story(args: argparse.Namespace) → None¶ Create a new story.
-
earwax.cmd.subcommands.story.edit_story(args: argparse.Namespace) → None¶ Edit the given story.
-
earwax.cmd.subcommands.story.get_filename(filename: str, index: int) → str¶ Return a unique filename.
Given a filename of
'music/track.wav', and an index of5,'5.wav'would be returned.Parameters: - filename – The original filename (can include path).
- index – The index of this filename in whatever list is being iterated over.
-
earwax.cmd.subcommands.story.make_directory(directory: pathlib.Path) → None¶ Make the given directory, if necessary.
if the given directory already exists, print a message to that effect.
Otherwise, create the directory, and print a message about it.
Parameters: directory – The directory to create.
-
earwax.cmd.subcommands.story.play_story(args: argparse.Namespace, edit: bool = False) → None¶ Load and play a story.