/ client_code / utils / _warnings.py
_warnings.py
 1  # SPDX-License-Identifier: MIT
 2  #
 3  # Copyright (c) 2021 The Anvil Extras project team members listed at
 4  # https://github.com/anvilistas/anvil-extras/graphs/contributors
 5  #
 6  # This software is published at https://github.com/anvilistas/anvil-extras
 7  
 8  __version__ = "3.1.0"
 9  
10  _warnings = {}
11  
12  
13  def warn(key, msg, type="WARNING"):
14      if _warnings.get(key):
15          return
16      _warnings[key] = True
17      print(f"{type}: {msg}")