Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'refactor-consts' into integration

  • Loading branch information...
commit f7c13179a34736f9cee389bb74ba2eed410e50e6 2 parents f112560 + 35df1be
@multani multani authored
View
5 README.rst
@@ -81,6 +81,11 @@ Currently, the following things have been changed since the Berlios's version:
* Improved the packaging of the application: use `pkg_resources` to access
data files, and stop doing so much work when running `python setup.py ...`.
+* Transform the ``consts`` module into a more simple constant module, thanks to
+ Jörg Thalheim (Mic92).
+
+ This is the `refactor-consts` branch.
+
Personal todo list
------------------
View
2  sonata/artwork.py
@@ -9,9 +9,9 @@
import ui
import misc
import mpdhelper as mpdh
+import consts
from library import library_set_data
from library import library_get_data
-from consts import consts
from pluginsystem import pluginsystem
View
2  sonata/config.py
@@ -15,7 +15,7 @@
import hashlib
import ConfigParser
-from consts import consts
+import consts
import misc
View
84 sonata/consts.py
@@ -15,46 +15,44 @@
if view == consts.VIEW_ALBUM: ...
"""
-
-class Constants:
- """This class contains the constant definitions as attributes."""
-
- def __init__(self):
- self.ART_LOCAL = 0
- self.ART_LOCAL_REMOTE = 1
- self.VIEW_FILESYSTEM = 0
- self.VIEW_ARTIST = 1
- self.VIEW_GENRE = 2
- self.VIEW_ALBUM = 3
- self.LYRIC_TIMEOUT = 10
- self.NOTIFICATION_WIDTH_MAX = 500
- self.NOTIFICATION_WIDTH_MIN = 350
- self.FULLSCREEN_COVER_SIZE = 500
- self.ART_LOCATION_HOMECOVERS = 0 # ~/.covers/[artist]-[album].jpg
- self.ART_LOCATION_COVER = 1 # file_dir/cover.jpg
- self.ART_LOCATION_ALBUM = 2 # file_dir/album.jpg
- self.ART_LOCATION_FOLDER = 3 # file_dir/folder.jpg
- self.ART_LOCATION_CUSTOM = 4 # file_dir/[custom]
- self.ART_LOCATION_SINGLE = 6
- self.ART_LOCATION_MISC = 7
- self.ART_LOCATIONS_MISC = ['front.jpg', '.folder.jpg',
- '.folder.png', 'AlbumArt.jpg',
- 'AlbumArtSmall.jpg']
- self.LYRICS_LOCATION_HOME = 0 # ~/.lyrics/[artist]-[song].txt
- self.LYRICS_LOCATION_PATH = 1 # file_dir/[artist]-[song].txt
- self.LYRICS_LOCATION_HOME_ALT = 2 # ~/.lyrics/[artist] - [song].txt
- self.LYRICS_LOCATION_PATH_ALT = 3 # file_dir/[artist] - [song].txt
- self.LIB_COVER_SIZE = 32
- self.COVERS_TYPE_STANDARD = 0
- self.COVERS_TYPE_STYLIZED = 1
- self.LIB_LEVEL_GENRE = 0
- self.LIB_LEVEL_ARTIST = 1
- self.LIB_LEVEL_ALBUM = 2
- self.LIB_LEVEL_SONG = 3
- self.NUM_ARTISTS_FOR_VA = 2
-
- # the names of the plug-ins that will be enabled by default
- self.DEFAULT_PLUGINS = ('playlists streams lyricwiki '
- 'rhapsodycovers localmpd').split()
-
-consts = Constants()
+ART_LOCAL = 0
+ART_LOCAL_REMOTE = 1
+VIEW_FILESYSTEM = 0
+VIEW_ARTIST = 1
+VIEW_GENRE = 2
+VIEW_ALBUM = 3
+LYRIC_TIMEOUT = 10
+NOTIFICATION_WIDTH_MAX = 500
+NOTIFICATION_WIDTH_MIN = 350
+FULLSCREEN_COVER_SIZE = 500
+ART_LOCATION_HOMECOVERS = 0 # ~/.covers/[artist]-[album].jpg
+ART_LOCATION_COVER = 1 # file_dir/cover.jpg
+ART_LOCATION_ALBUM = 2 # file_dir/album.jpg
+ART_LOCATION_FOLDER = 3 # file_dir/folder.jpg
+ART_LOCATION_CUSTOM = 4 # file_dir/[custom]
+ART_LOCATION_SINGLE = 6
+ART_LOCATION_MISC = 7
+ART_LOCATIONS_MISC = ['front.jpg', '.folder.jpg',
+ '.folder.png', 'AlbumArt.jpg',
+ 'AlbumArtSmall.jpg']
+LYRICS_LOCATION_HOME = 0 # ~/.lyrics/[artist]-[song].txt
+LYRICS_LOCATION_PATH = 1 # file_dir/[artist]-[song].txt
+LYRICS_LOCATION_HOME_ALT = 2 # ~/.lyrics/[artist] - [song].txt
+LYRICS_LOCATION_PATH_ALT = 3 # file_dir/[artist] - [song].txt
+LIB_COVER_SIZE = 32
+COVERS_TYPE_STANDARD = 0
+COVERS_TYPE_STYLIZED = 1
+LIB_LEVEL_GENRE = 0
+LIB_LEVEL_ARTIST = 1
+LIB_LEVEL_ALBUM = 2
+LIB_LEVEL_SONG = 3
+NUM_ARTISTS_FOR_VA = 2
+
+# the names of the plug-ins that will be enabled by default
+DEFAULT_PLUGINS = [
+ 'playlists',
+ 'streams',
+ 'lyricwiki',
+ 'rhapsodycovers',
+ 'localmpd',
+]
View
2  sonata/info.py
@@ -12,7 +12,7 @@
import ui
import misc
import mpdhelper as mpdh
-from consts import consts
+import consts
from pluginsystem import pluginsystem
View
2  sonata/library.py
@@ -13,7 +13,7 @@
import misc
import formatting
import mpdhelper as mpdh
-from consts import consts
+import consts
import breadcrumbs
View
2  sonata/lyricwiki.py
@@ -10,7 +10,7 @@
import misc
import mpdhelper as mpdh
-from consts import consts
+import consts
from pluginsystem import pluginsystem, BuiltinPlugin
View
2  sonata/main.py
@@ -61,7 +61,7 @@
import tray
import formatting
-from consts import consts
+import consts
from pluginsystem import pluginsystem
from config import Config
View
2  sonata/preferences.py
@@ -14,9 +14,9 @@
import gtk
-from consts import consts
from config import Config
from pluginsystem import pluginsystem
+import consts
import ui
import misc
import formatting

0 comments on commit f7c1317

Please sign in to comment.
Something went wrong with that request. Please try again.