def shell_execv_iter(env=None, command=None, argv=[]): """ A helper routine to execute a shell command. This command will usually yield its results. Often the result will be a dict. """ if not command: raise RuntimeError("No command provided") if not env: env = environment() ## This ensures the registry was initialised Registry.Init() try: command = Registry.SHELL_COMMANDS[command] except: raise RuntimeError("Command %s not found in registry" % command) command = command(argv, env=env) return command.execute()
]) ## List of Scanners dbh = DB.DBO(self.test_case) dbh.execute("select count(*) as c from webmail_messages") row = dbh.fetch() self.assert_(row['c'] > 0, "No hotmail messages were found") if __name__ == '__main__': import sys import pyflag.conf config = pyflag.conf.ConfObject() config.parse_options() Registry.Init() ## Update the current webmail_messages to include message ids dbh = DB.DBO(sys.argv[1]) dbh1 = dbh.clone() dbh.execute( "select inode_id, parent_inode_id, message_id from webmail_messages") for row in dbh: if not row['message_id']: data = '' m = '' dbh1.execute( "select `key`,value from http_parameters where inode_id=%r and `key`='kr' limit 1", row['parent_inode_id']) row1 = dbh1.fetch() if row1: