summaryrefslogtreecommitdiffstats
path: root/abs/core/ncid/ncid-log.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-05-12 22:10:47 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-05-12 22:10:47 (GMT)
commit65797d1175f0bcfd49887d6995bd7e24f3b41837 (patch)
tree738a0c3b87989b2aa9658ae8a789c2003d002ed2 /abs/core/ncid/ncid-log.py
parentd18de3f6f6b90f0668d8918d6e7542ef12c6fab7 (diff)
downloadlinhes_pkgbuild-65797d1175f0bcfd49887d6995bd7e24f3b41837.zip
linhes_pkgbuild-65797d1175f0bcfd49887d6995bd7e24f3b41837.tar.gz
linhes_pkgbuild-65797d1175f0bcfd49887d6995bd7e24f3b41837.tar.bz2
nicd: change name of ncid.py -> ncid-log.py
This file is used to log phone numbers to the database
Diffstat (limited to 'abs/core/ncid/ncid-log.py')
-rw-r--r--abs/core/ncid/ncid-log.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/abs/core/ncid/ncid-log.py b/abs/core/ncid/ncid-log.py
new file mode 100644
index 0000000..1301da1
--- /dev/null
+++ b/abs/core/ncid/ncid-log.py
@@ -0,0 +1,35 @@
+#!/usr/bin/python
+
+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()
+
+
+ #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) VALUES
+ ('%s', '%s','%s','%s');""" %(DATE,TIME,NAME,NUMBER ))
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
+