Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed requirements specification (PyQt4 and requests) and improved setup.py #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@ 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'
]
}
18 changes: 1 addition & 17 deletions hashmal_lib/gui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,27 +243,11 @@ 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']
"""These plugins are needed and cannot be disabled."""

default_plugins = ['Blockchain', 'Chainparams', 'Item Types', 'Log', 'Script Generator', 'Stack Evaluator',
'Transaction Analyzer', 'Transaction Builder', 'Variables', 'Wallet RPC']

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