示例#1
0
 def f9(self, self2):
     #print "F9 spell"
     self2.spell = not self2.spell
     if self2.spell: ooo = "on"
     else: ooo = "off"
     self2.mained.update_statusbar("Spell checking is %s" % ooo)
     pedspell.spell(self2)
示例#2
0
文件: acthand.py 项目: pglen/pgpygtk
    def f9(self, self2, flag = False):
        #print "F9 spell"
        self2.spell = not self2.spell

        if self2.spell:
            ooo = "on."
            if self2.shift or flag:
                self2.spellmode = True; ppp = "Mode: text"
            else:
                self2.spellmode = False; ppp = "Mode: code"
        else:
            ooo = "off."; ppp = ""

        self2.mained.update_statusbar("Spell checking is %s %s" % (ooo, ppp))
        pedspell.spell(self2, self2.spellmode)
示例#3
0
def handler(signum, frame):

    try:
        #print 'Signal handler called with signal', signum
        #print pedconfig.conf.idle, pedconfig.conf.syncidle
        global notebook

        if pedconfig.conf.idle:
            pedconfig.conf.idle -= 1
            if pedconfig.conf.idle == 0:
                vcurr = notebook.get_nth_page(notebook.get_current_page())
                # Rescue to save:
                if vcurr:
                    vcurr.area.source_id = \
                        gobject.idle_add(vcurr.area.idle_callback)

        if pedconfig.conf.syncidle:
            pedconfig.conf.syncidle -= 1
            if pedconfig.conf.syncidle == 0:
                vcurr = notebook.get_nth_page(notebook.get_current_page())
                if vcurr:
                    pedspell.spell(vcurr.area)
                    vcurr.area.source_id2 = \
                    gobject.idle_add(vcurr.area.idle_callback2)
                    if vcurr.area.changed:
                        vcurr.area2.text = vcurr.area.text
                        vcurr.area2.invalidate()

        if pedconfig.conf.pedwin.statuscount:
            pedconfig.conf.pedwin.statuscount -= 1
            if pedconfig.conf.pedwin.statuscount == 0:
                pedconfig.conf.pedwin.update_statusbar("Idle.")
                pedconfig.conf.pedwin.statuscount = 0

    except:
        print "Exception in timer handler", sys.exc_info()

    signal.alarm(1)
示例#4
0
文件: peddoc.py 项目: pglen/pgpygtk
 def keytime(self):
     self.fired -= 1
     if self.fired == 1:
         #print "keytime", time.time()
         pedspell.spell(self, self.spellmode)