-
Notifications
You must be signed in to change notification settings - Fork 52
Issue 46 #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 46 #62
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,34 +34,37 @@ def add_substitution(self, key, value): | |
| def set_substitutions(self, subs): | ||
| self.data['sub'] = subs | ||
|
|
||
|
|
||
| def add_attr(self, key, value, attr): | ||
| if attr not in self.data: | ||
| self.data[attr] = {} | ||
| self.data[attr][key] = value | ||
|
|
||
| def add_unique_arg(self, key, value): | ||
| if 'unique_args' not in self.data: | ||
| self.data['unique_args'] = {} | ||
| self.data['unique_args'][key] = value | ||
| add_attr(self, key, value, 'unique_args') | ||
|
|
||
| def set_unique_args(self, value): | ||
| self.data['unique_args'] = value | ||
|
|
||
| def append_attr(self, value, attr): | ||
| if attr not in self.data: | ||
| self.data[attr] = [] | ||
| self.data[attr].append(value) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| def add_category(self, category): | ||
| if 'category' not in self.data: | ||
| self.data['category'] = [] | ||
| self.data['category'].append(category) | ||
| append_attr(self, category, 'category') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there some advantage to calling the method in the above manner instead of like this? self.append_attr(category, 'category') |
||
|
|
||
| def set_categories(self, category): | ||
| self.data['category'] = category | ||
|
|
||
| def add_section(self, key, section): | ||
| if 'section' not in self.data: | ||
| self.data['section'] = {} | ||
| self.data['section'][key] = section | ||
| add_attr(self, key, section, 'section') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. self.add_attr(key, section, 'section') # ? |
||
|
|
||
| def set_sections(self, value): | ||
| self.data['section'] = value | ||
|
|
||
| def add_send_each_at(self, time): | ||
| if 'send_each_at' not in self.data: | ||
| self.data['send_each_at'] = [] | ||
| self.data['send_each_at'].append(time) | ||
| append_attr(self, time, 'send_each_at') | ||
|
|
||
| def set_send_each_at(self, time): | ||
| self.data['send_each_at'] = time | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use EAFP instead of LBYL?