From 9ade6ebf2de0a0f9e27bc278af9f1c320a4e8250 Mon Sep 17 00:00:00 2001 From: 9and3r <9and3r@gmail.com> Date: Mon, 4 Aug 2014 13:46:07 +0200 Subject: [PATCH] Code cleanup --- docs/conf.py | 6 +++--- mopidy_touchscreen/library_screen.py | 1 - mopidy_touchscreen/list_view.py | 7 +++---- mopidy_touchscreen/main_screen.py | 10 +++++----- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7f9c92c..776a179 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -196,9 +196,9 @@ latex_elements = {} # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('index', 'Mopidy-Touchscreen.tex', - u'Mopidy-Touchscreen Documentation', - u'9and3r', 'manual'), + ('index', 'Mopidy-Touchscreen.tex', + u'Mopidy-Touchscreen Documentation', + u'9and3r', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of diff --git a/mopidy_touchscreen/library_screen.py b/mopidy_touchscreen/library_screen.py index feee3db..e2ba9cd 100644 --- a/mopidy_touchscreen/library_screen.py +++ b/mopidy_touchscreen/library_screen.py @@ -82,4 +82,3 @@ class LibraryScreen(): else: # TODO: add folder to tracks to play pass - diff --git a/mopidy_touchscreen/list_view.py b/mopidy_touchscreen/list_view.py index 78751f3..bc5f583 100644 --- a/mopidy_touchscreen/list_view.py +++ b/mopidy_touchscreen/list_view.py @@ -1,7 +1,6 @@ import logging -from .screen_objects import ScreenObjectsManager, TouchAndTextItem, ScrollBar from .touch_manager import TouchManager - +from .screen_objects import ScreenObjectsManager, TouchAndTextItem, ScrollBar logger = logging.getLogger(__name__) @@ -50,8 +49,8 @@ class ListView(): width = self.size[0] while i < self.list_size and z < self.max_rows: item = TouchAndTextItem(self.font, self.list[i], ( - self.pos[0], self.pos[1] + self.base_size * z), - (width, -1)) + self.pos[0], self.pos[1] + self.base_size * z), + (width, -1)) self.screen_objects.set_touch_object(str(i), item) i += 1 z += 1 diff --git a/mopidy_touchscreen/main_screen.py b/mopidy_touchscreen/main_screen.py index df880fa..e1cbc0f 100644 --- a/mopidy_touchscreen/main_screen.py +++ b/mopidy_touchscreen/main_screen.py @@ -1,13 +1,12 @@ -import hashlib import time import os from threading import Thread import urllib import urllib2 import json -import pygame +import hashlib import logging - +import pygame from .touch_manager import TouchManager from .screen_objects import ScreenObjectsManager, Progressbar, \ TouchAndTextItem, TextItem @@ -90,7 +89,7 @@ class MainScreen(): None) self.touch_text_manager.set_touch_object("next", button) - #Progress + # Progress progress = Progressbar(self.fonts['base'], time.strftime('%M:%S', time.gmtime( 0)) + "/" + time.strftime('%M:%S', @@ -143,7 +142,8 @@ class MainScreen(): MainScreen.get_track_album_name(self.track)) url = "http://ws.audioscrobbler.com/2.0/?" params = "method=album.getinfo&" + \ - "api_key=59a04c6a73fb99d6e8996e01db306829&artist=" \ + "api_key=59a04c6a73fb99d6e8996e01db306829&" \ + + "artist=" \ + safe_artist + "&album=" + safe_album + "&format=json" response = urllib2.urlopen(url + params) data = json.load(response)