Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def make_widget(db, log, tabs, bar, saves):
body = []
for row in db.db.execute('select id, start, finish, title, sort from aim'):
injury, binder = make_bound_aim(db, log, tabs, bar)
saves.append(binder.save)
binder.read_row(row)
body.append(injury)
pile = DividedPile(body)
def insert_callback(saves=saves, pile=pile):
contents = pile.contents
aim, binder = make_bound_aim(db, log, tabs, bar, insert_callback=insert_callback)
saves.append(binder.save)
if contents: contents.append((Divider(), (WEIGHT, 1)))
contents.append((aim, (WEIGHT, 1)))
pile.contents = contents
insert_callback() # initial empty
return pile
def make_widget(db, log, tabs, bar, saves):
body = []
for row in db.db.execute('select id, start, finish, title, sort, specification from reminder'):
reminder, binder = make_bound_reminder(db, log, tabs, bar)
saves.append(binder.save)
binder.read_row(row)
body.append(reminder)
pile = DividedPile(body)
def insert_callback(saves=saves, pile=pile):
contents = pile.contents
reminder, binder = make_bound_reminder(db, log, tabs, bar, insert_callback=insert_callback)
saves.append(binder.save)
if contents: contents.append((Divider(), (WEIGHT, 1)))
contents.append((reminder, (WEIGHT, 1)))
pile.contents = contents
insert_callback() # initial empty
return pile