Skip to content

Commit

Permalink
Try to solve the imcompatable problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoyang-Zhu committed Sep 16, 2018
1 parent dce3151 commit 88ac423
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
*.coinscript
*.conf
Hashmal*.egg-info
# Built package
build/
dist/
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@ Hashmal is intended for cryptocurrency developers and power users.
- When editing scripts, put something in double quotation marks to ensure it's interpreted as text rather than hex data.
- You can quickly evaluate the script you're working on via *Script > Evaluate* in the menubar.

## Libraries
To run the application you must use / have installed:
- Python 2.7
- PyQt4
### PyQt4
You can install PyQt4 if you use Anaconda with the following command
```
conda install pyqt=4
```
If you use Debian / Ubuntu, you can use the following command
```
sudo apt install pyqt4-dev-tools
```
Installation instructions for other platforms:
[https://www.riverbankcomputing.com/software/pyqt/download](https://www.riverbankcomputing.com/software/pyqt/download)
### Installation
After that, use `setup.py` to build / install the application
```
python setup.py install
```
This will install the external module requirements listed in `requirements.txt` too

## Documentation

See the file `doc/usage.adoc` for basic instructions. See the [Hashmal wiki on Github](https://github.com/mazaclub/hashmal/wiki) for details.
Expand Down
6 changes: 2 additions & 4 deletions hashmal_lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import sys

from PyQt4.QtGui import QApplication

from main_window import HashmalMain


class HashmalGui(object):
def __init__(self):
from PyQt4.QtGui import QApplication
super(HashmalGui, self).__init__()
self.app = QApplication(sys.argv)

def main(self):
from main_window import HashmalMain
self.main_window = HashmalMain(self.app)
self.main_window.show()
sys.exit(self.app.exec_())
Expand Down
16 changes: 16 additions & 0 deletions hashmal_lib/entry_points.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
hashmal_entry_points = {
'hashmal.plugin': [
'Address Encoder = hashmal_lib.plugins.addr_encoder:make_plugin',
'Block Analyzer = hashmal_lib.plugins.block_analyzer:make_plugin',
'Blockchain = hashmal_lib.plugins.blockchain:make_plugin',
'Chainparams = hashmal_lib.plugins.chainparams:make_plugin',
'Item Types = hashmal_lib.plugins.item_types:make_plugin',
'Log = hashmal_lib.plugins.log:make_plugin',
'Script Generator = hashmal_lib.plugins.script_gen:make_plugin',
'Stack Evaluator = hashmal_lib.plugins.stack:make_plugin',
'Transaction Analyzer = hashmal_lib.plugins.tx_analyzer:make_plugin',
'Transaction Builder = hashmal_lib.plugins.tx_builder:make_plugin',
'Variables = hashmal_lib.plugins.variables:make_plugin',
'Wallet RPC = hashmal_lib.plugins.wallet_rpc:make_plugin'
]
}
17 changes: 1 addition & 16 deletions hashmal_lib/gui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,22 +243,7 @@ def setReadOnly( self, state ):
readOnly = QtCore.pyqtProperty(bool, isReadOnly, setReadOnly)


hashmal_entry_points = {
'hashmal.plugin': [
'Address Encoder = hashmal_lib.plugins.addr_encoder:make_plugin',
'Block Analyzer = hashmal_lib.plugins.block_analyzer:make_plugin',
'Blockchain = hashmal_lib.plugins.blockchain:make_plugin',
'Chainparams = hashmal_lib.plugins.chainparams:make_plugin',
'Item Types = hashmal_lib.plugins.item_types:make_plugin',
'Log = hashmal_lib.plugins.log:make_plugin',
'Script Generator = hashmal_lib.plugins.script_gen:make_plugin',
'Stack Evaluator = hashmal_lib.plugins.stack:make_plugin',
'Transaction Analyzer = hashmal_lib.plugins.tx_analyzer:make_plugin',
'Transaction Builder = hashmal_lib.plugins.tx_builder:make_plugin',
'Variables = hashmal_lib.plugins.variables:make_plugin',
'Wallet RPC = hashmal_lib.plugins.wallet_rpc:make_plugin'
]
}
from entry_points import hashmal_entry_points


required_plugins = ['Chainparams', 'Item Types', 'Log', 'Stack Evaluator', 'Variables']
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
python-bitcoinlib
pyparsing
requests
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from setuptools import setup
from hashmal_lib.gui_utils import hashmal_entry_points
from hashmal_lib.entry_points import hashmal_entry_points

with open('requirements.txt') as f:
requirements = f.readlines()
Expand Down

0 comments on commit 88ac423

Please sign in to comment.