-
Notifications
You must be signed in to change notification settings - Fork 0
/
winword_vcl.py
709 lines (661 loc) · 25.7 KB
/
winword_vcl.py
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
# NatLink macro definitions for NaturallySpeaking
# coding: latin-1
# Generated by vcl2py 2.8.1I+, Fri Oct 31 17:34:50 2014
import natlink
from natlinkutils import *
from VocolaUtils import *
class ThisGrammar(GrammarBase):
gramSpec = """
<1> = 'Save File' ;
<2> = 'Save As' ;
<3> = 'Recent Files' ;
<4> = 'Recent File' (1 | 2 | 3 | 4) ;
<5> = ('Outline' | 'Normal' | 'Print Layout' | 'Web Layout' ) 'View' ;
<6> = 'New Item' ;
<7> = 'New Item Promote' ;
<8> = 'New Item Demote' ;
<9> = 'Promote That' ;
<10> = 'Demote That' ;
<11> = 'Expand That' ;
<12> = 'Collapse That' ;
<13> = 'Item' ('Up' | 'Down' ) ;
<14> = 'Item' ('Up' | 'Down' ) (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20) ;
<15> = 'Style' ('Normal' | 'None' ) ;
<16> = 'Heading' (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9) ;
<17> = 'Edit Style' ;
<18> = 'Insert' ('Row Below' | 'Row Above' | 'Column Left' | 'Column Right' ) ;
<19> = 'Merge Cells' ;
<20> = 'Merge Row' ;
<21> = 'Align' ('Top' | 'Center' | 'Bottom' ) ('Left' | 'Center' | 'Right' ) ;
<22> = 'Find That' ;
<23> = 'Replace Text' ;
<24> = 'Keep with Next' ;
<25> = ('Subscript' | 'Superscript' ) 'That' ;
<26> = 'En Dash' ;
<27> = 'Em Dash' ;
<28> = 'Kill Here' ;
<29> = 'Kill Back Here' ;
<30> = 'Rosy Find' ;
<31> = 'Rosy Do' ;
<32> = 'Accept' ;
<33> = 'Reject' ;
<34> = 'Find' ;
<35> = 'Replace' ;
<36> = 'Replace All' ;
<37> = 'Find Next' ;
<38> = 'Find' ;
<any> = <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>;
<sequence> exported = <any>;
<any_set2> = <any>|<32>|<33>|<34>;
<sequence_set2> exported = <any_set2>;
<any_set3> = <any>|<35>|<36>|<37>|<38>;
<sequence_set3> exported = <any_set3>;
"""
def initialize(self):
self.load(self.gramSpec)
self.currentModule = ("","",0)
self.ruleSet1 = ['sequence']
self.ruleSet2 = ['sequence_set2']
self.ruleSet3 = ['sequence_set3']
def gotBegin(self,moduleInfo):
# Return if wrong application
window = matchWindow(moduleInfo,'winword','')
if not window: return None
self.firstWord = 0
# Return if same window and title as before
if moduleInfo == self.currentModule: return None
self.currentModule = moduleInfo
self.deactivateAll()
title = string.lower(moduleInfo[1])
if string.find(title,'') >= 0:
for rule in self.ruleSet1:
try:
self.activate(rule,window)
except natlink.BadWindow:
pass
if string.find(title,'accept or reject changes') >= 0:
for rule in self.ruleSet2:
try:
self.activate(rule,window)
except natlink.BadWindow:
pass
if string.find(title,'find and replace') >= 0:
for rule in self.ruleSet3:
try:
self.activate(rule,window)
except natlink.BadWindow:
pass
def convert_number_word(self, word):
if word == '0':
return '0'
else:
return word
# 'Save File'
def gotResults_1(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+s}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_1(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 3, '\'Save File\'', e)
self.firstWord = -1
# 'Save As'
def gotResults_2(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}A'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_2(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 4, '\'Save As\'', e)
self.firstWord = -1
# 'Recent Files'
def gotResults_3(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_3(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 5, '\'Recent Files\'', e)
self.firstWord = -1
# 'Recent File' 1..4
def gotResults_4(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}'
word = fullResults[1 + self.firstWord][0]
top_buffer += self.convert_number_word(word)
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_4(words[2:], fullResults)
except Exception, e:
handle_error('winword.vcl', 6, '\'Recent File\' 1..4', e)
self.firstWord = -1
# ('Outline' | 'Normal' | 'Print Layout' | 'Web Layout') 'View'
def gotResults_5(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+v}'
word = fullResults[0 + self.firstWord][0]
if word == 'Outline':
top_buffer += 'o'
elif word == 'Normal':
top_buffer += 'n'
elif word == 'Print Layout':
top_buffer += 'p'
elif word == 'Web Layout':
top_buffer += 'w'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_5(words[2:], fullResults)
except Exception, e:
handle_error('winword.vcl', 8, '(\'Outline\' | \'Normal\' | \'Print Layout\' | \'Web Layout\') \'View\'', e)
self.firstWord = -1
# 'New Item'
def gotResults_6(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+Down}{Left_2}{End}{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_6(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 13, '\'New Item\'', e)
self.firstWord = -1
# 'New Item Promote'
def gotResults_7(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+Down}{Left_2}{End}{Enter}{Alt+Shift+Left}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_7(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 14, '\'New Item Promote\'', e)
self.firstWord = -1
# 'New Item Demote'
def gotResults_8(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+Down}{Left_2}{End}{Enter}{Alt+Shift+Right}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_8(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 15, '\'New Item Demote\'', e)
self.firstWord = -1
# 'Promote That'
def gotResults_9(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+Shift+Left}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_9(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 17, '\'Promote That\'', e)
self.firstWord = -1
# 'Demote That'
def gotResults_10(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+Shift+Right}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_10(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 18, '\'Demote That\'', e)
self.firstWord = -1
# 'Expand That'
def gotResults_11(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+Shift+Plus}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_11(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 19, '\'Expand That\'', e)
self.firstWord = -1
# 'Collapse That'
def gotResults_12(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+Shift+Minus}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_12(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 20, '\'Collapse That\'', e)
self.firstWord = -1
# 'Item' ('Up' | 'Down')
def gotResults_13(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+Shift+'
word = fullResults[1 + self.firstWord][0]
top_buffer += word
top_buffer += '}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_13(words[2:], fullResults)
except Exception, e:
handle_error('winword.vcl', 22, '\'Item\' (\'Up\' | \'Down\')', e)
self.firstWord = -1
# 'Item' ('Up' | 'Down') 1..20
def gotResults_14(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+Shift+'
word = fullResults[1 + self.firstWord][0]
top_buffer += word
top_buffer += ' '
word = fullResults[2 + self.firstWord][0]
top_buffer += self.convert_number_word(word)
top_buffer += '}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 3
if len(words) > 3: self.gotResults_14(words[3:], fullResults)
except Exception, e:
handle_error('winword.vcl', 23, '\'Item\' (\'Up\' | \'Down\') 1..20', e)
self.firstWord = -1
# 'Style' ('Normal' | 'None')
def gotResults_15(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+S}'
word = fullResults[1 + self.firstWord][0]
if word == 'Normal':
top_buffer += 'Normal'
elif word == 'None':
top_buffer += 'Default Paragraph Font'
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_15(words[2:], fullResults)
except Exception, e:
handle_error('winword.vcl', 30, '\'Style\' (\'Normal\' | \'None\')', e)
self.firstWord = -1
# 'Heading' 1..9
def gotResults_16(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer = do_flush(False, top_buffer);
dragon_arg1 = ''
dragon_arg1 += '{Ctrl+S}'
call_Dragon('SendSystemKeys', 'si', [dragon_arg1])
top_buffer += 'Heading '
word = fullResults[1 + self.firstWord][0]
top_buffer += self.convert_number_word(word)
top_buffer += '{Enter}{Down}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_16(words[2:], fullResults)
except Exception, e:
handle_error('winword.vcl', 32, '\'Heading\' 1..9', e)
self.firstWord = -1
# 'Edit Style'
def gotResults_17(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+o}'
top_buffer = do_flush(False, top_buffer);
dragon_arg1 = ''
dragon_arg1 += '100'
call_Dragon('Wait', 'i', [dragon_arg1])
top_buffer += 's{Alt+m}{Alt+o}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_17(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 34, '\'Edit Style\'', e)
self.firstWord = -1
# 'Insert' ('Row Below' | 'Row Above' | 'Column Left' | 'Column Right')
def gotResults_18(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+a}i'
word = fullResults[1 + self.firstWord][0]
if word == 'Row Below':
top_buffer += 'b'
elif word == 'Row Above':
top_buffer += 'a'
elif word == 'Column Left':
top_buffer += 'l'
elif word == 'Column Right':
top_buffer += 'r'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_18(words[2:], fullResults)
except Exception, e:
handle_error('winword.vcl', 39, '\'Insert\' (\'Row Below\' | \'Row Above\' | \'Column Left\' | \'Column Right\')', e)
self.firstWord = -1
# 'Merge Cells'
def gotResults_19(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+a}m'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_19(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 41, '\'Merge Cells\'', e)
self.firstWord = -1
# 'Merge Row'
def gotResults_20(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+Home}{Shift+Alt+End}{Alt+a}m'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_20(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 42, '\'Merge Row\'', e)
self.firstWord = -1
# 'Align' ('Top' | 'Center' | 'Bottom') ('Left' | 'Center' | 'Right')
def gotResults_21(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+a}r{Alt+e}{Alt+'
word = fullResults[1 + self.firstWord][0]
if word == 'Top':
top_buffer += 'p'
elif word == 'Center':
top_buffer += 'c'
elif word == 'Bottom':
top_buffer += 'b'
top_buffer += '}{Enter}{Alt+o}p{Alt+i}{Alt+g}'
word = fullResults[2 + self.firstWord][0]
if word == 'Left':
top_buffer += 'l'
elif word == 'Center':
top_buffer += 'c'
elif word == 'Right':
top_buffer += 'r'
top_buffer += '{Enter}{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 3
if len(words) > 3: self.gotResults_21(words[3:], fullResults)
except Exception, e:
handle_error('winword.vcl', 45, '\'Align\' (\'Top\' | \'Center\' | \'Bottom\') (\'Left\' | \'Center\' | \'Right\')', e)
self.firstWord = -1
# 'Find That'
def gotResults_22(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+c}{Ctrl+f}{Ctrl+v}{Enter}{Esc}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_22(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 50, '\'Find That\'', e)
self.firstWord = -1
# 'Replace Text'
def gotResults_23(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+e}e'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_23(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 51, '\'Replace Text\'', e)
self.firstWord = -1
# 'Keep with Next'
def gotResults_24(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+o}p{Alt+p}{Alt+x}{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_24(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 53, '\'Keep with Next\'', e)
self.firstWord = -1
# ('Subscript' | 'Superscript') 'That'
def gotResults_25(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+o}f{Alt+'
word = fullResults[0 + self.firstWord][0]
if word == 'Subscript':
top_buffer += 'b'
elif word == 'Superscript':
top_buffer += 'p'
top_buffer += '}{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_25(words[2:], fullResults)
except Exception, e:
handle_error('winword.vcl', 55, '(\'Subscript\' | \'Superscript\') \'That\'', e)
self.firstWord = -1
# 'En Dash'
def gotResults_26(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+NumKey-}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_26(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 56, '\'En Dash\'', e)
self.firstWord = -1
# 'Em Dash'
def gotResults_27(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+Alt+NumKey-}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_27(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 57, '\'Em Dash\'', e)
self.firstWord = -1
# 'Kill Here'
def gotResults_28(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Shift+End}{Shift+Left}{Del}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_28(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 59, '\'Kill Here\'', e)
self.firstWord = -1
# 'Kill Back Here'
def gotResults_29(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Shift+Home}{Shift+Right}{Del}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_29(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 60, '\'Kill Back Here\'', e)
self.firstWord = -1
# 'Rosy Find'
def gotResults_30(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+f}{Enter}{Esc}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_30(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 62, '\'Rosy Find\'', e)
self.firstWord = -1
# 'Rosy Do'
def gotResults_31(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Home}{Shift+Down_2}{Del}{Ctrl+S}CodeHeading{Enter}{Down}{Del_13}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_31(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 63, '\'Rosy Do\'', e)
self.firstWord = -1
# 'Accept'
def gotResults_32(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+a}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_32(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 66, '\'Accept\'', e)
self.firstWord = -1
# 'Reject'
def gotResults_33(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+r}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_33(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 67, '\'Reject\'', e)
self.firstWord = -1
# 'Find'
def gotResults_34(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_34(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 68, '\'Find\'', e)
self.firstWord = -1
# 'Replace'
def gotResults_35(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+r}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_35(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 71, '\'Replace\'', e)
self.firstWord = -1
# 'Replace All'
def gotResults_36(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+a}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_36(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 72, '\'Replace All\'', e)
self.firstWord = -1
# 'Find Next'
def gotResults_37(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_37(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 73, '\'Find Next\'', e)
self.firstWord = -1
# 'Find'
def gotResults_38(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_38(words[1:], fullResults)
except Exception, e:
handle_error('winword.vcl', 73, '\'Find\'', e)
self.firstWord = -1
thisGrammar = ThisGrammar()
thisGrammar.initialize()
def unload():
global thisGrammar
if thisGrammar: thisGrammar.unload()
thisGrammar = None