Skip to content

Commit

Permalink
Merge pull request #123 from ZdenekM/master
Browse files Browse the repository at this point in the history
Fixed some code style problems.
  • Loading branch information
ZdenekM authored May 22, 2020
2 parents 1985ab7 + 50b2716 commit 3cb25bb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion arcor2/docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def trim(docstring):


def reindent(string):
return "\n".join(l.strip() for l in string.strip().split("\n"))
return "\n".join(line.strip() for line in string.strip().split("\n"))


def parse_docstring(docstring):
Expand Down
2 changes: 1 addition & 1 deletion arcor2/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,6 @@ def type_def_from_source(source: str, type_name: str, output_type: Type[T]) -> T
raise TypeDefException(f"Source does not contain class named '{type_name}'.")

if not issubclass(cls_def, output_type):
raise TypeDefException(f"Class is not of expected type.")
raise TypeDefException("Class is not of expected type.")

return cls_def
2 changes: 1 addition & 1 deletion arcor2/nodes/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def main():

swaggerui_blueprint = get_swaggerui_blueprint(
SWAGGER_URL, # Swagger UI static files will be mapped to '{SWAGGER_URL}/dist/'
f"./api/swagger.json"
"./api/swagger.json"
)

# Register blueprint at URL
Expand Down
2 changes: 1 addition & 1 deletion arcor2/nodes/execution_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def main():

swaggerui_blueprint = get_swaggerui_blueprint(
SWAGGER_URL, # Swagger UI static files will be mapped to '{SWAGGER_URL}/dist/'
f"./api/swagger.json"
"./api/swagger.json"
)

# Register blueprint at URL
Expand Down
6 changes: 3 additions & 3 deletions arcor2/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _send(url: str, op: Callable, data: OptionalData = None,
resp = op(url, data=json.dumps(d), timeout=TIMEOUT, headers={'Content-Type': 'application/json'},
params=params)
except requests.exceptions.RequestException as e:
raise RestException(f"Catastrophic system error.", str(e)) from e
raise RestException("Catastrophic system error.", str(e)) from e

handle_response(resp)

Expand Down Expand Up @@ -162,7 +162,7 @@ def delete(url: str):
try:
resp = SESSION.delete(url, timeout=TIMEOUT)
except requests.exceptions.RequestException as e:
raise RestException(f"Catastrophic system error.", str(e)) from e
raise RestException("Catastrophic system error.", str(e)) from e

handle_response(resp)

Expand Down Expand Up @@ -192,7 +192,7 @@ def _get_response(url: str, body: Optional[JsonSchemaMixin] = None, params: Para
try:
resp = SESSION.get(url, timeout=TIMEOUT, data=body_dict, params=params)
except requests.exceptions.RequestException as e:
raise RestException(f"Catastrophic system error.", str(e)) from e
raise RestException("Catastrophic system error.", str(e)) from e

handle_response(resp)

Expand Down
2 changes: 1 addition & 1 deletion arcor2/server/rpc/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ async def rename_object_cb(req: rpc.scene.RenameObjectRequest) -> \

for obj_name in glob.SCENE.object_names():
if obj_name == req.args.new_name:
return False, f"Object name already exists."
return False, "Object name already exists."

target_obj.name = req.args.new_name

Expand Down

0 comments on commit 3cb25bb

Please sign in to comment.