PrintLog.py 509 B

12345678910111213141516171819202122
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # COPYRIGHT: Openmoko Inc. 2009
  4. # LICENSE: GPL Version 3 or later
  5. # DESCRIPTION: Article Rendering
  6. # AUTHORS: Sean Moss-Pultz <sean@openmoko.com>
  7. # Christopher Hall <hsw@openmoko.com>
  8. import sys, os
  9. # overcome Pythons buggy unicode handling in print statements
  10. def message(data):
  11. if type(data) == unicode:
  12. sys.stdout.write(data.encode('utf-8'))
  13. else:
  14. sys.stdout.write(data)
  15. sys.stdout.write('\n')
  16. sys.stdout.flush()