- self.option_dict[option] = None
-
-
- # Store if we have an explicit line-width given
- has_line_width = self.option_dict.has_key (LINE_WIDTH)
- if has_line_width and self.option_dict[LINE_WIDTH] == None:
- has_line_width = False
- del self.option_dict[LINE_WIDTH]
-
- # Use default options (i.e. auto-detected line-width, etc)
- for k in self.formatter.default_snippet_options:
- if k not in self.option_dict:
- self.option_dict[k] = self.formatter.default_snippet_options[k]
-
- # RELATIVE does not work without FRAGMENT;
- # make RELATIVE imply FRAGMENT
- has_relative = self.option_dict.has_key (RELATIVE)
- if has_relative and not self.option_dict.has_key (FRAGMENT):
- self.option_dict[FRAGMENT] = None
+ warning (
+ _ ("deprecated ly-option used: %s") % key)
+ warning (
+ _ ("compatibility mode translation: %s") % c_key)
+ (key, value) = (c_key, c_value)
+ # Finally, insert the option:
+ if key:
+ self.snippet_option_dict[key] = value
+
+ # If LINE_WIDTH is used without parameter, set it to default.
+ has_line_width = self.snippet_option_dict.has_key (LINE_WIDTH)
+ if has_line_width and self.snippet_option_dict[LINE_WIDTH] == None:
+ del self.snippet_option_dict[LINE_WIDTH]
+
+ # RELATIVE does not work without FRAGMENT, so imply that
+ if self.snippet_option_dict.has_key (RELATIVE):
+ self.snippet_option_dict[FRAGMENT] = None
+
+ # Now get the default options from the formatter object (HTML, latex,
+ # texinfo, etc.) and insert the explicit snippet options to get the
+ # list of all options for this snippet
+ # first, make sure we have an INDENT value as a fallback
+ self.option_dict = {INDENT: '0\\mm'};
+ self.option_dict.update (self.formatter.default_snippet_options);
+ self.option_dict.update (self.snippet_option_dict);
+
+ # also construct a list of all options (as strings) that influence the
+ # visual appearance of the snippet
+ lst = filter (lambda (x,y): x not in PROCESSING_INDEPENDENT_OPTIONS,
+ self.option_dict.iteritems ());
+ option_list = []
+ for (key, value) in lst:
+ if value == None:
+ option_list.append (key)
+ else:
+ option_list.append (key + "=" + value)
+ option_list.sort ()
+ self.outputrelevant_option_list = option_list
+ #print ("self.outputrelevant_option_list: %s\n" % self.outputrelevant_option_list);