Home | Trees | Indices | Help |
|
---|
|
1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 # 4 # Copyright 2008 Zuza Software Foundation 5 # 6 # This file is part of translate. 7 # 8 # translate is free software; you can redistribute it and/or modify 9 # it under the terms of the GNU General Public License as published by 10 # the Free Software Foundation; either version 2 of the License, or 11 # (at your option) any later version. 12 # 13 # translate is distributed in the hope that it will be useful, 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 # GNU General Public License for more details. 17 # 18 # You should have received a copy of the GNU General Public License 19 # along with translate; if not, write to the Free Software 20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 22 import re 23 24 charset_re = re.compile('CHARACTER_SET[ ]+(?P<charset>.*)') 25 header_item_or_end_re = re.compile('(((?P<key>[^ ]+)(?P<space>[ ]*:[ ]*)(?P<value>.*))|(?P<end_comment>[*]/))') 26 header_item_re = re.compile('(?P<key>[^ ]+)(?P<space>[ ]*:[ ]*)(?P<value>.*)') 27 string_entry_re = re.compile('(?P<start>rls_string[ ]+)(?P<id>[^ ]+)(?P<space>[ ]+)(?P<str>.*)') 2830 return x314534 self.f = f 35 self.charset = charset 36 self.current_line = u'' 37 self.read_hook = read_hook 38 self.read_line()3947 result = f(ps.current_line) 48 while test(result): 49 ps.read_line() 50 result = f(ps.current_line) 51 return result52 5557 if ps.current_line.startswith('// DO NOT TRANSLATE'): 58 ps.read_line() 59 read_while(ps, identity, lambda line: not line.startswith('// DO NOT TRANSLATE')) 60 ps.read_line() 61 eat_whitespace(ps)62 69
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Mar 3 16:38:01 2010 | http://epydoc.sourceforge.net |