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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
""" Path configuration and functions for the wicd daemon and gui clients.
chdir() -- Change directory to the location of the current file.
"""
import os
# The path containing the wpath.py file.
current = os.path.dirname(os.path.realpath(__file__)) + '/'
# These paths can easily be modified to handle system wide installs, or
# they can be left as is if all files remain with the source directory
# layout.
# These paths are replaced when setup.py configure is run
# All directory paths *MUST* end in a /
version = '%VERSION%'
revision = '%REVNO%'
curses_revision = '%CURSES_REVNO%'
# DIRECTORIES
lib = '%LIB%'
share = '%SHARE%'
etc = '%ETC%'
scripts = '%SCRIPTS%'
predisconnectscripts = '%SCRIPTS%predisconnect'
postdisconnectscripts = '%SCRIPTS%postdisconnect'
preconnectscripts = '%SCRIPTS%preconnect'
postconnectscripts = '%SCRIPTS%postconnect'
images = '%IMAGES%'
encryption = '%ENCRYPTION%'
bin = '%BIN%'
varlib = '%VARLIB%'
networks = '%NETWORKS%'
log = '%LOG%'
resume = '%RESUME%'
suspend = '%SUSPEND%'
sbin = '%SBIN%'
pmutils = '%PMUTILS%'
dbus = '%DBUS%'
dbus_service = '%DBUS_SERVICE%'
systemd = '%SYSTEMD%'
logrotate = '%LOGROTATE%'
desktop = '%DESKTOP%'
backends = '%BACKENDS%'
daemon = '%DAEMON%'
curses = '%CURSES%'
gtk = '%GTK%'
cli = '%CLI%'
gnome_shell_extensions = '%GNOME_SHELL_EXTENSIONS%'
translations = '%TRANSLATIONS%'
icons = '%ICONS%'
pixmaps = '%PIXMAPS%'
autostart = '%AUTOSTART%'
init = '%INIT%'
docdir = '%DOCDIR%'
mandir = '%MANDIR%'
kdedir = '%KDEDIR%'
# FILES
# python begins the file section
python = '%PYTHON%'
pidfile = '%PIDFILE%'
# stores something like other/wicd
# really only used in the install
initfile = '%INITFILE%'
# stores only the file name, i.e. wicd
initfilename = '%INITFILENAME%'
wicd_group = '%WICDGROUP%'
log_group = '%LOGGROUP%'
log_perms = '%LOGPERMS%'
# BOOLEANS
no_install_pmutils = %NO_INSTALL_PMUTILS%
no_install_init = %NO_INSTALL_INIT%
no_install_man = %NO_INSTALL_MAN%
no_install_i18n = %NO_INSTALL_I18N%
no_install_i18n_man = %NO_INSTALL_I18N_MAN%
no_install_kde = %NO_INSTALL_KDE%
no_install_acpi = %NO_INSTALL_ACPI%
no_install_docs = %NO_INSTALL_DOCS%
no_install_gtk = %NO_INSTALL_GTK%
no_install_ncurses = %NO_INSTALL_NCURSES%
no_install_cli = %NO_INSTALL_CLI%
no_install_gnome_shell_extensions = %NO_INSTALL_GNOME_SHELL_EXTENSIONS%
no_use_notifications = %NO_USE_NOTIFICATIONS%
def chdir(f):
"""Change directory to the location of the specified file.
Keyword arguments:
f -- the file to switch to (usually __file__)
"""
os.chdir(os.path.dirname(os.path.realpath(f)))
|