Playlist: add a toolbar
[nephilim.git] / nephilim.py
blob32c868f037fa9ebde3c2426ef96defa18c124aad
1 #!/usr/bin/python
3 # nephilim.py
6 # Copyright (C) 2008 jerous <jerous@gmail.com>
7 # Copyright (C) 2009 Anton Khirnov <wyskas@gmail.com>
9 # Nephilim is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # Nephilim is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with Nephilim. If not, see <http://www.gnu.org/licenses/>.
23 import sys
24 import logging
25 from traceback import print_exc
26 from optparse import OptionParser
27 try:
28 import sip
29 sip.setapi('QString', 2)
30 sip.setapi('QVariant', 2)
31 from PyQt4 import QtGui
32 except ImportError:
33 sys.exit('PyQt4 not found. Ensure that it is installed.')
35 from nephilim.nephilim_app import NephilimApp
37 def main():
38 # parse cmdline options
39 parser = OptionParser()
40 parser.add_option('-v', '--verbose', default = 'warning', choices = ['debug', 'info',
41 'warning', 'error', 'critical'], help = 'Set verbosity level.')
43 options, args = parser.parse_args()
44 logging.basicConfig(level = logging.__getattribute__(options.verbose.upper()))
46 try:
47 app = NephilimApp(sys.argv)
49 app.exec_()
50 app.quit()
51 except:
52 print_exc()
54 if __name__ == "__main__":
55 main()