diff --git a/tools/paiza.io/iupaiza.py b/tools/paiza.io/iupaiza.py index 1fec6a73b4..63cafa1710 100644 --- a/tools/paiza.io/iupaiza.py +++ b/tools/paiza.io/iupaiza.py @@ -95,6 +95,7 @@ def make_code(path, encoding, expand): # run paiza def run_paiza(code, options): paiza = PaizaIO() + paiza.longpoll(True) paiza.code(code) return paiza.run() diff --git a/tools/paiza.io/pypaiza.py b/tools/paiza.io/pypaiza.py index 22f7d96554..fbc832dd82 100644 --- a/tools/paiza.io/pypaiza.py +++ b/tools/paiza.io/pypaiza.py @@ -59,8 +59,9 @@ def wait_complete(self): r = self.get_status() def run(self): - self.create() - self.wait_complete(); + r = self.create() + while not self.is_completed(r): + r = self.get_status() return self.get_details() def language(language, str): @@ -73,6 +74,10 @@ def input(self, str): self.parameter.update({'input':str}) def stdin(self, str): self.parameter.update({'input':str}) + def longpoll(self, b): + self.parameter.update({'longpoll':b}) + def longpoll_timeout(self, t): + self.parameter.update({'longpoll_timeout':t}) def dump(self): print self.parameter