File: exfalso.py

package info (click to toggle)
quodlibet 2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,004 kB
  • sloc: python: 26,934; ansic: 596; makefile: 2
file content (56 lines) | stat: -rwxr-xr-x 1,462 bytes parent folder | download
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
#!/usr/bin/env python
# Copyright 2004-2005 Joe Wreschnig, Niklas Janlert
# <quod-libet-development@googlegroups.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.

import os
import sys

def main():
    import quodlibet
    from quodlibet import util
    from quodlibet import const
    import gobject

    quodlibet._init_signal()

    opts = util.OptionParser(
        "Ex Falso", const.VERSION,
        _("an audio tag editor"), "[%s]" % _("directory"))

    sys.argv.append(os.path.abspath("."))
    opts, args = opts.parse()
    args[0] = os.path.realpath(args[0])

    from quodlibet import config
    config.init(const.CONFIG)

    library = quodlibet.init(icon="exfalso",
                             name="Ex Falso",
                             title=const.PROCESS_TITLE_EF)

    player = quodlibet.init_backend("nullbe", library.librarian)

    from quodlibet.qltk.exfalsowindow import ExFalsoWindow
    window = ExFalsoWindow(library, args[0])

    quodlibet.enable_periodic_save(save_library=False)

    from quodlibet.qltk import session
    session.init("exfalso", window)

    from quodlibet import widgets
    widgets.main = window
    widgets.watcher = library.librarian

    quodlibet.main(window)

    config.save(const.CONFIG)

    print_d("Finished shutdown.")

if __name__ == "__main__":
    main()