continue print u'POST\t{0:d}\t{1:s}'.format(sc, s) else: print u'POST\t{0:s}'.format(s) cur = self.con.cursor() cur.execute(self.publish, (s, p, sc)) cur.close() if __name__ == '__main__': from credentials import Credentials from sources import Sources cred = Credentials() con = cred.db() s = Sources(con, **cred.strdict('api')) g = Generator(con, sources = s, **cred.strdict('api')) if cred.cred['api']['new']: print 'Reinitializing database.' g.reset() g.tweet()
message[i + self.parts] if i < last else None, i == 0 ) for i in range(last + 1) ]) cur.executemany(self.insert, l) cur.close() if __name__ == '__main__': from credentials import Credentials cred = Credentials() con = cred.db() p = Parser( con, **cred.strdict('api') ) if cred.cred['api']['new']: print 'Reinitializing database.' p.reset() try: p.analyze( cred.stream() ) except KeyboardInterrupt: pass con.close()