Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Aug 27, 2019
2 parents 64411d0 + dc8440d commit 1164295
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 19 deletions.
10 changes: 10 additions & 0 deletions .changes/0.4.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"description": "Make Notify terminate on CTRL-C",
"type": "patch"
},
{
"description": "Ensure we can invert Order and FilledOrder too",
"type": "minor"
}
]
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,3 @@ target/
*.swp
.ropeproject/
*/.ropeproject/

.changes/next-release
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
Note: version releases in the 0.x.y range may introduce breaking changes.

## 0.4.0

- minor: Ensure we can invert Order and FilledOrder too
- patch: Make Notify terminate on CTRL-C

## 0.3.3

- patch: New docs
Expand Down
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,30 @@ docs:
SPHINX_APIDOC_OPTIONS="members,undoc-members,show-inheritance,inherited-members" sphinx-apidoc -d 6 -e -f -o docs . *.py tests
make -C docs clean html

docs_store:
git add docs
-git commit -m "Updating docs/"

authors:
git shortlog -e -s -n > AUTHORS

authors_store:
git add AUTHORS
-git commit -m "Updating Authors"

semver: semver-release semver-updates

semver-release:
semversioner release
-semversioner release

semver-updates:
semversioner changelog > CHANGELOG.md
$(eval CURRENT_VERSION = $(shell semversioner current-version))
sed -i "s/^__version__.*/__version__ = \"$(CURRENT_VERSION)\"/" setup.py
git add .changes setup.py CHANGELOG.md
git commit -m "semverioner release updates" --no-verify
git flow release start $(CURRENT_VERSION)
-git add .changes setup.py CHANGELOG.md
-git commit -m "semverioner release updates" --no-verify
-git flow release start $(CURRENT_VERSION)
git flow release finish $(CURRENT_VERSION)

prerelease: test docs authors
release: semver clean build check dist upload git
prerelease: test docs docs_store authors authors_store
release: prerelease semver clean build check dist upload git
11 changes: 9 additions & 2 deletions bitshares/price.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(self, *args, **kwargs):
self["base"] = None
self["price"] = None
self["seller"] = None
elif isinstance(args[0], dict) and "sell_price" in args[0]:
elif len(args) == 1 and isinstance(args[0], dict) and "sell_price" in args[0]:
""" Load from object 1.7.xxx
"""
# Take all the arguments with us
Expand All @@ -130,7 +130,8 @@ def __init__(self, *args, **kwargs):
)

elif (
isinstance(args[0], dict)
len(args) == 1
and isinstance(args[0], dict)
and "min_to_receive" in args[0]
and "amount_to_sell" in args[0]
):
Expand Down Expand Up @@ -224,7 +225,13 @@ class FilledOrder(Price):
that shows when the order has been filled!
"""

def copy(self):
return self.__class__(
self.order, base=self["base"].copy(), quote=self["quote"].copy()
)

def __init__(self, order, **kwargs):
self.order = order

if isinstance(order, dict) and "price" in order:
Price.__init__(
Expand Down
14 changes: 6 additions & 8 deletions bitsharesapi/websocket.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# -*- coding: utf-8 -*-
import json
import time
import signal
import logging
import ssl
import threading
import time
import websocket
import traceback

from itertools import cycle
from threading import Thread

import websocket

from events import Events

from .exceptions import NumRetriesReached

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

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

except KeyboardInterrupt:
self.ws.keep_running = False
raise
return

except Exception as e:
log.critical("{}\n\n{}".format(str(e), traceback.format_exc()))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ascii = codecs.lookup("ascii")
codecs.register(lambda name, enc=ascii: {True: enc}.get(name == "mbcs"))

__version__ = "0.3.3"
__version__ = "0.4.0"
URL = "https://github.com/bitshares/python-bitshares"

setup(
Expand Down

0 comments on commit 1164295

Please sign in to comment.