Skip to main content

delete_common_files

Deletes one or more files to common files from the current branch in Modelbit.

Parameters

mb.delete_common_files(names=)
  • names: Union[str, List[str]] The file(s) to delete from common files.
    • str: The path to a single file in common files
    • List[str]: Paths to multiple files in common files

Returns

No value is returned. A success status message is printed if the command is successful.

Examples

Deleting a single common file

To remove one file from common files, specify it as a string:

mb.delete_common_files("utils.py")

Deleting a common file in a lib subdirectory

Use forward slashes to delete common files stored in subdirectories:

mb.delete_common_files("lib/utils.py")

Deleting multiple common files

Supply a list of common files to delete multiple files:

mb.delete_common_files(["utils.py", "helpers.py"])

Deleting all common files in lib subdirectory:

Use mb.common_files to get the list of files, then delete them:

files_in_lib = mb.common_files(prefix="lib/")
mb.delete_common_files(files_in_lib)

See also