"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/gnome-glossary/gnome_glossary.py" between
gnumeric-1.12.49.tar.xz and gnumeric-1.12.50.tar.xz

About: Gnumeric - The GNOME office spreadsheet.

gnome_glossary.py  (gnumeric-1.12.49.tar.xz):gnome_glossary.py  (gnumeric-1.12.50.tar.xz)
skipping to change at line 29 skipping to change at line 29
entries = [] entries = []
for row in range(1, sheet.get_extent().end.row + 1): for row in range(1, sheet.get_extent().end.row + 1):
term = sheet[0, row].get_value_as_string() term = sheet[0, row].get_value_as_string()
definition = sheet[1, row].get_value_as_string() definition = sheet[1, row].get_value_as_string()
translation = sheet[lang_col, row].get_value_as_string() translation = sheet[lang_col, row].get_value_as_string()
if term: if term:
entries.append({'term': term, 'definition': definition, ' translation' : translation}) entries.append({'term': term, 'definition': definition, ' translation' : translation})
elif definition: elif definition:
entries[-1]['definition'] = '%s\n%s' % (entries[-1]['defi nition'], definition) entries[-1]['definition'] = '%s\n%s' % (entries[-1]['defi nition'], definition)
for e in entries: for e in entries:
print e print(e)
output.write(len('\n'), '\n') output.write(len('\n'), '\n')
for d in string.split(e['definition'], '\n'): for d in string.split(e['definition'], '\n'):
str = '#. %s\n' % d str = '#. %s\n' % d
output.write(len(str), str) output.write(len(str), str)
str = 'msgid "%s"\n' % e['term'] str = 'msgid "%s"\n' % e['term']
output.write(len(str), str) output.write(len(str), str)
str = 'msgstr "%s"\n' % e['translation'] str = 'msgstr "%s"\n' % e['translation']
output.write(len(str), str) output.write(len(str), str)
def po_file_save(wb, output): def po_file_save(wb, output):
for sheet in wb.sheets(): for sheet in wb.sheets():
if sheet[0, 0].get_value_as_string() == 'Term': if sheet[0, 0].get_value_as_string() == 'Term':
save_sheet_as_po (sheet, output) save_sheet_as_po (sheet, output)
break break
else: else:
raise GnumericError, 'Could not find Gnome Glossary sheet' raise GnumericError('Could not find Gnome Glossary sheet')
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)