| 30 @property |
30 @property |
| 31 def effective_category(self): |
31 def effective_category(self): |
| 32 if self.category: |
32 if self.category: |
| 33 return self.category |
33 return self.category |
| 34 else: |
34 else: |
| 35 return self.description.split(' ', 1)[0] |
35 import string |
| |
36 category = self.description.split(' ', 1)[0] |
| |
37 while category and category[0] in string.punctuation: |
| |
38 category = category[1:] |
| |
39 return category |
| 36 |
40 |
| 37 class BadHeader: |
41 class BadHeader: |
| 38 def __init__(self, index, reason): |
42 def __init__(self, index, reason): |
| 39 self.index = index |
43 self.index = index |
| 40 self.reason = reason |
44 self.reason = reason |