Skip to content

Commit

Permalink
This commit is another attempt to issues #41, and #43.
Browse files Browse the repository at this point in the history
  • Loading branch information
muammar committed Jan 29, 2017
1 parent 1aad081 commit 12055e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
17 changes: 1 addition & 16 deletions mkchromecast/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,6 @@ def initialize_cast(self):
print(colors.important('Index Friendly name'))
print(colors.important('===== ============= '))
self.availablecc()
"""
self.availablecc=[]
for self.index,device in enumerate(self.cclist):
print(str(self.index)+' ',str(device))
to_append = [self.index,device]
self.availablecc.append(to_append)
"""
else:
if self.debug == True:
print('else:')
Expand All @@ -192,19 +185,11 @@ def initialize_cast(self):
print(colors.important('Index Friendly name'))
print(colors.important('===== ============= '))
self.availablecc()
"""
self.availablecc=[]
for self.index,device in enumerate(self.cclist):
print(str(self.index)+' ',str(device))
to_append = [self.index,device]
self.availablecc.append(to_append)
"""
else:
if self.debug == True:
print('else:')
self.tf = open('/tmp/mkchromecast.tmp', 'rb')
self.index=pickle.load(self.tf)
self.cast_to = self.cclist[int(self.index)]
self.cast_to=pickle.load(self.tf)
self.availablecc()
print(' ')
print(colors.options('Casting to:')+' '+colors.success(self.cast_to))
Expand Down
2 changes: 1 addition & 1 deletion mkchromecast/systray.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def play_cast(self):
try:
if os.path.exists('/tmp/mkchromecast.tmp') == True:
self.tf = open('/tmp/mkchromecast.tmp', 'wb')
pickle.dump(self.index, self.tf)
pickle.dump(self.cast_to, self.tf)
self.tf.close()
except ValueError:
continue
Expand Down

0 comments on commit 12055e5

Please sign in to comment.