rt-send-all-reminders: Support extra args for rt in the YAML file.

This commit is contained in:
Brett Smith 2018-05-16 15:59:09 -04:00
parent de60b9ed56
commit ddf525f0c5

View file

@ -17,7 +17,7 @@ SHARE_DIR.mkdir(parents=True, exist_ok=True)
class Reminder: class Reminder:
def __init__(self, key, min_days, max_days, search, body_file, def __init__(self, key, min_days, max_days, search, body_file,
date_field='Due', action='correspond', dry_run=False): date_field='Due', action='correspond', dry_run=False, rt_args=None):
self.key = key self.key = key
self.min_days_diff = int(min_days) self.min_days_diff = int(min_days)
self.max_days_diff = int(max_days) self.max_days_diff = int(max_days)
@ -26,6 +26,7 @@ class Reminder:
self.body_file = body_file self.body_file = body_file
self.action = action self.action = action
self.dry_run = dry_run self.dry_run = dry_run
self.rt_args = [] if rt_args is None else rt_args.copy()
def _remind_cmd(self): def _remind_cmd(self):
yield 'rt-auto-remind' yield 'rt-auto-remind'
@ -39,6 +40,7 @@ class Reminder:
yield str(self.max_days_diff) yield str(self.max_days_diff)
yield self.search yield self.search
yield str(self.body_file) yield str(self.body_file)
yield from self.rt_args
def remind_cmd(self): def remind_cmd(self):
return list(self._remind_cmd()) return list(self._remind_cmd())