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: a64c6a321bb5
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: 21b170ed32d7
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Aug 17, 2015

  1. Verified

    This commit was signed with the committer’s verified signature.
    makenowjust Hiroya Fujinami
    Copy the full SHA
    2410ef7 View commit details
  2. Copy the full SHA
    21b170e View commit details
Showing with 21 additions and 1 deletion.
  1. +10 −1 artiq/gui/tools.py
  2. +11 −0 artiq/protocols/pc_rpc.py
11 changes: 10 additions & 1 deletion artiq/gui/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from quamash import QtCore
import numpy as np


def elide(s, maxlen):
@@ -21,11 +22,19 @@ def elide(s, maxlen):
return s


_scalar_types = {
int, float,
np.int8, np.int16, np.int32, np.int64,
np.uint8, np.uint16, np.uint32, np.uint64,
np.float16, np.float32, np.float64
}


def short_format(v):
if v is None:
return "None"
t = type(v)
if t is int or t is float:
if t in _scalar_types:
return str(v)
elif t is str:
return "\"" + elide(v, 15) + "\""
11 changes: 11 additions & 0 deletions artiq/protocols/pc_rpc.py
Original file line number Diff line number Diff line change
@@ -454,6 +454,17 @@ def _handle_connection_cr(self, reader, writer):
argspec = inspect.getfullargspec(method)
doc["methods"][name] = (dict(argspec.__dict__),
inspect.getdoc(method))
if self.builtin_terminate:
doc["methods"]["terminate"] = (
{
"args": ["self"],
"defaults": None,
"varargs": None,
"varkw": None,
"kwonlyargs": [],
"kwonlydefaults": [],
},
"Terminate the server.")
obj = {"status": "ok", "ret": doc}
elif obj["action"] == "call":
logger.debug("calling %s", _PrettyPrintCall(obj))