From 65797d1175f0bcfd49887d6995bd7e24f3b41837 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Sat, 12 May 2012 17:10:47 -0500 Subject: nicd: change name of ncid.py -> ncid-log.py This file is used to log phone numbers to the database --- abs/core/ncid/PKGBUILD | 4 ++-- abs/core/ncid/ncid-log.py | 35 +++++++++++++++++++++++++++++++++++ abs/core/ncid/ncid.py | 35 ----------------------------------- 3 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 abs/core/ncid/ncid-log.py delete mode 100644 abs/core/ncid/ncid.py diff --git a/abs/core/ncid/PKGBUILD b/abs/core/ncid/PKGBUILD index 9a468e8..dbf5daa 100644 --- a/abs/core/ncid/PKGBUILD +++ b/abs/core/ncid/PKGBUILD @@ -12,7 +12,7 @@ backup=() arch=('i686') install=ncid.install #source=(http://voxel.dl.sourceforge.net/project/ncid/ncid/$pkgver/$pkgname-$pkgver-src.tar.gz ncidd.conf ncid.conf ncid.py ncidpermissions.sql ncid.sql) -source=(http://voxel.dl.sourceforge.net/project/ncid/ncid/$pkgver/$pkgname-$pkgver-src.tar.gz ncid.py ncidpermissions.sql ncid.sql ncid-linhes) +source=(http://voxel.dl.sourceforge.net/project/ncid/ncid/$pkgver/$pkgname-$pkgver-src.tar.gz ncid-log.py ncidpermissions.sql ncid.sql ncid-linhes) build() { cd $startdir/src/$pkgname @@ -27,7 +27,7 @@ package(){ sed -i "s|^.*\$(MAKE) install prefix=/usr prefix2=|\t\$(MAKE) install prefix=${pkgdir}/usr prefix2=$pkgdir|" Makefile make package-install install -m 755 $startdir/src/ncid-linhes $startdir/pkg/usr/share/ncid - install -m 755 $startdir/src/ncid.py $startdir/pkg/usr/bin + install -m 755 $startdir/src/ncid-log.py $startdir/pkg/usr/bin/ncid-log.py install -m 755 -D $startdir/src/ncid.sql $startdir/pkg/tmp/ncid.sql install -m 755 -D $startdir/src/ncidpermissions.sql $startdir/pkg/tmp/ncidpermissions.sql chmod 777 $startdir/pkg/tmp 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:]) + diff --git a/abs/core/ncid/ncid.py b/abs/core/ncid/ncid.py deleted file mode 100644 index 1301da1..0000000 --- a/abs/core/ncid/ncid.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/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:]) - -- cgit v0.12