Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pylightning: Made rpc a public member of Plugin and sorted imports
After this code change people can use `plugin.rpc` from anywhere in their plugin code this is much nicer than going this way: ``` @plugin.method("init") def init(options, configuration, plugin): global rpc basedir = plugin.lightning_dir rpc_filename = plugin.rpc_filename path = os.path.join(basedir, rpc_filename) rpc = LightningRpc(path) ``` or similarly that way: ``` @plugin.method("init") def init(options, configuration, plugin): global rpc basedir = configuration['lightning-dir'] rpc_filename = configuration['rpc-file'] path = os.path.join(basedir, rpc_filename) rpc = LightningRpc(path) ``` Also the imports have been sorted alphabetically Co-authored-by: Rene Pickhardt <[email protected]> Co-authored-by: Christian Decker <[email protected]>
- Loading branch information