This repository has been archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Intepreter): Add compile method
Exposes code parsing as the `compile` method on `Interpreter`, accessible via `Server`. This enables Executa to delegate the `compile` method to Pyla for Python code chunks. Does some refactoring so that `Server` does nothing but dispatch methods calls to `Interpreter` as in Executa itself.
- Loading branch information
Nokome Bentley
committed
Dec 16, 2019
1 parent
4705b2a
commit 96b5bbd
Showing
5 changed files
with
154 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""Custom error classes""" | ||
|
||
class CapabilityError(Exception): | ||
""" | ||
Custom error class to indicate that an executor is not capable of performing a method call. | ||
Python implementation of Executa's | ||
[CapabilityError](https://github.com/stencila/executa/blob/v1.4.0/src/base/errors.ts#L57). | ||
Is translated to a JSON-RPC error with code `CapabilityError`. | ||
""" | ||
|
||
def __init__(self, method: str, **kwargs): | ||
params = ', '.join(['{} = {}'.format(name, value) for name, value in kwargs.items()]) | ||
super().__init__('Incapable of method "{}" with params "{}"'.format(method, params)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.