Logo Search packages:      
Sourcecode: whichwayisup version File versions  Download package

variables.py

00001 class Variables:
  vdict = {}

def error_message(string):
  if Variables.vdict['verbose']:
    print("Error: " + string)
  log_message("Error: " + string)
  return

#Adds a message to the message log, which will be written on disk when the application closes.
def log_message(string):
  #Multiple messages of the same type aren't added to the log:
  if Variables.vdict.has_key("last_log_message"):
    if string == Variables.vdict["last_log_message"]:
      return

  Variables.vdict["last_log_message"] = string

  if Variables.vdict.has_key("log"):
    Variables.vdict["log"] = string + "\n" + Variables.vdict["log"]
  else:
    Variables.vdict["log"] = string

  return

Generated by  Doxygen 1.6.0   Back to index