From de0c8aef7c22f973319a34806482b70e459ab339 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Mon, 7 Aug 2006 13:59:01 +0000 Subject: [PATCH] Give to get value a default argument, if the value is not found the default value is returned. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14556 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/parser_tools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py index c0c891f534..486cfac9e1 100644 --- a/lib/lyx2lyx/parser_tools.py +++ b/lib/lyx2lyx/parser_tools.py @@ -141,8 +141,8 @@ def find_tokens_backwards(lines, tokens, start): return -1 -def get_value(lines, token, start, end = 0): - """ get_value(lines, token, start[, end]) -> list of strings +def get_value(lines, token, start, end = 0, default = ""): + """ get_value(lines, token, start[[, end], default]) -> list of strings Return tokens after token for the first line, in lines, where token is the first element.""" @@ -153,7 +153,7 @@ def get_value(lines, token, start, end = 0): if len(lines[i].split()) > 1: return lines[i].split()[1] else: - return "" + return default def del_token(lines, token, start, end): -- 2.39.2