Quote:
Originally Posted by capink
It will not change much. It only fails better in case the user enters a wrong value for user_cat_prefix (e.g missing one or more letters), it will return the full path of the user category, which makes it more obvious what the user did wrong.
|
Ahh, I see. That makes sense. However, don't you need to change/get rid of the dict comprehension on line 5? It ensures that only user categories with the prefix used are put into the "cats" dict, making it impossible for the re.sub() to fail.