Writes text to the stdout (console) stream
(data, bold=False)
| 79 | |
| 80 | |
| 81 | def dataToStdout(data, bold=False): |
| 82 | """ |
| 83 | Writes text to the stdout (console) stream |
| 84 | """ |
| 85 | if conf.SCREEN_OUTPUT: |
| 86 | if conf.ENGINE is ENGINE_MODE_STATUS.THREAD: |
| 87 | logging._acquireLock() |
| 88 | |
| 89 | if isinstance(data, unicode): |
| 90 | message = stdoutencode(data) |
| 91 | else: |
| 92 | message = data |
| 93 | |
| 94 | sys.stdout.write(setColor(message, bold)) |
| 95 | |
| 96 | try: |
| 97 | sys.stdout.flush() |
| 98 | except IOError: |
| 99 | pass |
| 100 | |
| 101 | if conf.ENGINE is ENGINE_MODE_STATUS.THREAD: |
| 102 | logging._releaseLock() |
| 103 | return |
| 104 | |
| 105 | |
| 106 | def setColor(message, bold=False): |
no test coverage detected