Skip to content

Instantly share code, notes, and snippets.

@twobraids
Created July 15, 2015 20:47
Show Gist options
  • Save twobraids/bdcdbb3e98126023e316 to your computer and use it in GitHub Desktop.
Save twobraids/bdcdbb3e98126023e316 to your computer and use it in GitHub Desktop.
How to take an existing Socorro crash signature and remove the arguments
from configman.dotdict import DotDict
from socorro.processor.signature_utilities import CSignatureToolBase
c = DotDict()
c.collapse_arguments = True
ct = CSignatureToolBase(c)
signature_with_arguments = "@0xb6f11e3c | some_func() | aont(onth()) | operator()(ortho)"
signature_with_no_arguments = ct._collapse(
signature_with_arguments,
open_string='(',
replacement_open_string='',
close_string=')',
replacement_close_string='',
exception_substring_list=(
'operator',
'anonymous namespace'
)
)
assert (
signature_with_no_arguments == "@0xb6f11e3c | some_func | aont | operator()"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment