transition
This commit is contained in:
parent
bb4f2356de
commit
a962199727
@ -104,50 +104,50 @@ class StockTicker():
|
||||
current_img = 1
|
||||
|
||||
|
||||
#while True:
|
||||
while True:
|
||||
|
||||
if current_img == 1:
|
||||
image = self.openImage(image_files[0])
|
||||
elif current_img == 2:
|
||||
image = self.openImage(image_files[1])
|
||||
if current_img == 1:
|
||||
image = self.openImage(image_files[0])
|
||||
elif current_img == 2:
|
||||
image = self.openImage(image_files[1])
|
||||
|
||||
img_width, img_height = image.size
|
||||
img_width, img_height = image.size
|
||||
|
||||
while offset_x > -img_width:
|
||||
while offset_x > -img_width:
|
||||
|
||||
|
||||
offset_x -= 1
|
||||
offset_x -= 1
|
||||
|
||||
self.setImage(image, offset_x = offset_x, offset_y = offset_y)
|
||||
time.sleep(self.delay)
|
||||
self.setImage(image, offset_x = offset_x, offset_y = offset_y)
|
||||
time.sleep(self.delay)
|
||||
|
||||
|
||||
try:
|
||||
msg = getInput()
|
||||
if msg == 'K':
|
||||
self.resetMatrix()
|
||||
break
|
||||
try:
|
||||
msg = getInput()
|
||||
if msg == 'K':
|
||||
self.resetMatrix()
|
||||
break
|
||||
|
||||
elif msg == 's':
|
||||
stock_ticker.delay = 0.03
|
||||
elif msg == 'm':
|
||||
stock_ticker.delay = 0.01
|
||||
elif msg == 'f':
|
||||
stock_ticker.delay = 0.005
|
||||
elif msg in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']:
|
||||
self.brightness = min(1.0, float(msg)/10 + 0.1)
|
||||
elif msg == 's':
|
||||
stock_ticker.delay = 0.03
|
||||
elif msg == 'm':
|
||||
stock_ticker.delay = 0.01
|
||||
elif msg == 'f':
|
||||
stock_ticker.delay = 0.005
|
||||
elif msg in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']:
|
||||
self.brightness = min(1.0, float(msg)/10 + 0.1)
|
||||
|
||||
|
||||
except KeyboardInterrupt:
|
||||
sys.stdout.flush()
|
||||
pass
|
||||
except KeyboardInterrupt:
|
||||
sys.stdout.flush()
|
||||
pass
|
||||
|
||||
|
||||
if current_img == 1:
|
||||
current_img = 2
|
||||
elif current_img == 2:
|
||||
current_img = 1
|
||||
offset_x = 0
|
||||
if current_img == 1:
|
||||
current_img = 2
|
||||
elif current_img == 2:
|
||||
current_img = 1
|
||||
offset_x = 0
|
||||
|
||||
#Get the logo from file that is the same as ticker name
|
||||
def getLogo(self, Ticker):
|
||||
|
Loading…
Reference in New Issue
Block a user