Ejemplo n.º 1
0
 def __init__(self):
     super(AnimationTestPanel, self).__init__()
     self.set_needs_repaint()
     self.fps_font = fonts.get('tempesta', 8)
     self.img = fonts.get('tempesta', 16).render('piradio')
     self.x = 0
     self.y = 0
     self.dirx = 3
     self.diry = 3
     self.fps = 0
Ejemplo n.º 2
0
 def __init__(self, weather_service, **config):
     super(WeatherPanel, self).__init__()
     self.city = config['title']
     self.font_big = fonts.get('tempesta', 16)
     self.font = fonts.get('tempesta', 8)
     self.climacons = fonts.get('climacons', 32)
     self.weather_glyph = 'Y'
     self.weather_summary = ''
     lat, lon = config['lat'], config['lon']
     weather_service.subscribe((lat, lon), self.on_forecast_changed)
Ejemplo n.º 3
0
 def __init__(self, weather_service, **config):
     super(WeatherPanel, self).__init__()
     self.city = config['title']
     self.font_big = fonts.get('tempesta', 16)
     self.font = fonts.get('tempesta', 8)
     self.climacons = fonts.get('climacons', 32)
     self.weather_glyph = 'Y'
     self.weather_summary = ''
     lat, lon = config['lat'], config['lon']
     weather_service.subscribe((lat, lon), self.on_forecast_changed)
Ejemplo n.º 4
0
 def __init__(self, audio_service, clock_service, **config):
     super(RadioPanel, self).__init__()
     self.font = fonts.get('tempesta', 8)
     self.glyph_font = fonts.get('pixarrows', 10)
     self.stations = collections.OrderedDict(sorted(config.items()))
     self.cy = 0
     self.currstation = ''
     self.timeofday = clock_service.timeofday()
     self.audio_service = audio_service
     clock_service.subscribe(clock_service.TIME_CHANGED_EVENT,
                             self.on_time_changed)
Ejemplo n.º 5
0
 def __init__(self, audio_service, clock_service, **config):
     super(RadioPanel, self).__init__()
     self.font = fonts.get('tempesta', 8)
     self.glyph_font = fonts.get('pixarrows', 10)
     self.stations = collections.OrderedDict(sorted(config.items()))
     self.cy = 0
     self.currstation = ''
     self.timeofday = clock_service.timeofday()
     self.audio_service = audio_service
     clock_service.subscribe(clock_service.TIME_CHANGED_EVENT,
                             self.on_time_changed)
Ejemplo n.º 6
0
 def __init__(self, public_transport_service, **config):
     super(PublicTransportPanel, self).__init__()
     self.station = config['station']
     self.font = fonts.get('tempesta', 8)
     self.upcoming_trains = []
     self.svc = public_transport_service
     self.svc.subscribe(self.station, self.on_trains_changed)
Ejemplo n.º 7
0
 def __init__(self, audio_service):
     super(AlarmPanel, self).__init__()
     self.font = fonts.get('tempesta', 32)
     self.prev_timestr = None
     self.countdown = 60 * 3
     self.alarmtime = None
     self.countdown_str = self.countdownstring()
     self.state = 'SET_TIME'
     self.stepsize = 60
     self.audio_service = audio_service
Ejemplo n.º 8
0
 def __init__(self, audio_service):
     super(AlarmPanel, self).__init__()
     self.font = fonts.get('tempesta', 32)
     self.prev_timestr = None
     self.countdown = 60 * 3
     self.alarmtime = None
     self.countdown_str = self.countdownstring()
     self.state = 'SET_TIME'
     self.stepsize = 60
     self.audio_service = audio_service
Ejemplo n.º 9
0
 def __init__(self, podcast_service, audio_service, **config):
     super(RandomPodcastPanel, self).__init__()
     feed_url = config['url']
     self.font = fonts.get('tempesta', 8)
     self.episodes = []
     self.episode_url = None
     self.title = config['title']
     self.episode_title = 'Press (center) to play random episode'
     self.lastrefresh = 0
     self.audio_service = audio_service
     podcast_service.subscribe(feed_url, self.on_episodes_changed)
Ejemplo n.º 10
0
    def __init__(self):
        super(ShootEmUpGamePanel, self).__init__()

        self.fps = 0
        self.bg_scroll_offset = 0
        self.fg_scroll_offset = 0
        self.ship_x = 5
        self.ship_y = 24
        self.shots = []

        # Load assets
        self.fps_font = fonts.get('tempesta', 8)
        self.background_img = graphics.Surface(
            filename='assets/shmup/background.png', dither=True)
        self.foreground_img = graphics.Surface(
            filename='assets/shmup/foreground.png', dither=True)
        self.ship_img = graphics.Surface(filename='assets/shmup/ship.png', )
Ejemplo n.º 11
0
    def __init__(self):
        cwd = os.getcwd()
        fonts.register('tempesta',
                       os.path.join(cwd, 'assets/pf_tempesta_seven.ttf'))
        fonts.register('pixarrows', os.path.join(cwd, 'assets/pixarrows.ttf'))
        fonts.register('climacons', os.path.join(cwd, 'assets/climacons.ttf'))
        fonts.register('helvetica', os.path.join(cwd, 'assets/helvetica.ttf'))

        self.sleeptimer = SleepTimer(CONFIG['sleep_after_minutes'] * 60)
        self.framebuffer = None
        self.prev_keystates = None
        self.font = fonts.get('tempesta', 8)
        self.panels = []
        self.panel_defs = self.read_panels(CONFIG['panels'])
        self.panel_idx = None
        self.active_panel = None
        self.active_panel_fb = None
        self.backing_stores = {}
        self.broker = services.ServiceBroker()
Ejemplo n.º 12
0
    def __init__(self):
        cwd = os.getcwd()
        fonts.register('tempesta',
                       os.path.join(cwd, 'assets/pf_tempesta_seven.ttf'))
        fonts.register('pixarrows', os.path.join(cwd, 'assets/pixarrows.ttf'))
        fonts.register('climacons', os.path.join(cwd, 'assets/climacons.ttf'))
        fonts.register('helvetica', os.path.join(cwd, 'assets/helvetica.ttf'))

        self.sleeptimer = SleepTimer(CONFIG['sleep_after_minutes'] * 60)
        self.framebuffer = None
        self.prev_keystates = None
        self.font = fonts.get('tempesta', 8)
        self.panels = []
        self.panel_defs = self.read_panels(CONFIG['panels'])
        self.panel_idx = None
        self.active_panel = None
        self.active_panel_fb = None
        self.backing_stores = {}
        self.broker = services.ServiceBroker()
Ejemplo n.º 13
0
    def __init__(self):
        super(ShootEmUpGamePanel, self).__init__()

        self.fps = 0
        self.bg_scroll_offset = 0
        self.fg_scroll_offset = 0
        self.ship_x = 5
        self.ship_y = 24
        self.shots = []

        # Load assets
        self.fps_font = fonts.get('tempesta', 8)
        self.background_img = graphics.Surface(
            filename='assets/shmup/background.png',
            dither=True
        )
        self.foreground_img = graphics.Surface(
            filename='assets/shmup/foreground.png',
            dither=True
        )
        self.ship_img = graphics.Surface(
            filename='assets/shmup/ship.png',
        )