From 7091123e002a911873a9e161173c48694b0a0499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 11 May 2010 19:10:55 +0200 Subject: Add '--plugin-dir' option --- portato/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/portato/__init__.py b/portato/__init__.py index 61d6a42..12b8fe4 100644 --- a/portato/__init__.py +++ b/portato/__init__.py @@ -17,7 +17,7 @@ import sys, os from optparse import OptionParser, SUPPRESS_HELP from .log import start as logstart -from .constants import LOCALE_DIR, APP, VERSION, REVISION +from .constants import LOCALE_DIR, APP, VERSION, REVISION, PLUGIN_DIR from .helper import debug, info, error # set better version info @@ -53,6 +53,9 @@ def get_parser (use_ = False): parser.add_option("-F", "--no-fork", action = "store_true", dest = "nofork", default = False, help = _("do not fork off as root")) + parser.add_option("--plugin-dir", action = "store_true", dest = "pdir", default = False, + help = _("print the directory the plugins are located in")) + return parser def _sub_start (): @@ -71,6 +74,11 @@ def start(): # run parser (options, args) = get_parser().parse_args() + # plugin dir + if options.pdir: + print PLUGIN_DIR + return + if options.nofork or os.getuid() == 0: # start GUI # close listener at exit -- cgit v1.2.3