Debian Codegraph @

python/examples/cacainfo.py

raw
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 #
4 # libcaca Colour ASCII-Art library
5 # Python language bindings
6 # Copyright (c) 2010 Alex Foulon <[email protected]>
7 # All Rights Reserved
8 #
9 # This library is free software. It comes without any warranty, to
10 # the extent permitted by applicable law. You can redistribute it
11 # and/or modify it under the terms of the Do What the Fuck You Want
12 # to Public License, Version 2, as published by Sam Hocevar. See
13 # http://www.wtfpl.net/ for more details.
14 #
15
16 """ Libcaca Python bindings """
17
18 import caca
19
20 if __name__ == '__main__':
21 print("libcaca version %s" % caca.get_version())
22 print("")
23 print("Available drivers:")
24 for drv, desc in caca.get_display_driver_list():
25 print(" - %s: %s" % (drv, desc))
26 print("")
27 print("Available fonts:")
28 for font in caca.get_font_list():
29 print(" - %s" % font)
30 print("")
31 print("Export formats:")
32 for fmt, desc in caca.get_export_list():
33 print(" - %s: %s" % (fmt, desc))
34 print("")
35 print("Import formats:")
36 for fmt, desc in caca.get_import_list():
37 print(" - %s: %s" % (fmt, desc))