def main(): # Init the database before doing anything else backend.initDB() app = QtGui.QApplication(sys.argv) app.setQuitOnLastWindowClosed(False) window = Main() window.show() # It's exec_ because exec is a reserved word in Python sys.exit(app.exec_())
# -*- coding: utf-8 -*- '''Script that expires all feeds''' import backend def main(): print 'Before:', backend.Post.query.count() for f in backend.Feed.query.all(): print 'Expiring: ', f.xmlurl f.expire() print 'After:', backend.Post.query.count() if __name__ == "__main__": backend.initDB() main()