File: glal_selected.py

package info (click to toggle)
cyclograph 1.7.1-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,136 kB
  • ctags: 705
  • sloc: python: 9,682; makefile: 5
file content (39 lines) | stat: -rw-r--r-- 1,181 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""glal_selected.py """

# Copyright (C) 2011 Federico Brega

# This program 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.
#
# This program 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.

import os.path
import sys

INTERFACES = {'qt': 'qt',
              'gtk3': 'gtk3',
              'cli': 'glal.py'}
if_path = os.path.join(os.path.dirname(os.path.abspath(__file__)))
              
def use(lib):
    """Set lib to use"""
    global library

    if not (lib in INTERFACES and os.path.exists(os.path.join(if_path, INTERFACES[lib]))):
        sys.stderr.write(lib + ' interface not installed\n')
        return None
    library = lib
    return library

def getname():
    """Return name of the used interface"""
    return library

# vim:sw=4:softtabstop=4:expandtab