- curr_font = []
- curr_font_name = []
- in_font = 0
- for l in open (filename).readlines ():
- if not in_font and begin_font_regex.match (l):
- in_font = 1
- curr_font_name = begin_font_regex.match (l).group (1)
- curr_font = []
- elif in_font and end_font_regex.match (l):
- in_font = 0
-
- if curr_font_name in extract_from_this:
- font_dict[curr_font_name] = ''.join (curr_font)
- if verbose:
- sys.stderr.write (_('Extracted %s')
- % curr_font_name + '\n')
-
- extract_from_this.remove (curr_font_name)
- elif in_font:
- curr_font.append (l)
- if not extract_from_this:
- break
-
- if extract_from_this:
- sys.stderr.write ("Failed to extract %s from %s\n"
- % (', '.join (extract_from_this), filename))
+ curr_font = []
+ curr_font_name = []
+ in_font = 0
+ for l in open (filename).readlines ():
+ if not in_font and begin_font_regex.match (l):
+ in_font = 1
+ curr_font_name = begin_font_regex.match (l).group (1)
+ curr_font = []
+ elif in_font and end_font_regex.match (l):
+ in_font = 0
+
+ if curr_font_name in extract_from_this:
+ font_dict[curr_font_name] = ''.join (curr_font)
+ if verbose:
+ sys.stderr.write (_('Extracted %s')
+ % curr_font_name + '\n')
+
+ extract_from_this.remove (curr_font_name)
+ elif in_font:
+ curr_font.append (l)
+ if not extract_from_this:
+ break
+
+ if extract_from_this:
+ sys.stderr.write ("Failed to extract %s from %s\n"
+ % (', '.join (extract_from_this), filename))