Code clean

This commit is contained in:
9and3r
2014-08-04 02:10:33 +02:00
parent 7e0997862f
commit b8bec3327d
15 changed files with 64 additions and 70 deletions

2
.gitignore vendored
View File

@@ -7,4 +7,4 @@
MANIFEST MANIFEST
build/ build/
dist/ dist/
mopidy_touchscreen/.idea/ .idea/

View File

@@ -3,10 +3,8 @@ import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class TouchTextManager(): class TouchTextManager():
def __init__(self, size, base_size): def __init__(self, size, base_size):
self.size = size self.size = size
self.base_size = base_size self.base_size = base_size
@@ -37,7 +35,6 @@ class TouchTextManager():
class BaseItem(): class BaseItem():
def __init__(self, pos, pos2): def __init__(self, pos, pos2):
self.pos = pos self.pos = pos
self.pos2 = pos2 self.pos2 = pos2
@@ -48,7 +45,6 @@ class BaseItem():
class TextItem(BaseItem): class TextItem(BaseItem):
def __init__(self, text, pos, pos2, color, text_size): def __init__(self, text, pos, pos2, color, text_size):
if pos2 is not None: if pos2 is not None:
BaseItem.__init__(self, pos, pos2) BaseItem.__init__(self, pos, pos2)
@@ -103,8 +99,8 @@ class TextItem(BaseItem):
def set_text(self, text): def set_text(self, text):
self.__init__(text, self.pos, self.pos2, self.color, self.text_size) self.__init__(text, self.pos, self.pos2, self.color, self.text_size)
class TouchObject(BaseItem):
class TouchObject(BaseItem):
def __init__(self, pos, pos2): def __init__(self, pos, pos2):
BaseItem.__init__(self, pos, pos2) BaseItem.__init__(self, pos, pos2)
self.active = False self.active = False
@@ -116,7 +112,6 @@ class TouchObject(BaseItem):
class TouchAndTextItem(TouchObject, TextItem): class TouchAndTextItem(TouchObject, TextItem):
def __init__(self, text, pos, color, text_size): def __init__(self, text, pos, color, text_size):
TextItem.__init__(self, text, pos, None, color, text_size) TextItem.__init__(self, text, pos, None, color, text_size)
TouchObject.__init__(self, pos, self.pos2) TouchObject.__init__(self, pos, self.pos2)
@@ -128,8 +123,8 @@ class TouchAndTextItem(TouchObject, TextItem):
TouchObject.render(self, surface) TouchObject.render(self, surface)
TextItem.render(self, surface) TextItem.render(self, surface)
class Progressbar(BaseItem):
class Progressbar(BaseItem):
def __init__(self, pos, pos2, max): def __init__(self, pos, pos2, max):
BaseItem.__init__(self, pos, pos2) BaseItem.__init__(self, pos, pos2)
logger.error(pos2) logger.error(pos2)

View File

@@ -6,7 +6,6 @@ from mopidy_touchscreen import Extension, touch_screen as frontend_lib
class ExtensionTest(unittest.TestCase): class ExtensionTest(unittest.TestCase):
def test_get_default_config(self): def test_get_default_config(self):
ext = Extension() ext = Extension()