armory/blender/log.py

38 lines
822 B
Python
Raw Normal View History

2016-10-19 13:28:06 +02:00
import props_ui
import space_armory
2016-10-27 01:11:11 +02:00
import armutils
2016-10-19 13:28:06 +02:00
progress = 100.0
tag_redraw = False
def clear():
props_ui.ArmoryProjectPanel.info_text = ''
2016-10-27 01:11:11 +02:00
if armutils.with_chromium():
2016-10-19 13:28:06 +02:00
space_armory.ArmorySpaceHeader.info_text = ''
def format_text(text):
return (text[:80] + '..') if len(text) > 80 else text # Limit str size
def print_info(text):
global tag_redraw
print(text)
props_ui.ArmoryProjectPanel.info_text = format_text(text)
tag_redraw = True
def print_player(text):
print(text)
space_armory.ArmorySpaceHeader.info_text = format_text(text)
def print_progress(value):
global progress
global tag_redraw
progress = value
tag_redraw = True
def get_progress(self):
global progress
return progress
2016-11-05 20:57:04 +01:00
def warn(text):
print('Armory Warning: ' + text)