added get_job_list to jsonrpc and to the client for testing; works!

This commit is contained in:
Johannes Findeisen 2013-10-21 02:26:53 +02:00
commit b731d09d35
2 changed files with 4 additions and 11 deletions

View file

@ -24,10 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
from bjsonrpc import connect from bjsonrpc import connect
c = connect() c = connect()
time1 = c.call.time()
# do something here ... print c.call.get_job_list()
print "Time:", time1
print "Delta:", c.call.delta(time1)
print c.call.get_job_info_by_id("3bf60380") print c.call.get_job_info_by_id("3bf60380")

View file

@ -56,14 +56,9 @@ class ServerHandler(BaseHandler):
interface = None interface = None
config = None config = None
def time(self):
return time.time()
def delta(self, start):
return time.time() - start
def get_job_list(self): def get_job_list(self):
pass job_list = ServerHandler.interface.get_job_list()
return json.dumps(job_list, ensure_ascii=False)
def get_job_info_by_id(self, job_hex): def get_job_info_by_id(self, job_hex):
job = ServerHandler.interface.find_job_by_hex_string(job_hex) job = ServerHandler.interface.find_job_by_hex_string(job_hex)