Child: [17ed59] (diff)

Download this file

common.py    96 lines (79 with data), 3.1 kB

 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
# -*- coding: utf-8 -*-
import os
import i18n
from xdg.BaseDirectory import xdg_data_home
try:
from defs import *
except:
APPVERSION = "0.7.3"
datadir = "/usr/share"
# Application info
APPNAME = "Radio Tray"
APPDIRNAME = APPNAME.lower().replace(" ","")
COPYRIGHT_YEAR = '2009 - 2011'
COPYRIGHTS = "%s - Copyright (c) %s\n" \
"Carlos Ribeiro <carlosmribeiro1@gmail.com>" % (APPNAME, COPYRIGHT_YEAR)
WEBSITE = "http://radiotray.sourceforge.net/"
AUTHORS = [
_('Developers:'),
"Carlos Ribeiro <carlosmribeiro1@gmail.com>",
_('Contributors:'),
'Og Maciel <ogmaciel@gnome.com>',
'Ed Bruck <ed.bruck1@gmail.com>',
'Behrooz Shabani <behrooz@rock.com>',
'Valdur Kana <valdur55@gmail.com>',
]
ARTISTS = []
LICENSE = """Radio Tray
Copyright (C) %s - Carlos Ribeiro <carlosmribeiro1@gmail.com>.
Radio Tray 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 3 of the License, or
(at your option) any later version.
Radio Tray is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Radio Tray. If not, see <http://www.gnu.org/licenses/>.
""" % COPYRIGHT_YEAR
# Media path
if os.path.exists(os.path.abspath('../data/images/')):
IMAGE_PATH = os.path.abspath('../data/images/')
else:
IMAGE_PATH = '%s/%s/images' % (datadir, APPDIRNAME)
# Images
APP_ICON = os.path.join(IMAGE_PATH, 'radiotray.png')
APP_ICON_ON = os.path.join(IMAGE_PATH, 'radiotray_on.png')
APP_ICON_OFF = os.path.join(IMAGE_PATH, 'radiotray_off.png')
APP_ICON_CONNECT = os.path.join(IMAGE_PATH, 'radiotray_connecting.gif')
APP_INDICATOR_ICON_ON = "radiotray_on"
APP_INDICATOR_ICON_OFF = "radiotray_off"
APP_INDICATOR_ICON_CONNECT = "radiotray_connecting"
# Config info
CFG_NAME = 'bookmarks.xml'
OPTIONS_CFG_NAME = 'config.xml'
USER_CFG_PATH = os.path.join(xdg_data_home, APPDIRNAME)
OLD_USER_CFG_PATH = os.environ['HOME'] + "/.radiotray/"
REL_CFG_DIR = os.path.abspath('../data/')
if os.path.exists(os.path.join(REL_CFG_DIR, CFG_NAME)):
DEFAULT_CFG_PATH = REL_CFG_DIR
else:
DEFAULT_CFG_PATH = '%s/%s/' % (datadir, APPDIRNAME)
DEFAULT_RADIO_LIST = os.path.join(DEFAULT_CFG_PATH, CFG_NAME)
DEFAULT_CONFIG_FILE = os.path.join(DEFAULT_CFG_PATH, OPTIONS_CFG_NAME)
# Plugins
SYSTEM_PLUGIN_PATH = os.path.join(DEFAULT_CFG_PATH, 'plugins')
USER_PLUGIN_PATH = os.path.join(USER_CFG_PATH, 'plugins')
#Logfile
LOGFILE = os.path.join(USER_CFG_PATH,'radiotray.log')
#temporary icon file
ICON_FILE = os.path.join(USER_CFG_PATH,'icon')
# user-agent
try:
import platform
USER_AGENT = "%s/%s (%s %s; %s/%s (%s))" % ("RadioTray", APPVERSION, platform.system(), platform.machine(),
platform.linux_distribution()[0], platform.linux_distribution()[1],
platform.linux_distribution()[2])
except:
USER_AGENT = "RadioTray/" + APPVERSION