~ubuntu-branches/ubuntu/raring/sunpinyin/raring

« back to all changes in this revision

Viewing changes to wrapper/macos/packaging/genplist.py

  • Committer: Package Import Robot
  • Author(s): YunQiang Su
  • Date: 2012-03-30 15:31:55 UTC
  • mfrom: (1.1.3) (1.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20120330153155-qgls77sogzgtg9zp
Tags: 2.0.3+git20120222-1
* Team upload: git snapshot 20120222.
   - fix breaks if LDFLAGS in environment contains
       multiple words (Closese #646001).
   - rm patches merged to upstream:
       append-os-environ-toenv.patch
       fix-ftbfs-on-sh.patch
       remove-10-candidate-words-limitation.patch
   - refresh disable-lm-dict-compile.patch.
* Bump stardard version to 3.9.3: no modify needed.
* add libsunpinyin3-dbg and python-sunpinyin packages.
* debian/compat to 9, multiarch it.
* rewrite debian/rules with dh 7 format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
import plistlib, hashlib, os, sys
 
4
 
 
5
dir = "../../../data"
 
6
filenames = [ "lm_sc.t3g.be", "lm_sc.t3g.le", "pydict_sc.bin.be", "pydict_sc.bin.le" ]
 
7
files = []
 
8
plist_file = "SunpinyinDataFiles.xml"
 
9
 
 
10
def sha256(file):
 
11
    s = hashlib.sha256()
 
12
 
 
13
    s.update(open(file, "rb").read())
 
14
    return s.hexdigest()
 
15
 
 
16
if len(sys.argv) > 1:
 
17
    plist_file = sys.argv[1]
 
18
 
 
19
for filename in filenames:
 
20
    path = os.path.join(dir, filename)
 
21
    print "Processing %s..." % filename
 
22
 
 
23
    file = {}
 
24
 
 
25
    file["Name"] = filename
 
26
    file["URL"] = "http://sunpinyin.googlecode.com/files/%s" % filename
 
27
    file["Size"] = int(os.path.getsize(path))
 
28
    file["SHA256"] = sha256(path)
 
29
 
 
30
    files.append(file)
 
31
 
 
32
plistlib.writePlist(files, plist_file)
 
33
 
 
34
print "Done, written to %s." % plist_file
 
35