[ooo-build-commit] .: 2 commits - bin/add_acor.py bin/.gitignore bin/Makefile.am src/acor.csv src/Makefile.am
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Tue Oct 5 00:43:59 PDT 2010
bin/.gitignore | 1
bin/Makefile.am | 1
bin/add_acor.py | 84 --------------------------------------------------------
src/Makefile.am | 1
src/acor.csv | 4 --
5 files changed, 91 deletions(-)
New commits:
commit 94e85fe76ba0792db14bf56512493913a80d4773
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Tue Oct 5 09:43:28 2010 +0200
Removed some remaining mentions to acor hacks.
diff --git a/bin/.gitignore b/bin/.gitignore
index 0f9cee4..3a8cb7a 100644
--- a/bin/.gitignore
+++ b/bin/.gitignore
@@ -1,4 +1,3 @@
-add_acor.py
fixguard.py
font-munge
gob
diff --git a/bin/Makefile.am b/bin/Makefile.am
index 1214c7f..058cc72 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -1,7 +1,6 @@
SUBDIRS=piece
script_files = \
- add_acor.py \
amt-license-patch \
applyflags \
bash-completion.in \
diff --git a/bin/add_acor.py b/bin/add_acor.py
deleted file mode 100755
index 4874e1d..0000000
--- a/bin/add_acor.py
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/python
-
-import zipfile
-import xml.dom.minidom
-import os
-import csv
-import sys
-
-
-def read_list( file ):
- langs = dict();
-
- file_hd = open( file )
- reader = csv.reader( file_hd )
- reader.next( ) # Skip the headers line
- for row in reader:
- locale = row[0]
- if locale == "":
- locale = 'all'
- values = []
- if locale in langs:
- values = langs[locale]
- values.append( ( row[1], unicode( row[2], "utf-8" ) ) )
- langs[locale] = values
- return langs
-
-def extract_items( data, locale ):
- entries = []
- if 'all' in data:
- entries = entries + data['all']
- if locale in data:
- entries = entries + data[locale]
- return entries
-
-def update_zip( file, items ):
- tmpname = file + ".new"
-
- # First open the dat to extract the existing Documentlist.xml file
- inFile = zipfile.ZipFile( file, "r" )
- content = inFile.read( "DocumentList.xml" )
-
- xmlDoc = xml.dom.minidom.parseString( content )
-
- # Actually add the elements in the XML file
- for pair in items:
- node = xmlDoc.createElement( "block-list:block" )
- node.setAttribute( "block-list:abbreviated-name", pair[0] )
- node.setAttribute( "block-list:name", pair[1] )
- xmlDoc.documentElement.appendChild( node )
-
- # Open the dat file for writing now
- outFile = zipfile.ZipFile( tmpname, "w" )
- data = xmlDoc.toxml().encode( "utf-8" )
- for name in inFile.namelist( ):
- if name != "DocumentList.xml":
- outFile.writestr( name, inFile.read( name ) )
-
- outFile.writestr( "DocumentList.xml", data )
- inFile.close()
- outFile.close()
-
- # Rename the new file
- os.rename( tmpname, file )
-
-def main():
- if ( len( sys.argv ) == 3 ):
- builddir = sys.argv[1]
- datafile = sys.argv[2]
- else:
- print "arguments: build-dir data-file.csv"
- sys.exit( 1 )
-
- data = read_list( datafile )
- for root, dirs, files in os.walk( os.path.join( builddir, "extras", "source", "autotext", "lang" ) ):
- for f in files:
- if ( f.endswith( ".dat" ) ):
- locale = os.path.basename( root )
- items = extract_items( data, locale )
- if len( items ) > 0:
- print "Updating: " + os.path.join( root, f )
- update_zip( os.path.join( root, f ), items )
-
-if __name__ == '__main__':
- main( )
diff --git a/src/Makefile.am b/src/Makefile.am
index 1c7174c..9d93bdd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,7 +4,6 @@ EXTRA_DIST=\
default_images \
${wildcard *.dic} \
Draft.jpg \
- acor.csv \
banner_go-oo.bmp \
banner_nld.bmp \
cli_uno_bridge.dll.config.in \
commit 596dbb441ad7b48e9318a3b9b7eca3225ed62d55
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Tue Oct 5 09:34:09 2010 +0200
Removed now useless autocorrection files
diff --git a/src/acor.csv b/src/acor.csv
deleted file mode 100644
index f9e74fe..0000000
--- a/src/acor.csv
+++ /dev/null
@@ -1,4 +0,0 @@
-locale,string,replacement
-,"1/2","½"
-,"1/4","¼"
-,"3/4","¾"
More information about the ooo-build-commit
mailing list