Created
February 24, 2011 10:42
-
-
Save hansent/842038 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import kivy | |
| kivy.require('1.0.4') | |
| from kivy.app import App | |
| from kivy.core.window import Window | |
| from kivy.properties import StringProperty | |
| from kivy.uix.widget import Widget | |
| from kivy.uix.floatlayout import FloatLayout | |
| from kivy.uix.video import Video | |
| from kivy.uix.label import Label | |
| #load cached movie feed data | |
| import shelve | |
| from movie import Movie | |
| movies = shelve.open('movie.shelve') | |
| class AppScreen(FloatLayout): | |
| def __init___(self, **kwargs): | |
| kwargs['size'] = (540,960) | |
| super(AppScreen, self).__init__(**kwargs) | |
| print "INIT" | |
| self.setup() | |
| def setup(self): | |
| print "APP SCREEN INIT" | |
| pass | |
| class InfoScreen(AppScreen): | |
| movie_name = StringProperty("") | |
| def on_movie_name(self, instance, movie_name): | |
| movie = movies.get(movie_name) | |
| if not movie: | |
| return | |
| #instance.video.source = movie.trailer | |
| #instance.title.text = movie.title | |
| def setup(self): | |
| self.video = Video() | |
| self.add_widget(self.video) | |
| self.title = Label() | |
| self.add_widget(self.title) | |
| class CinemaKiosk(App): | |
| def build(self): | |
| info_screen = InfoScreen() | |
| info_screen.movie_name = 'apollo18' | |
| return info_screen | |
| CinemaKiosk().run() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment