mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
method to run custom script
This commit is contained in:
parent
9ae12c43e4
commit
135f208cf4
1 changed files with 8 additions and 0 deletions
|
@ -22,6 +22,14 @@ class Console(QtGui.QPlainTextEdit):
|
|||
self.document().setDefaultFont(QtGui.QFont("monospace", 10, QtGui.QFont.Normal))
|
||||
self.showMessage(startup_message)
|
||||
|
||||
self.updateNamespace({'run':self.run_script})
|
||||
|
||||
def run_script(self, filename):
|
||||
with open(filename) as f:
|
||||
script = f.read()
|
||||
result = eval(script, self.namespace, self.namespace)
|
||||
|
||||
|
||||
|
||||
def updateNamespace(self, namespace):
|
||||
self.namespace.update(namespace)
|
||||
|
|
Loading…
Add table
Reference in a new issue