Skip to content

Commit 1164295

Browse files
committed
Merge branch 'release/0.4.0'
2 parents 64411d0 + dc8440d commit 1164295

File tree

7 files changed

+45
-19
lines changed

7 files changed

+45
-19
lines changed

.changes/0.4.0.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"description": "Make Notify terminate on CTRL-C",
4+
"type": "patch"
5+
},
6+
{
7+
"description": "Ensure we can invert Order and FilledOrder too",
8+
"type": "minor"
9+
}
10+
]

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,3 @@ target/
6363
*.swp
6464
.ropeproject/
6565
*/.ropeproject/
66-
67-
.changes/next-release

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22
Note: version releases in the 0.x.y range may introduce breaking changes.
33

4+
## 0.4.0
5+
6+
- minor: Ensure we can invert Order and FilledOrder too
7+
- patch: Make Notify terminate on CTRL-C
8+
49
## 0.3.3
510

611
- patch: New docs

Makefile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,30 @@ docs:
4646
SPHINX_APIDOC_OPTIONS="members,undoc-members,show-inheritance,inherited-members" sphinx-apidoc -d 6 -e -f -o docs . *.py tests
4747
make -C docs clean html
4848

49+
docs_store:
50+
git add docs
51+
-git commit -m "Updating docs/"
52+
4953
authors:
5054
git shortlog -e -s -n > AUTHORS
5155

56+
authors_store:
57+
git add AUTHORS
58+
-git commit -m "Updating Authors"
59+
5260
semver: semver-release semver-updates
5361

5462
semver-release:
55-
semversioner release
63+
-semversioner release
5664

5765
semver-updates:
5866
semversioner changelog > CHANGELOG.md
5967
$(eval CURRENT_VERSION = $(shell semversioner current-version))
6068
sed -i "s/^__version__.*/__version__ = \"$(CURRENT_VERSION)\"/" setup.py
61-
git add .changes setup.py CHANGELOG.md
62-
git commit -m "semverioner release updates" --no-verify
63-
git flow release start $(CURRENT_VERSION)
69+
-git add .changes setup.py CHANGELOG.md
70+
-git commit -m "semverioner release updates" --no-verify
71+
-git flow release start $(CURRENT_VERSION)
6472
git flow release finish $(CURRENT_VERSION)
6573

66-
prerelease: test docs authors
67-
release: semver clean build check dist upload git
74+
prerelease: test docs docs_store authors authors_store
75+
release: prerelease semver clean build check dist upload git

bitshares/price.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __init__(self, *args, **kwargs):
120120
self["base"] = None
121121
self["price"] = None
122122
self["seller"] = None
123-
elif isinstance(args[0], dict) and "sell_price" in args[0]:
123+
elif len(args) == 1 and isinstance(args[0], dict) and "sell_price" in args[0]:
124124
""" Load from object 1.7.xxx
125125
"""
126126
# Take all the arguments with us
@@ -130,7 +130,8 @@ def __init__(self, *args, **kwargs):
130130
)
131131

132132
elif (
133-
isinstance(args[0], dict)
133+
len(args) == 1
134+
and isinstance(args[0], dict)
134135
and "min_to_receive" in args[0]
135136
and "amount_to_sell" in args[0]
136137
):
@@ -224,7 +225,13 @@ class FilledOrder(Price):
224225
that shows when the order has been filled!
225226
"""
226227

228+
def copy(self):
229+
return self.__class__(
230+
self.order, base=self["base"].copy(), quote=self["quote"].copy()
231+
)
232+
227233
def __init__(self, order, **kwargs):
234+
self.order = order
228235

229236
if isinstance(order, dict) and "price" in order:
230237
Price.__init__(

bitsharesapi/websocket.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# -*- coding: utf-8 -*-
22
import json
3+
import time
4+
import signal
35
import logging
4-
import ssl
56
import threading
6-
import time
7+
import websocket
78
import traceback
89

910
from itertools import cycle
10-
from threading import Thread
11-
12-
import websocket
13-
1411
from events import Events
15-
1612
from .exceptions import NumRetriesReached
1713

14+
# This restores the default Ctrl+C signal handler, which just kills the process
15+
signal.signal(signal.SIGINT, signal.SIG_DFL)
1816

1917
log = logging.getLogger(__name__)
2018
# logging.basicConfig(level=logging.DEBUG)
@@ -322,7 +320,7 @@ def run_forever(self, *args, **kwargs):
322320

323321
except KeyboardInterrupt:
324322
self.ws.keep_running = False
325-
raise
323+
return
326324

327325
except Exception as e:
328326
log.critical("{}\n\n{}".format(str(e), traceback.format_exc()))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
ascii = codecs.lookup("ascii")
1414
codecs.register(lambda name, enc=ascii: {True: enc}.get(name == "mbcs"))
1515

16-
__version__ = "0.3.3"
16+
__version__ = "0.4.0"
1717
URL = "https://github.com/bitshares/python-bitshares"
1818

1919
setup(

0 commit comments

Comments
 (0)