Created
July 15, 2015 20:47
-
-
Save twobraids/bdcdbb3e98126023e316 to your computer and use it in GitHub Desktop.
How to take an existing Socorro crash signature and remove the arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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