Skip to content

Commit

Permalink
Update stamp to match since we're now specifically comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepeterson committed Sep 25, 2018
1 parent 96cbd7b commit f2d3fd2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/yo_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def process_notifications():
cached_args[arg_set] != receipts[arg_set]:
args = eval(arg_set) # pylint: disable=eval-used
run_yo_with_args(args)
add_receipt(args)
add_receipt(args, cached_args[arg_set])


def get_scheduled_notifications():
Expand Down Expand Up @@ -249,14 +249,16 @@ def get_receipts():
return dict(receipts) if receipts else {}


def add_receipt(yo_args):
def add_receipt(yo_args, stamp=None):
"""Add a receipt to current user's receipt preferences.
Args:
yo_args (list of str): Arguments to yo app as for a subprocess.
"""
receipts = get_receipts()
receipts[repr(yo_args)] = NSDate.alloc().init()
if stamp == None:
stamp = NSDate.alloc().init()
receipts[repr(yo_args)] = stamp
CFPreferencesSetAppValue("DeliveryReceipts", receipts, BUNDLE_ID)
CFPreferencesAppSynchronize(BUNDLE_ID)

Expand Down

0 comments on commit f2d3fd2

Please sign in to comment.