# Prototype lorry-controller cli, to save remembering the HTTP API... import cliapp import requests class CLI(cliapp.Application): def cmd_promote(self, args): '''Move a repo to the top of the processing queue.''' if len(args) != 1: raise cliapp.AppException( 'This command takes one argument: the repo to promote.') url = 'http://localhost:12765/1.0/move-to-top' payload = {'path': args[0]} r = requests.post(url, data=payload) if r.ok: print r.text else: raise cliapp.AppException(r) CLI().run()