summaryrefslogtreecommitdiffstats
path: root/abs/core/ncid/ncid-log.py
blob: 64006df22ac5a566bbb61fa56e80e7ce46f46d2c (plain)
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
#!/usr/bin/python2

import MySQLdb
import sys
import getopt
import socket
import os
cdb = MySQLdb.connect(host="127.0.0.1", user="mythtv", passwd="mythtv", db="ncid")
#log to logger?



#log to db

def main(argv):

    DATE=sys.stdin.readline().strip()
    TIME=sys.stdin.readline().strip()
    NUMBER=sys.stdin.readline().strip()
    NAME=sys.stdin.readline().strip()
    LINE=sys.stdin.readline().strip()
    TYPE=sys.stdin.readline().strip()

    #print "start of line"
    #print DATE
    #print TIME
    #print NUMBER
    #print NAME
    #print "$$$$$$$$$$$$$$$$$$"
    ncursor=cdb.cursor()
    ncursor.execute ("""INSERT INTO cid (date,time,name,number,calltype) VALUES
                    ('%s', '%s','%s','%s','%s');""" %(DATE,TIME,NAME,NUMBER,TYPE ))

if __name__ == "__main__":
    main(sys.argv[1:])