''' ut: universal tweener with asynch locks for python ~ gbdu''' from getmylogger import silent_logger, loud_logger from multiprocessing import Lock import exceptions llog = silent_logger("tweener") DEFAULT_TWEEN_TO = 0 DEFAULT_TWEEN_MIN = 0 DEFAULT_TWEEN_VALUE = 0 class Ut: '''universal tweener for python -- with locks''' _itl = [] def find_tweener(self, name): '''returns an internal dict if a tweener exists in internal list''' if len(self._itl) == 0: llog.warning("list not initd eyet and youre trying to find %s ", name) return False for i in self._itl: if i['name'] == name: llog.info("returning %s as found ", name) return i return False def add_tweener(self, name, init_val=20, tween_to=20):
def draw_panel_label(surf): def draw_version_label(screen): def get_component_color(component_pipe): dlog.info('create console') except Exception as e : except: exit(1) exit(1) exit(1) for i in range(256): global bigned global color_ut global color_ut global dlog global llog global main_breakout global screen globals()["bigned"].signal_extinguish() globals()["color_ut"] = None globals()["gfont"] = g.create_font() globals()["gselected_component"] = 1 globals()["llog"].info("extinguished") globals()["main_breakout"] = Value("d", 0) globals()["main_breakout"].value = 0 globals()["screen"] = g.init_pygame() init_color_tweeners() inverse = [abs(250-color[0]), abs(250-color[1]), abs(250-color[2])] inverse = [color[0]-a, color[1]-a, color[2]-a] key_calls={"d": extinguish_and_deload}) llog.error("error while init [ FAIL ] ") llog.error("failed to init tweeners: %s", e) llog.error("unknown error while init tweeners") llog.info("* PROCESS: Draw") llog.info("---> ABOUT TO DELOAD") llog.info("entering main draw loop") llog.info("exiting main draw loop...") llog.info("here we go") llog.info("init'd font successful [ SUCCESS ] ") llog.info("init'd screen [ SUCCESS ]") llog.info("signaled extinguish [ SUCCESS ]") llog.info("ut init'd successfully... [ SUCCESS ] ") panel_label_surf = pygame.Surface((256, 100)) panel_label_where = (20, 300) pass pass print e return return return inverse return inverse screen.fill((35, 35, 35)) try: try: while main_breakout.value == 1: """2 processes: NedProcess, DrawProcess""" """draw a visual AI window""" ## Innit is done #### Start here __version__ = "base" def Draw(theNed): def extinguish_and_deload(): def get_color_dimmer(color,a=20): def get_color_inverse(color): def init_color_tweeners(): def init_console(screen, key_calls): def setup_color_tweens(): ## This is a list of tweens set up by default... except Exception as e: except ValueError as e: except: from getmylogger import silent_logger,loud_logger from multiprocessing import Process, Value from Text import Text from time import sleep globals()["bigned"] = None globals()["dlog"] = silent_logger("drawing_examples") #silent drawing logger globals()["llog"] = loud_logger("drawing_examples") #loud logger (shows in console) globals()["llog"].info("log setup! [ SUCCESS ] ") globals()["selected_component_id"] = 0 globals()["user_console"] = init_console(globals()["screen"], if __name__ == '__main__': import exceptions import gui_helpers as g import os,sys import pygame,pyconsole import random import ut llog = globals()["llog"] try: try: USER_CONSOLE_ENABLED = True #only checked when drawing
''' ut: universal tweener with asynch locks for python ~ gbdu''' from getmylogger import silent_logger,loud_logger from multiprocessing import Lock import exceptions llog = silent_logger("tweener") DEFAULT_TWEEN_TO = 0 DEFAULT_TWEEN_MIN = 0 DEFAULT_TWEEN_VALUE = 0 class Ut: '''universal tweener for python -- with locks''' _itl = [] def find_tweener(self, name): '''returns an internal dict if a tweener exists in internal list''' if len(self._itl) == 0: llog.warning("list not initd eyet and youre trying to find %s ", name) return False for i in self._itl : if i['name'] == name: llog.info("returning %s as found ", name) return i return False def add_tweener(self, name, init_val=20, tween_to=20): '''adds a tweener to this ut list, does nothing if it already exists'''