Skip to content

Commit 38870d1

Browse files
committed
update demo
1 parent e45b51f commit 38870d1

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

default.ini

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@ name = foss
1111
description = glossary maintain by foss-np community
1212
path = ~/.cache/anubad/gloss/np-l10n-glossary-current/
1313
pairs = en2np np2en
14-
fetch = https://github.com/foss-np/np-l10n-glossary/archive/current.tar.gz
15-
16-
[fonts]
17-
viewer = Arial 13
14+
fetch = https://github.com/foss-np/np-l10n-glossary/archive/current.tar.gz

demo.pyw

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ except:
1919
cnf = ConfigParser()
2020
cnf.read(PWD + 'default.ini')
2121
PATH_GLOSS = os.path.expanduser(cnf.get('gloss "foss"', 'path') + 'en2np/')
22-
tmp = cnf.get('fonts', 'viewer').split()
23-
def_FONT = [ ' '.join(tmp[:-1]), tmp[-1] ]
22+
def_FONT = [ "Arial", "13" ]
2423

2524
FILE_TYPES = ["tsl", "fun", "abb", "tra", "txt"]
2625

@@ -83,11 +82,11 @@ class Browser(Frame):
8382

8483
def fill_tree(self, _gloss):
8584
try: # py2/3 compatibility
86-
data = open(self.GLOSS, encoding="UTF-8").read()
85+
data = open(self.GLOSS, encoding="utf8").read()
8786
except:
8887
# for python2
8988
data = open(self.GLOSS).read()
90-
data = data.decode('utf-8')
89+
data = data.decode('utf8')
9190

9291
self.count = 0
9392
for line in data.splitlines():
@@ -97,7 +96,7 @@ class Browser(Frame):
9796
try:
9897
row[2] = row[2][1:] # remove space
9998
except:
100-
print("File Format Error: %s: %d"%(self.GLOSS, self.count))
99+
# print("File Format Error: %s: %d"%(self.GLOSS, self.count))
101100
exit()
102101
self.select = self.tree.insert('', 'end', values=row, tag="npfont")
103102

0 commit comments

Comments
 (0)