Skip to content

Commit

Permalink
Disable and add to the list by default
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirezaT99 committed Jul 9, 2024
1 parent 22583f5 commit 5502671
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion nbgrader/converters/autograde.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .base import BaseConverter, NbGraderException
from ..preprocessors import (
AssignLatePenalties, ClearOutput, DeduplicateIds, OverwriteCells, SaveAutoGrades,
Execute, LimitOutput, OverwriteKernelspec, CheckCellMetadata)
Execute, LimitOutput, OverwriteKernelspec, CheckCellMetadata, IgnorePattern)
from ..api import Gradebook, MissingEntry
from .. import utils

Expand Down Expand Up @@ -61,6 +61,7 @@ def _output_directory(self) -> str:
]).tag(config=True)
autograde_preprocessors = List([
Execute,
IgnorePattern,
ClearMetadataPreprocessor,
LimitOutput,
SaveAutoGrades,
Expand Down
3 changes: 2 additions & 1 deletion nbgrader/preprocessors/ignorepattern.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from . import NbGraderPreprocessor

from traitlets import Unicode
from traitlets import Unicode, Bool
from nbformat.notebooknode import NotebookNode
from nbconvert.exporters.exporter import ResourcesDict
from typing import Tuple
Expand All @@ -11,6 +11,7 @@ class IgnorePattern(NbGraderPreprocessor):
"""Preprocessor for removing cell outputs that match a particular pattern"""

pattern = Unicode("", help="The regular expression to remove from stderr").tag(config=True)
enabled = Bool(False, help="Whether to use this preprocessor when running nbgrader").tag(config=True)

def preprocess_cell(self,
cell: NotebookNode,
Expand Down

0 comments on commit 5502671

Please sign in to comment.