| Conditions | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from django.conf import settings |
||
| 22 | def get_verb_transformer(): |
||
| 23 | """ |
||
| 24 | Returns the class of the verb transformer to use from ACTSTREAM_SETTINGS['VERB_TRANSFORMER'] |
||
| 25 | """ |
||
| 26 | mod = SETTINGS.get('VERB_TRANSFORMER', 'actstream.transformers.DefaultVerbTransformer') |
||
| 27 | mod_path = mod.split('.') |
||
| 28 | try: |
||
| 29 | return getattr(__import__('.'.join(mod_path[:-1]), {}, {}, |
||
| 30 | [mod_path[-1]]), mod_path[-1])() |
||
| 31 | except ImportError: |
||
| 32 | raise ImportError( |
||
| 33 | 'Cannot import %s try fixing ACTSTREAM_SETTINGS[VERB_TRANSFORMER]' |
||
| 34 | 'setting.' % mod |
||
| 35 | ) |
||
| 41 |