Skip to content

Commit

Permalink
quality ++
Browse files Browse the repository at this point in the history
  • Loading branch information
KenT2 committed Jan 18, 2015
1 parent 356a025 commit e8a2f24
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions pp_hyperlinkshow.py
Expand Up @@ -211,11 +211,11 @@ def input_pressed_this_show(self,symbol,edge,source):
# in-track operations
elif link_op =='pause':
if self.current_player is not None:
self.current_player.input_pressed(operation)
self.current_player.input_pressed(link_op)

elif link_op[0:4] == 'omx-' or link_op[0:6] == 'mplay-'or link_op[0:5] == 'uzbl-':
if self.current_player is not None:
self.current_player.input_pressed(operation)
self.current_player.input_pressed(link_op)

else:
self.mon.err(self,"unknown link command: "+ link_op)
Expand Down
36 changes: 18 additions & 18 deletions pp_imageplayer.py
Expand Up @@ -231,34 +231,34 @@ def do_dwell(self):
# called from Player, load_x_content

def load_track_content(self):
pil_image=None # Keep landscape happy
ppil_image=None # Keep landscape happy

# get the track to be displayed
if os.path.exists(self.track) is True:
pil_image=Image.open(self.track)
ppil_image=Image.open(self.track)
else:
pil_image=None
ppil_image=None
self.tk_img=None
self.track_image_obj=None
return 'error','Track file not found '+ self.track

# display track image
if pil_image is not None:
self.image_width,self.image_height=pil_image.size
if ppil_image is not None:
self.image_width,self.image_height=ppil_image.size

if self.command == 'original':
# display image at its original size
if self.has_coords is False:
# load and display the unmodified image in centre
self.tk_img=ImageTk.PhotoImage(pil_image)
del pil_image
self.tk_img=ImageTk.PhotoImage(ppil_image)
del ppil_image
self.track_image_obj = self.canvas.create_image(self.show_canvas_centre_x+self.show_canvas_x1,
self.show_canvas_centre_y+self.show_canvas_y1,
image=self.tk_img, anchor=CENTER)
else:
# load and display the unmodified image at x1,y1
self.tk_img=ImageTk.PhotoImage(pil_image)
del pil_image
self.tk_img=ImageTk.PhotoImage(ppil_image)
del ppil_image
self.track_image_obj = self.canvas.create_image(self.image_x1+self.show_canvas_x1,
self.image_y1+self.show_canvas_y1,
image=self.tk_img, anchor=NW)
Expand All @@ -279,9 +279,9 @@ def load_track_content(self):

if (self.image_width > window_width or self.image_height > window_height and self.command == 'fit') or (self.command == 'shrink') :
# original image is larger or , shrink it to fit the screen preserving aspect
pil_image.thumbnail((window_width,window_height),eval(self.image_filter))
self.tk_img=ImageTk.PhotoImage(pil_image)
del pil_image
ppil_image.thumbnail((window_width,window_height),eval(self.image_filter))
self.tk_img=ImageTk.PhotoImage(ppil_image)
del ppil_image
self.track_image_obj = self.canvas.create_image(window_centre_x + self.show_canvas_x1,
window_centre_y + self.show_canvas_y1,
image=self.tk_img, anchor=CENTER)
Expand All @@ -297,9 +297,9 @@ def load_track_content(self):
increased_width=int(self.image_width * prop)
increased_height=int(self.image_height * prop)
# print 'result',prop, increased_width,increased_height
pil_image=pil_image.resize((increased_width, increased_height),eval(self.image_filter))
self.tk_img=ImageTk.PhotoImage(pil_image)
del pil_image
ppil_image=ppil_image.resize((increased_width, increased_height),eval(self.image_filter))
self.tk_img=ImageTk.PhotoImage(ppil_image)
del ppil_image
self.track_image_obj = self.canvas.create_image(window_centre_x + self.show_canvas_x1,
window_centre_y + self.show_canvas_y1,
image=self.tk_img, anchor=CENTER)
Expand All @@ -317,9 +317,9 @@ def load_track_content(self):
window_centre_x=self.show_canvas_centre_x
window_centre_y=self.show_canvas_centre_y

pil_image=pil_image.resize((window_width, window_height),eval(self.image_filter))
self.tk_img=ImageTk.PhotoImage(pil_image)
del pil_image
ppil_image=ppil_image.resize((window_width, window_height),eval(self.image_filter))
self.tk_img=ImageTk.PhotoImage(ppil_image)
del ppil_image
self.track_image_obj = self.canvas.create_image(window_centre_x+ self.show_canvas_x1,
window_centre_y+ self.show_canvas_y1,
image=self.tk_img, anchor=CENTER)
Expand Down
6 changes: 3 additions & 3 deletions pp_player.py
Expand Up @@ -126,15 +126,15 @@ def pre_show(self):


# to keep landscape happy
def ready_callback(self):
def ready_callback(self,enable_show_background):
self.mon.fatal(self,'ready callback not overridden')
self.end('error','ready callback not overridden')

def finished_callback(self):
def finished_callback(self,reason,message):
self.mon.fatal(self,'finished callback not overridden')
self.end('error','finished callback not overridden')

def closed_callback(self):
def closed_callback(self,reason,message):
self.mon.fatal(self,'closed callback not overridden')
self.end('error','closed callback not overridden')

Expand Down
4 changes: 2 additions & 2 deletions pp_radiobuttonshow.py
Expand Up @@ -148,11 +148,11 @@ def input_pressed_this_show(self,symbol,edge,source):
# in-track operations
elif link_op =='pause':
if self.current_player is not None:
self.current_player.input_pressed(operation)
self.current_player.input_pressed(link_op)

elif link_op[0:4] == 'omx-' or link_op[0:6] == 'mplay-'or link_op[0:5] == 'uzbl-':
if self.current_player is not None:
self.current_player.input_pressed(operation)
self.current_player.input_pressed(link_op)

else:
self.mon.err(self,"unknown link command: "+ link_op)
Expand Down

0 comments on commit e8a2f24

Please sign in to comment.