aboutsummaryrefslogtreecommitdiff
path: root/chinese/pyDict/files/patch-aa
blob: ae698c8365dd1373c6497f8732c79667e694a928 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- dict.py.orig	Mon Sep 18 07:31:48 2000
+++ dict.py	Sat Mar 17 02:23:23 2001
@@ -252,7 +252,7 @@
     def execute(self,word):	# English to Chinese
 		# move self.index to top
 		self.index = 0
-		command = g_command + ' --after-context=20 "^' + word + '.*=.*$" ' + dict_path + lower(word[0]) + '.lib' + '|awk "NR < 19 "'
+		command = g_command + ' -A 20 "^' + word + '.*=.*$" ' + dict_path + lower(word[0]) + '.lib' + '|awk "NR < 19 "'
 		result_lines = os.popen(command,'r').readlines()
 		#if result_lines:
 		if result_lines:
@@ -488,7 +488,7 @@
 
 def console_e_dict(input=None):
 	#set up g_command
-	g_command = '/bin/grep --ignore-case'
+	g_command = '/usr/bin/grep --ignore-case'
 	if input == None:
 		inp = raw_input('word:')
 	else:
@@ -503,7 +503,7 @@
 			console_c_dict()
 			return
 		else:	
-			command = g_command + " '^" + inp + "=.*$' " + dict_path + lower(word[0]) + '.lib'
+			command = g_command + " '^" + inp + "=.*$' " + dict_path + lower(inp[0]) + '.lib'
 			result_line = os.popen(command,'r').readline()
 			#if result_lines:
 			if result_line:
@@ -532,7 +532,7 @@
 
 def console_c_dict(input=None):
 	#set up g_command
-	g_command = '/bin/grep '
+	g_command = '/usr/bin/grep '
 	if input == None:
 		inp = raw_input('word:')
 	else:
@@ -603,7 +603,7 @@
 	print 'type -e to English-Chinese mode'
 
     # set up grep command
-    g_command = '/bin/grep --ignore-case'
+    g_command = '/usr/bin/grep --ignore-case'
     dict_path = '/usr/X11R6/lib/X11/pyDict/'
 
     # check if there is an DISPLAY environment variable