/
const.py
281 lines (254 loc) · 6.26 KB
/
const.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
"""Constants used in various parts of QL, mostly strings."""
import sys
import os
# MSYS2 defines MSYSTEM which changes os.sep/os.path.sep for the mingw
# Python build. Unset here and restart.. (does not work for py.test etc.)
# XXX: do this here since it gets executed by all scripts
if os.name == "nt" and "MSYSTEM" in os.environ:
import subprocess
del os.environ["MSYSTEM"]
argv = []
for arg in [sys.executable] + sys.argv:
if os.path.exists(arg):
arg = arg.replace("/", "\\")
argv.append(arg)
sys.exit(subprocess.call(argv))
class Version(tuple):
"""Represent the version of a dependency as a tuple"""
def __new__(cls, name, *args, **kwargs):
inst = tuple.__new__(Version, args)
inst.name = name
inst.message = kwargs.pop("message", "")
return inst
def __init__(self, *args, **kwargs):
pass
def human_version(self):
return ".".join(map(str, self))
def __str__(self):
return self.human_version()
def check(self, version_tuple):
"""Raises ImportError if the version isn't supported"""
if self[0] == version_tuple[0] and version_tuple >= self:
return
message = " " + self.message if self.message else ""
raise ImportError("%s %s required. %s found.%s" % (
self.name, self, Version("", *version_tuple), message))
class MinVersions(object):
"""Dependency requirements for Quod Libet / Ex Falso"""
PYTHON2 = Version("Python2", 2, 7)
PYTHON3 = Version("Python3", 3, 5)
MUTAGEN = Version("Mutagen", 1, 34,
message="Use the Quod Libet unstable PPAs/repos to get a newer "
"mutagen version.")
GTK = Version("GTK+", 3, 18)
PYGOBJECT = Version("PyGObject", 3, 18)
GSTREAMER = Version("GStreamer", 1, 8)
VERSION_TUPLE = Version("", 4, 2, 0)
VERSION = str(VERSION_TUPLE)
# entry point for the user guide / wiki
_DOCS_BASE_URL = "https://quodlibet.readthedocs.org/en/latest"
ONLINE_HELP = _DOCS_BASE_URL + "/guide/index.html"
SEARCH_HELP = _DOCS_BASE_URL + "/guide/searching.html"
SHORTCUTS_HELP = _DOCS_BASE_URL + "/guide/shortcuts.html"
# Email used as default for reading/saving per-user data in tags, etc.
EMAIL = os.environ.get("EMAIL", "quodlibet@lists.sacredchao.net")
# Displayed as registered / help email address
SUPPORT_EMAIL = "quod-libet-development@googlegroups.com"
# about dialog, --version etc.
WEBSITE = "https://quodlibet.readthedocs.org/"
COPYRIGHT = u"Copyright 2004-2018"
AUTHORS = sorted(u"""\
Alexandre Passos
Alexey Bobyakov
Alex Geoffrey Smith
Anders Carlsson
Andreas Bombe
Andrew Chadwick
Anton Shestakov
Ari Pollak
Arkadiy Illarionov
Aymeric Mansoux
Bastian Kleineidam
Bastien Gorissen
Benjamin Boutier
Ben Zeigler
Bernd Wechner
Bruno Bergot
Carlo Teubner
Christine Spang
Christoph Reiter
Corentin Néau
David Kågedal
David Morris
David Schneider
Decklin Foster
Didier Villevalois
Eduardo Gonzalez
Eoin O'Neill
Eric Casteleijn
Erich Schubert
Eric Le Lay
Federico Pelloni
Felicián Németh
Felix Krull
Florian Demmer
Fredrik Strupe
Guillaume Chazarain
Hans Scholze
Iñigo Serna
Jacob Lee
Jakob Gahde
Jakub Wilk
Jan Arne Petersen
Jan Path
Javier Kohen
Joe Higton
Joe Wreschnig
Johan Hovold
Johannes Marbach
Johannes Rohrer
Joschka Fischer
Josh Lee
Joshua Homan
Joshua Kwan
Lalo Martins
Lee Willis
Ludovic Druette
Lukáš Lalinský
Markus Koller
Martijn Pieters
Martin Bergström
Michaël Ball
Michael Urman
Mickael Royer
Nicholas J. Michalek
Nick Boultbee
Niklas Janlert
Nikolai Prokoschenko
Olli Helin
Peter Simonyi
Peter Strulo
Philipp Müller
Philipp Weis
Phoenix Dailey
Quincy John Hamilton
Remi Vanicat
Robert Muth
Ryan Turner
Sebastian Thürrschmidt
Simonas Kazlauskas
Simon Larsen
Steven Robertson
Thomas Vogt
Tobias Wolf
Tomasz Miasko
Tomasz Torcz
Tshepang Lekhonkhobe
Türerkan İnce
Uriel Zajaczkovski
Vasiliy Faronov
Victoria Hayes
Zack Weinberg
Vimalan Reddy
Jason Heard
David Pérez Carmona
Jakub Wilk
IBBoard@github
CreamyCookie@github
Sauyon Lee
Thomas Leberbauer
Kristian Laakkonen
Emanuele Baldino
Peter F. Patel-Schneider
Pete Beardmore
Muges@github
Meriipu@github
Jonas Platte
Eyenseo@github
Peter Simonyi
dpitch40@github
sphh@github
zsau@github
luk1337@github
luzpaz@github
""".strip().split("\n"))
TRANSLATORS = sorted(u"""
Åka Sikrom (nb)
Alexandre Passos (pt)
Andreas Bertheussen (nb)
Olivier Humbert (fr)
Anton Shestakov (ru)
Bastian Kleineidam (de)
Bastien Gorissen (fr)
Byung-Hee HWANG (ko)
ChangBom Yoon (ko)
Daniel Nyberg (sv)
Dimitris Papageorgiou (el)
Djavan Fagundes (pt)
Einārs Sprūģis (lv)
Eirik Haatveit (nb)
Emfox Zhou (zh_CN)
Erik Christiansson (sv)
Fabien Devaux (fr)
Filippo Pappalardo (it)
Guillaume Ayoub (fr)
Hans van Dok (nl)
Honza Hejzl (cs_CZ)
Hsin-lin Cheng (zh_TW)
Jari Rahkonen (fi)
Javier Kohen (es)
Joe Wreschnig (en_CA)
Johám-Luís Miguéns Vila (es, gl, gl_ES, eu, pt)
Jonas Slivka (lt)
Joshua Kwan (fr)
Luca Baraldi (it)
Ludovic Druette (fr)
Lukáš Lalinský (sk)
Mathieu Morey (fr)
Michal Nowikowski (pl)
Mugurel Tudor (ro)
Mykola Lynnyk (uk)
Naglis Jonaitis (lt)
Nathan Follens (nl)
Nick Boultbee (fr, en_GB)
Olivier Gambier (fr)
Piarres Beobide (eu)
Piotr Drąg (pl)
Roee Haimovich (he)
Rüdiger Arp (de)
SZERVÁC Attila (hu)
Tomasz Torcz (pl)
Türerkan İnce (tr)
Witold Kieraś (pl)
Yasushi Iwata (ja)
Δημήτρης Παπαγεωργίου (el)
Андрей Федосеев (ru)
Микола 'Cthulhu' Линник (uk)
Николай Прокошенко (ru)
Ростислав "zbrox" Райков (bg)
Сергей Федосеев (ru)
scootergrisen (da)
Marek Suchánek (cs)
Till Berger (de)
Jean-Michel Pouré (fr)
Kristian Laakkonen (fi)
Kirill Romanov (ru)
wvxwxvw@github (ru)
""".strip().splitlines())
ARTISTS = sorted(u"""\
Tobias
Jakub Steiner
Fabien Devaux
""".strip().split("\n"))
# Default songlist column headers
DEFAULT_COLUMNS = "~#track ~people ~title~version ~album~discsubtitle " \
"~#length".split()
COLUMN_MODE_SMALL = "Small"
COLUMN_MODE_WIDE = "Wide"
COLUMN_MODE_COLUMNAR = "Columnar"
DEBUG = ("--debug" in sys.argv or "QUODLIBET_DEBUG" in os.environ)