diff options
-rw-r--r-- | db_proxy.py | 1 | ||||
-rw-r--r-- | megahal_bot.py | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/db_proxy.py b/db_proxy.py index 8cb3e55..fc79bc4 100644 --- a/db_proxy.py +++ b/db_proxy.py @@ -89,3 +89,4 @@ if __name__ == "__main__": if A.is_connected: A.disconnect() if B.is_connected: B.disconnect() db.running = False + print "main thread exit" diff --git a/megahal_bot.py b/megahal_bot.py index e29edf1..9e70505 100644 --- a/megahal_bot.py +++ b/megahal_bot.py @@ -87,12 +87,13 @@ Argumente: --dbname=DBNAME Database (Standard: DBNAME=omegle) -l or --local Do local testing + -p NAME or --profile=NAME Database select profile (Standard: NAME=standard) see sourcecode""" % (sys.argv[0]) #parse args try: - opts, args = getopt.getopt(sys.argv[1:], "hd:l", ["help", "host=", "profile=","dbname=","local"]) + opts, args = getopt.getopt(sys.argv[1:], "hp:d:l", ["help", "host=", "profile=","dbname=","local"]) except getopt.GetoptError,err: print str(err) usage() @@ -107,6 +108,7 @@ Argumente: AND NOT ( message ILIKE '%www.%' OR message ILIKE '%http%' OR message ILIKE '%@%.%') + ORDER BY from_ident||to_ident, send_time; ;""", "offensive": """SELECT message FROM omegle_messages @@ -123,7 +125,8 @@ Argumente: AND LENGTH(message) < 35 AND NOT ( message ILIKE '%www.%' OR message ILIKE '%http%' - OR message ILIKE '%@%.%');""", + OR message ILIKE '%@%.%') + ORDER BY from_ident||to_ident, send_time;""", "offensive-large": """SELECT message FROM omegle_messages WHERE from_ident in ( SELECT from_ident FROM omegle_messages @@ -156,7 +159,7 @@ Argumente: local = True elif o == "--host": host = a - elif o == "--profile": + elif o in ("-p", "--profile"): if sql.has_key(a): sqlKey = a print sql[a] |