From 19fb4edd3c8b75254eeff480b2c6c650745c34a4 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 28 Aug 2009 15:20:08 +0200 Subject: add installer script --- TODO | 1 - data.qrc | 5 ++++ default_layout | Bin 0 -> 487 bytes icons.qrc | 28 ++++++++++++++++++++ nephilim.py | 44 -------------------------------- nephilim.qrc | 28 -------------------- nephilim/data.py | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ nephilim/default_layout | Bin 487 -> 0 bytes nephilim/winMain.py | 7 ++--- scripts/nephilim | 44 ++++++++++++++++++++++++++++++++ setup.py | 19 ++++++++++++++ 11 files changed, 164 insertions(+), 78 deletions(-) create mode 100644 data.qrc create mode 100644 default_layout create mode 100644 icons.qrc delete mode 100755 nephilim.py delete mode 100644 nephilim.qrc create mode 100644 nephilim/data.py delete mode 100644 nephilim/default_layout create mode 100755 scripts/nephilim create mode 100644 setup.py diff --git a/TODO b/TODO index 8271283..0679ce5 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,5 @@ release: - highlight current song in playlist -- installer script other TODO: - don't quit by closing mainwindow? diff --git a/data.qrc b/data.qrc new file mode 100644 index 0000000..24aa18a --- /dev/null +++ b/data.qrc @@ -0,0 +1,5 @@ + + + default_layout + + diff --git a/default_layout b/default_layout new file mode 100644 index 0000000..fc542d8 Binary files /dev/null and b/default_layout differ diff --git a/icons.qrc b/icons.qrc new file mode 100644 index 0000000..f0b1d65 --- /dev/null +++ b/icons.qrc @@ -0,0 +1,28 @@ + + + +icons/connect.png +icons/consume.png +icons/delete.png +icons/disconnect.png +icons/edit.png +icons/gtk-preferences.svg +icons/gtk-quit.svg +icons/media-playback-pause.svg +icons/media-playback-start.svg +icons/media-playback-stop.svg +icons/media-playlist-repeat.svg +icons/media-playlist-shuffle.svgz +icons/media-skip-backward.svg +icons/media-skip-forward.svg +icons/nephilim.png +icons/nephilim_small.png +icons/no-cd-cover.png +icons/no-cd-cover.svg +icons/outputs.png +icons/refresh.png +icons/repeat.png +icons/save.png +icons/single.png + + diff --git a/nephilim.py b/nephilim.py deleted file mode 100755 index 28b4751..0000000 --- a/nephilim.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python - -# nephilim.py - -# -# Copyright (C) 2008 jerous -# Copyright (C) 2009 Anton Khirnov -# -# Nephilim 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. -# -# Nephilim 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 Nephilim. If not, see . -# - -import sys -import logging -from traceback import print_exc -try: - from PyQt4 import QtGui -except ImportError: - sys.exit('PyQt4 not found. Ensure that it is installed.') - -from nephilim.nephilim_app import NephilimApp - -def main(): - logging.basicConfig(level = logging.WARNING) - try: - app = NephilimApp(sys.argv) - - app.exec_() - app.quit() - except Exception, e: - print_exc() - -if __name__ == "__main__": - main() diff --git a/nephilim.qrc b/nephilim.qrc deleted file mode 100644 index f0b1d65..0000000 --- a/nephilim.qrc +++ /dev/null @@ -1,28 +0,0 @@ - - - -icons/connect.png -icons/consume.png -icons/delete.png -icons/disconnect.png -icons/edit.png -icons/gtk-preferences.svg -icons/gtk-quit.svg -icons/media-playback-pause.svg -icons/media-playback-start.svg -icons/media-playback-stop.svg -icons/media-playlist-repeat.svg -icons/media-playlist-shuffle.svgz -icons/media-skip-backward.svg -icons/media-skip-forward.svg -icons/nephilim.png -icons/nephilim_small.png -icons/no-cd-cover.png -icons/no-cd-cover.svg -icons/outputs.png -icons/refresh.png -icons/repeat.png -icons/save.png -icons/single.png - - diff --git a/nephilim/data.py b/nephilim/data.py new file mode 100644 index 0000000..746877b --- /dev/null +++ b/nephilim/data.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- + +# Resource object code +# +# Created: Fri Aug 28 15:12:34 2009 +# by: The Resource Compiler for PyQt (Qt v4.5.2) +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore + +qt_resource_data = "\ +\x00\x00\x01\xe7\ +\x00\ +\x00\x00\xff\x00\x00\x00\x00\xfd\x00\x00\x00\x01\x00\x00\x00\x02\ +\x00\x00\x05\xc0\x00\x00\x04\x75\xfc\x01\x00\x00\x00\x01\xfc\x00\ +\x00\x00\x00\x00\x00\x05\xc0\x00\x00\x02\x6d\x00\xff\xff\xff\xfc\ +\x01\x00\x00\x00\x02\xfc\x00\x00\x00\x00\x00\x00\x01\x44\x00\x00\ +\x00\x82\x00\xff\xff\xff\xfa\x00\x00\x00\x01\x02\x00\x00\x00\x02\ +\xfb\x00\x00\x00\x16\x00\x46\x00\x69\x00\x6c\x00\x65\x00\x62\x00\ +\x72\x00\x6f\x00\x77\x00\x73\x00\x65\x00\x72\x01\x00\x00\x00\x00\ +\xff\xff\xff\xff\x00\x00\x00\x72\x00\xff\xff\xfe\xfb\x00\x00\x00\ +\x0e\x00\x4c\x00\x69\x00\x62\x00\x72\x00\x61\x00\x72\x00\x79\x01\ +\x00\x00\x00\x27\x00\x00\x04\x75\x00\x00\x00\x8b\x00\xff\xff\xfe\ +\xfc\x00\x00\x01\x4a\x00\x00\x04\x76\x00\x00\x01\xe5\x00\xff\xff\ +\xff\xfc\x02\x00\x00\x00\x02\xfb\x00\x00\x00\x10\x00\x50\x00\x6c\ +\x00\x61\x00\x79\x00\x6c\x00\x69\x00\x73\x00\x74\x01\x00\x00\x00\ +\x27\x00\x00\x03\x10\x00\x00\x00\x5d\x00\xff\xff\xfe\xfc\x00\x00\ +\x03\x3d\x00\x00\x01\x5f\x00\x00\x01\x5f\x00\xff\xff\xfe\xfc\x01\ +\x00\x00\x00\x02\xfc\x00\x00\x01\x4a\x00\x00\x02\xd9\x00\x00\x00\ +\x7f\x00\xff\xff\xff\xfa\x00\x00\x00\x01\x01\x00\x00\x00\x02\xfb\ +\x00\x00\x00\x0c\x00\x4c\x00\x79\x00\x72\x00\x69\x00\x63\x00\x73\ +\x01\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x5e\x00\xff\xff\ +\xff\xfb\x00\x00\x00\x10\x00\x53\x00\x6f\x00\x6e\x00\x67\x00\x69\ +\x00\x6e\x00\x66\x00\x6f\x01\x00\x00\x00\xef\x00\x00\x03\x34\x00\ +\x00\x00\x67\x00\xff\xff\xff\xfb\x00\x00\x00\x14\x00\x41\x00\x6c\ +\x00\x62\x00\x75\x00\x6d\x00\x43\x00\x6f\x00\x76\x00\x65\x00\x72\ +\x01\x00\x00\x04\x29\x00\x00\x01\x97\x00\x00\x01\x60\x00\xff\xff\ +\xff\x00\x00\x05\xc0\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\ +\x04\x00\x00\x00\x08\x00\x00\x00\x08\xfc\x00\x00\x00\x01\x00\x00\ +\x00\x02\x00\x00\x00\x02\xff\xff\xff\xff\x01\x00\x00\x00\x00\x00\ +\x00\x01\x41\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16\x00\ +\x50\x00\x6c\x00\x61\x00\x79\x00\x43\x00\x6f\x00\x6e\x00\x74\x00\ +\x72\x00\x6f\x00\x6c\x01\x00\x00\x01\x41\x00\x00\x00\xe1\x00\x00\ +\x00\x00\x00\x00\x00\x00\ +" + +qt_resource_name = "\ +\x00\x0e\ +\x05\xb9\x9b\x24\ +\x00\x64\ +\x00\x65\x00\x66\x00\x61\x00\x75\x00\x6c\x00\x74\x00\x5f\x00\x6c\x00\x61\x00\x79\x00\x6f\x00\x75\x00\x74\ +" + +qt_resource_struct = "\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +" + +def qInitResources(): + QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + +def qCleanupResources(): + QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + +qInitResources() diff --git a/nephilim/default_layout b/nephilim/default_layout deleted file mode 100644 index fc542d8..0000000 Binary files a/nephilim/default_layout and /dev/null differ diff --git a/nephilim/winMain.py b/nephilim/winMain.py index c935b54..c765038 100644 --- a/nephilim/winMain.py +++ b/nephilim/winMain.py @@ -22,6 +22,7 @@ import logging from common import APPNAME, sec2min, appIcon import icons +import data DEFAULT_LAYOUT_FILE = 'nephilim/default_layout' @@ -157,11 +158,7 @@ class winMain(QtGui.QMainWindow): def restore_layout(self): layout = self.settings.value('layout').toByteArray() if not layout: - try: - layout = open(DEFAULT_LAYOUT_FILE, 'rb').read() - except IOError: - logging.error("Error reading default layout.") - return + layout = QtCore.QFile(':default_layout').readAll() self.restoreState(layout) diff --git a/scripts/nephilim b/scripts/nephilim new file mode 100755 index 0000000..28b4751 --- /dev/null +++ b/scripts/nephilim @@ -0,0 +1,44 @@ +#!/usr/bin/python + +# nephilim.py + +# +# Copyright (C) 2008 jerous +# Copyright (C) 2009 Anton Khirnov +# +# Nephilim 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. +# +# Nephilim 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 Nephilim. If not, see . +# + +import sys +import logging +from traceback import print_exc +try: + from PyQt4 import QtGui +except ImportError: + sys.exit('PyQt4 not found. Ensure that it is installed.') + +from nephilim.nephilim_app import NephilimApp + +def main(): + logging.basicConfig(level = logging.WARNING) + try: + app = NephilimApp(sys.argv) + + app.exec_() + app.quit() + except Exception, e: + print_exc() + +if __name__ == "__main__": + main() diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..c2d539d --- /dev/null +++ b/setup.py @@ -0,0 +1,19 @@ +# Nephilim installer script + +from distutils.core import setup + +setup(name = 'nephilim', + version = '0.1', + description = 'Nephilim MPD client.', + author = 'Anton Khirnov', + author_email = 'wyskas@gmail.com', + classifiers = [ + 'Development Status :: 3 - Alpha', + 'Environment :: X11 Applications :: Qt', + 'Intended Audience :: End Users/desktop', + 'License :: OSI Approved :: GNU General Public License (GPL)', + 'Programming Language :: Python :: 2', + 'Topic :: Multimedia :: Sound/Audio :: Players'], + packages = ['nephilim', 'nephilim.plugins'], + scripts = ['scripts/nephilim'] +) -- cgit v1.2.3