def connect_mysql(): g.mysql = sm()
#!/ import sys from urllib import urlencode from urllib2 import urlopen from redis import Redis from archive import archive_chat, get_or_create_log, delete_chat from model import sm import sqlalchemy.exc import requests redis = Redis() mysql = sm() print 'Archiving chats' count = 0 integrity = 0 programming = 0 other = 0 keys = redis.keys('chat.*.meta') i_error = [] p_error = [] o_error = [] for metadata in keys: metasplit = metadata.split('.') chat = metasplit[1:2] chat_url = ''.join(chat)