config.py 431 B

1234567891011121314151617
  1. import os
  2. import sys
  3. import playhouse.sqlite_ext
  4. DB = playhouse.sqlite_ext.SqliteExtDatabase(None)
  5. PER_PAGE = 50
  6. if sys.stderr.isatty():
  7. def log(msg, *args, **kwargs):
  8. sys.stderr.write(msg.format(*args, **kwargs))
  9. sys.stderr.write("\n")
  10. else:
  11. def log(msg, *args, **kwargs):
  12. sys.stderr.write("\x1b[31m")
  13. sys.stderr.write(msg.format(*args, **kwargs))
  14. sys.stderr.write("\x1b[39m\n")