Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _toast(self, text, length_long=False):
if self.toasty:
toast.toast(text, length_long)
def new_board(self, sgf_model=None, collection_model=None, from_file='', mode='Play', gridsize=19, handicap=0, goto=True):
toast('Loading sgf', False)
load_from_file = False
t1 = time()
# Get a collection and collectionsgf to contain and represent the board
filen = from_file
if sgf_model is not None:
sgf = sgf_model
if sgf.filename:
filen = sgf.filename
load_from_file = True
elif collection_model is not None:
sgf = Sgf()
sgf.save()
collectionsgf = CollectionSgf(collection=collection_model, sgf=sgf)
collectionsgf.save()