예제 #1
0
파일: words.py 프로젝트: ali-04/GitHub
    def add_fa(self, newfa):
        try:

            self.fa = self.fa + ',' + convertep(newfa)

            db.execute('update words set fa="%s" ,mode="True" where num=%i' %
                       (convertpe(self.fa), self.num))
            sql.commit()
            self.fa = convertep(self.fa)
            return True
        except:
            return False
예제 #2
0
def send_message (data0):

   data = {'to':data0['to'] , 'type' : 'TEXT' , 'body' : convertep(data0.get('body',''))  }
   if data0.get ('keyboard') == '/None':
      pass 
   else : 
      data ['keyboard'] = data0.get ('keyboard',[])
   print ('\n' + convertep(gname(data0['to'])) + ' :')
   print ( rsend (data['body']) )
   signrun()

   bot1.send_message ( data )
예제 #3
0
def send_message(data0):

    data = {
        'to': data0['to'],
        'type': 'TEXT',
        'body': convertep(data0.get('body', '')),
        'keyboard': data0.get('keyboard', [])
    }
    print('\n' + convertep(gname(data0['to'])) + ' :')
    print(rsend(data['body']))
    signrun()

    bot1.send_message(data)
예제 #4
0
def send_message (data0):

   data = {'to':data0['to'] , 'type' : 'TEXT' , 'body' : convertep(data0.get('body','')) , 'keyboard':data0.get ('keyboard',[]) }

   print ('(send)      %s: %s '% (user.get_id(data['to']) ,data['body']) )

   bot1.send_message ( data )
예제 #5
0
파일: words.py 프로젝트: ali-04/GitHub
def words():

    db.execute('select num ,en ,fa ,mode from words')

    for q in db.fetchall():
        wdic[q[0]] = word(q[1], convertep(q[2]), q[0], q[3])

    return wdic
예제 #6
0
파일: words.py 프로젝트: Dim-Pi/Binlearn
    def add_fa(self, newfa):
        try:

            self.fa = self.fa + ',' + convertep(newfa)

            eeee = ''
            for q in self.fa.split(','):
                eeee += ',%s' % q.strip()
            self.fa = eeee[1:]

            db.execute('update words set fa="%s" ,mode="True" where num=%i' %
                       (convertpe(self.fa), self.num))
            sql.commit()
            self.fa = convertep(self.fa)
            return True
        except:
            return False
예제 #7
0
파일: words.py 프로젝트: Dim-Pi/Binlearn
    def edit(self, newfa):
        try:
            self.fa = convertep(newfa)

            eeee = ''
            for q in self.fa.split(','):
                eeee += "%s," % q.strip()
            self.fa = eeee[:-1]

            db.execute('update words set fa="%s" ,mode="True" where num=%i' %
                       (convertpe(newfa), self.num))
            sql.commit()
            return True
        except:
            return False