mirror of
https://github.com/Febbweiss/mopidy-touchscreen.git
synced 2026-03-05 06:35:43 +00:00
Code cleanup
This commit is contained in:
@@ -196,9 +196,9 @@ latex_elements = {}
|
|||||||
# (source start file, target name, title,
|
# (source start file, target name, title,
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'Mopidy-Touchscreen.tex',
|
('index', 'Mopidy-Touchscreen.tex',
|
||||||
u'Mopidy-Touchscreen Documentation',
|
u'Mopidy-Touchscreen Documentation',
|
||||||
u'9and3r', 'manual'),
|
u'9and3r', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
|
|||||||
@@ -82,4 +82,3 @@ class LibraryScreen():
|
|||||||
else:
|
else:
|
||||||
# TODO: add folder to tracks to play
|
# TODO: add folder to tracks to play
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
from .screen_objects import ScreenObjectsManager, TouchAndTextItem, ScrollBar
|
|
||||||
from .touch_manager import TouchManager
|
from .touch_manager import TouchManager
|
||||||
|
from .screen_objects import ScreenObjectsManager, TouchAndTextItem, ScrollBar
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -50,8 +49,8 @@ class ListView():
|
|||||||
width = self.size[0]
|
width = self.size[0]
|
||||||
while i < self.list_size and z < self.max_rows:
|
while i < self.list_size and z < self.max_rows:
|
||||||
item = TouchAndTextItem(self.font, self.list[i], (
|
item = TouchAndTextItem(self.font, self.list[i], (
|
||||||
self.pos[0], self.pos[1] + self.base_size * z),
|
self.pos[0], self.pos[1] + self.base_size * z),
|
||||||
(width, -1))
|
(width, -1))
|
||||||
self.screen_objects.set_touch_object(str(i), item)
|
self.screen_objects.set_touch_object(str(i), item)
|
||||||
i += 1
|
i += 1
|
||||||
z += 1
|
z += 1
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import hashlib
|
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
import urllib
|
import urllib
|
||||||
import urllib2
|
import urllib2
|
||||||
import json
|
import json
|
||||||
import pygame
|
import hashlib
|
||||||
import logging
|
import logging
|
||||||
|
import pygame
|
||||||
from .touch_manager import TouchManager
|
from .touch_manager import TouchManager
|
||||||
from .screen_objects import ScreenObjectsManager, Progressbar, \
|
from .screen_objects import ScreenObjectsManager, Progressbar, \
|
||||||
TouchAndTextItem, TextItem
|
TouchAndTextItem, TextItem
|
||||||
@@ -90,7 +89,7 @@ class MainScreen():
|
|||||||
None)
|
None)
|
||||||
self.touch_text_manager.set_touch_object("next", button)
|
self.touch_text_manager.set_touch_object("next", button)
|
||||||
|
|
||||||
#Progress
|
# Progress
|
||||||
progress = Progressbar(self.fonts['base'],
|
progress = Progressbar(self.fonts['base'],
|
||||||
time.strftime('%M:%S', time.gmtime(
|
time.strftime('%M:%S', time.gmtime(
|
||||||
0)) + "/" + time.strftime('%M:%S',
|
0)) + "/" + time.strftime('%M:%S',
|
||||||
@@ -143,7 +142,8 @@ class MainScreen():
|
|||||||
MainScreen.get_track_album_name(self.track))
|
MainScreen.get_track_album_name(self.track))
|
||||||
url = "http://ws.audioscrobbler.com/2.0/?"
|
url = "http://ws.audioscrobbler.com/2.0/?"
|
||||||
params = "method=album.getinfo&" + \
|
params = "method=album.getinfo&" + \
|
||||||
"api_key=59a04c6a73fb99d6e8996e01db306829&artist=" \
|
"api_key=59a04c6a73fb99d6e8996e01db306829&" \
|
||||||
|
+ "artist=" \
|
||||||
+ safe_artist + "&album=" + safe_album + "&format=json"
|
+ safe_artist + "&album=" + safe_album + "&format=json"
|
||||||
response = urllib2.urlopen(url + params)
|
response = urllib2.urlopen(url + params)
|
||||||
data = json.load(response)
|
data = json.load(response)
|
||||||
|
|||||||
Reference in New Issue
Block a user