def load_config(self): config = Config('space_window.conf', __file__) self._delay = config.getint('nasa', 'frame_delay', 5) self._fontname = config.get('font', 'name', 'comicsansms') self._fontsize = config.getint('nasa', 'font_size', 48) self._font = pg.font.SysFont(self._fontname, self._fontsize) self._text_col = config.getcolor('nasa', 'foreground', (100, 100, 100)) self._text_height_ratio = config.getint('nasa', 'height_ratio', 10)
def load_config(self): config = Config('space_window.conf', __file__) self._forecol = config.getcolor('clock', 'foreground', (255, 128, 0)) bckcol = config.getcolor('clock', 'background', (32, 0, 32)) time_sz = config.getint('clock', 'time_size', 192) date_sz = config.getint('clock', 'date_size', 24) self._border = config.getint('clock', 'border', 10) self._separation = config.getint('clock', 'separation', 8) path = os.path.dirname(os.path.abspath(__file__)) fontname = os.path.join(path, 'digital-7_mono.ttf') self._time_font = pygame.font.Font(fontname, time_sz) self._secs_font = pygame.font.Font(fontname, time_sz / 3) self._date_font = pygame.font.Font(fontname, date_sz) self._black.fill(bckcol) self._init_rects() timezone = config.get('clock', 'timezone', 'NONE') if timezone != 'NONE': os.environ['TZ'] = timezone time.tzset()
def screen(): global _screen if _screen is None: config = Config('space_window.conf', __file__) fbdev = config.get('pygame', 'fbdev', 'None') if fbdev != 'None': os.putenv('SDL_VIDEODRIVER', 'fbcon') os.environ["SDL_FBDEV"] = fbdev pygame_init() scrw = config.getint('pygame', 'screen_width', 0) scrh = config.getint('pygame', 'screen_height', 0) depth = config.getint('pygame', 'screen_depth', 0) if depth == 0: _screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN) else: _screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN, depth) return _screen
def __init__(self,screen): config = Config('space_window.conf',__file__) self._border=config.getint('message','border',10) self._left=config.getbool('message','left',False) self._top=config.getbool('message','top',False) self._forecol=config.getcolor('message','foreground',(255,128,0)) bckcol=config.getcolor('message','background',(32,0,32)) fontname=config.get('font','name','comicsansms') fontsz=config.getint('message','font_size',68) self.running=False self._delay=1 self._screen=None self.text=None self.black=None self.font=None #sleep(1) self.screen = screen self.black=self.screen.copy() self.black.fill(bckcol) self.font = pg.font.SysFont(fontname, fontsz) self.lock=threading.Lock()
def load_config(self): config = Config('space_window.conf', __file__) self._delay = config.getint('gallery', 'frame_delay', 10)