summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntti Ajanki <antti.ajanki@iki.fi>2011-03-26 12:25:54 +0200
committerAntti Ajanki <antti.ajanki@iki.fi>2011-03-26 12:25:54 +0200
commit3dc970ba835f29895fa52af809c33d9eb8969dde (patch)
tree40c9b688adf0c02f02b6668813b542e47e8d0471
parenta4b66836deb419577a9b8aa8b10b15879bca1962 (diff)
downloadvdr-plugin-webvideo-3dc970ba835f29895fa52af809c33d9eb8969dde.tar.gz
vdr-plugin-webvideo-3dc970ba835f29895fa52af809c33d9eb8969dde.tar.bz2
DEBUG option in webvi_set_config() and --verbose option in webvi
-rw-r--r--src/libwebvi/libwebvi.h8
-rw-r--r--src/libwebvi/webvi/api.py6
-rw-r--r--src/libwebvi/webvi/constants.py1
-rw-r--r--src/webvicli/webvicli/client.py6
4 files changed, 18 insertions, 3 deletions
diff --git a/src/libwebvi/libwebvi.h b/src/libwebvi/libwebvi.h
index dd7ff39..b27628b 100644
--- a/src/libwebvi/libwebvi.h
+++ b/src/libwebvi/libwebvi.h
@@ -73,7 +73,8 @@ typedef enum {
} WebviSelectBitmask;
typedef enum {
- WEBVI_CONFIG_TEMPLATE_PATH
+ WEBVI_CONFIG_TEMPLATE_PATH,
+ WEBVI_CONFIG_DEBUG
} WebviConfig;
typedef long WebviCtx;
@@ -131,8 +132,9 @@ const char* webvi_strerror(WebviCtx ctx, WebviResult err);
/*
* Set a new value for a global configuration option conf.
*
- * Currently the only legal value for conf is TEMPLATE_PATH, which
- * sets the base directory for the XSLT templates.
+ * Possible values and their meanings:
+ * TEMPLATE_PATH Set the base directory for the XSLT templates
+ * DEBUG If value is not "0", print debug output to stdin
*
* The string pointed by value is copied to the library.
*/
diff --git a/src/libwebvi/webvi/api.py b/src/libwebvi/webvi/api.py
index 2fb24ab..ed4c4a5 100644
--- a/src/libwebvi/webvi/api.py
+++ b/src/libwebvi/webvi/api.py
@@ -99,6 +99,12 @@ def set_config(conf, value):
if conf == WebviConfig.TEMPLATE_PATH:
request.set_template_path(value)
return WebviErr.OK
+ elif conf == WebviConfig.DEBUG:
+ if value == '0':
+ request.DEBUG = False
+ else:
+ request.DEBUG = True
+ return WebviErr.OK
else:
return WebviErr.INVALID_PARAMETER
diff --git a/src/libwebvi/webvi/constants.py b/src/libwebvi/webvi/constants.py
index 2797178..860c876 100644
--- a/src/libwebvi/webvi/constants.py
+++ b/src/libwebvi/webvi/constants.py
@@ -48,3 +48,4 @@ class WebviSelectBitmask:
class WebviConfig:
TEMPLATE_PATH = 0
+ DEBUG = 1
diff --git a/src/webvicli/webvicli/client.py b/src/webvicli/webvicli/client.py
index 9c092d4..6f40a2e 100644
--- a/src/webvicli/webvicli/client.py
+++ b/src/webvicli/webvicli/client.py
@@ -719,10 +719,14 @@ def parse_command_line(cmdlineargs, options):
dest='templatepath',
help='read video site templates from DIR', metavar='DIR',
default=None)
+ parser.add_option('-v', '--verbose', action='store_const', const=1,
+ dest='verbose', help='debug output', default=0)
cmdlineopt = parser.parse_args(cmdlineargs)[0]
if cmdlineopt.templatepath is not None:
options['templatepath'] = cmdlineopt.templatepath
+ if cmdlineopt.verbose > 0:
+ options['verbose'] = cmdlineopt.verbose
return options
@@ -753,6 +757,8 @@ def main(argv):
options = load_config({})
options = parse_command_line(argv, options)
+ if options.has_key('verbose'):
+ webvi.api.set_config(WebviConfig.DEBUG, options['verbose'])
if options.has_key('templatepath'):
webvi.api.set_config(WebviConfig.TEMPLATE_PATH, options['templatepath'])