Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d571c5280004
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f2502026bfc3
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Sep 6, 2016

  1. Copy the full SHA
    76c407b View commit details
  2. Copy the full SHA
    9e33bce View commit details
  3. Copy the full SHA
    f250202 View commit details
Showing with 20 additions and 17 deletions.
  1. +1 −1 artiq/dashboard/experiments.py
  2. +19 −16 artiq/gui/applets.py
2 changes: 1 addition & 1 deletion artiq/dashboard/experiments.py
Original file line number Diff line number Diff line change
@@ -192,7 +192,7 @@ def _disable_other_scans(self, current_name):
for name, widgets in self._arg_to_widgets.items():
if (name != current_name
and isinstance(widgets["entry"], ScanEntry)):
entry.disable()
widgets["entry"].disable()

def save_state(self):
expanded = []
35 changes: 19 additions & 16 deletions artiq/gui/applets.py
Original file line number Diff line number Diff line change
@@ -81,13 +81,14 @@ async def serve(self, embed_cb, fix_initial_size_cb):
finally:
self.datasets_sub.notify_cbs.remove(self._on_mod)

def start(self, embed_cb, fix_initial_size_cb):
def start_server(self, embed_cb, fix_initial_size_cb):
self.server_task = asyncio.ensure_future(
self.serve(embed_cb, fix_initial_size_cb))

async def stop(self):
self.server_task.cancel()
await asyncio.wait([self.server_task])
async def stop_server(self):
if hasattr(self, "server_task"):
self.server_task.cancel()
await asyncio.wait([self.server_task])


class _AppletDock(QDockWidgetCloseDetect):
@@ -137,13 +138,14 @@ async def start(self):
except:
logger.warning("Applet %s failed to start", self.applet_name,
exc_info=True)
return
asyncio.ensure_future(
LogParser(self._get_log_source).stream_task(
self.ipc.process.stdout))
asyncio.ensure_future(
LogParser(self._get_log_source).stream_task(
self.ipc.process.stderr))
self.ipc.start(self.embed, self.fix_initial_size)
self.ipc.start_server(self.embed, self.fix_initial_size)
finally:
self.starting_stopping = False

@@ -165,18 +167,19 @@ async def terminate(self, delete_self=True):
self.starting_stopping = True

if hasattr(self, "ipc"):
await self.ipc.stop()
self.ipc.write_pyon({"action": "terminate"})
try:
await asyncio.wait_for(self.ipc.process.wait(), 2.0)
except:
logger.warning("Applet %s failed to exit, killing",
self.applet_name)
await self.ipc.stop_server()
if hasattr(self.ipc, "process"):
self.ipc.write_pyon({"action": "terminate"})
try:
self.ipc.process.kill()
except ProcessLookupError:
pass
await self.ipc.process.wait()
await asyncio.wait_for(self.ipc.process.wait(), 2.0)
except:
logger.warning("Applet %s failed to exit, killing",
self.applet_name)
try:
self.ipc.process.kill()
except ProcessLookupError:
pass
await self.ipc.process.wait()
del self.ipc

if hasattr(self, "embed_widget"):