mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-12 03:10:17 +01:00
trying to make it run on both a computer of local deving and the pi
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*.pyc
|
||||
*.log
|
||||
@@ -30,7 +30,7 @@ def setup_logging():
|
||||
logger = setup_logging()
|
||||
|
||||
######## sets paths and constants ########
|
||||
PATH_TO_BROWSER = '/home/pi/pp_home/media' #TODO replace this with pi path name when i know what makes sense
|
||||
PATH_TO_BROWSER = get_the_current_dir_path() #TODO replace this with pi path name when i know what makes sense
|
||||
PATH_TO_DATA_OBJECTS = get_the_current_dir_path()
|
||||
EMPTY_BANK = dict(name='',location='',length=-1,start=-1,end=-1)
|
||||
|
||||
|
||||
@@ -261,7 +261,11 @@ canvas.pack()
|
||||
|
||||
data = data_centre.data()
|
||||
|
||||
video_driver = video_centre.video_driver(canvas)
|
||||
try:
|
||||
video_driver = video_centre.video_driver(canvas)
|
||||
except Exception as e:
|
||||
logger.error(traceback.format_exc())
|
||||
logger.error(str(e))
|
||||
|
||||
last_scene = None
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import time
|
||||
from omxdriver import OMXDriver #<== for deving only
|
||||
try:
|
||||
from omxdriver import OMXDriver #<== for deving only
|
||||
has_omx = True
|
||||
except ImportError:
|
||||
has_omx = False
|
||||
from Tkinter import Tk, Canvas
|
||||
import data_centre
|
||||
|
||||
@@ -9,13 +13,14 @@ logger = data_centre.setup_logging()
|
||||
|
||||
class video_driver(object):
|
||||
def __init__(self, widget = None):
|
||||
logger.info('this is a test')
|
||||
|
||||
self.widget = widget
|
||||
self.delay = 50
|
||||
logger.info('the has_omx flag is {}'.format(has_omx))
|
||||
if has_omx:
|
||||
self.last_player = video_player(self.widget,'a')
|
||||
self.current_player = video_player(self.widget,'b')
|
||||
self.next_player = video_player(self.widget,'c')
|
||||
|
||||
self.manual_next = False
|
||||
|
||||
self.widget.after(self.delay,self.begin_playing)
|
||||
@@ -83,8 +88,11 @@ class video_driver(object):
|
||||
|
||||
|
||||
def get_info_for_video_display(self):
|
||||
if has_omx:
|
||||
return self.current_player.bank_number, self.current_player.status, self.next_player.bank_number,\
|
||||
self.next_player.status, self.current_player.duration, self.current_player.video_length
|
||||
else:
|
||||
return 0, 'test', 1, 'test' , 0, 10
|
||||
|
||||
|
||||
class video_player(object):
|
||||
|
||||
Reference in New Issue
Block a user