Merge branch 'master' into error-messages

# Conflicts:
#	lbrynet/dht/protocol.py
This commit is contained in:
Jack 2016-11-14 14:11:02 -05:00
commit 5ae3485411
12 changed files with 63 additions and 33 deletions

View file

@ -1,9 +1,19 @@
[bumpversion]
current_version = 0.7.5
current_version = 0.7.6rc0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>[a-z]+)(?P<candidate>\d+))?
serialize =
{major}.{minor}.{patch}{release}{candidate}
{major}.{minor}.{patch}
[bumpversion:file:lbrynet/__init__.py]
[bumpversion:file:packaging/ubuntu/lbry.desktop]
[bumpversion:part:release]
optional_value = production
values =
rc
production

View file

@ -27,7 +27,7 @@ cache:
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./packaging/travis/setup_osx.sh; fi
- mkdir -p lbrynet/resources/ui
- if [[ -z "$TRAVIS_TAG" ]]; then ./packaging/travis/setup_qa.sh; fi
- ./packaging/travis/setup_qa.sh
install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./packaging/travis/install_dependencies_and_run_tests.sh; fi

View file

@ -1,6 +1,6 @@
import logging
__version__ = "0.7.5"
__version__ = "0.7.6rc0"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())

View file

@ -370,22 +370,15 @@ class Wallet(object):
return d
def get_my_claim(self, name):
def _convert_units(claim):
amount = Decimal(claim['nEffectiveAmount'] / COIN)
claim['nEffectiveAmount'] = amount
return claim
def _get_claim_for_return(claim):
if not claim:
return False
d = self.get_claim(name, claim['claim_id'])
d.addCallback(_convert_units)
d.addCallback(lambda clm: self._format_claim_for_return(name, clm, claim['txid']))
return d
claim['value'] = json.loads(claim['value'])
return claim
def _get_my_unspent_claim(claims):
for claim in claims:
if claim['name'] == name and not claim['is spent'] and not claim.get('supported_claimid'):
if claim['name'] == name and not claim['is spent'] and not claim.get('supported_claimid', False):
return claim
return False

View file

@ -78,8 +78,10 @@ def obfuscate(plain):
def check_connection(server="www.lbry.io", port=80):
"""Attempts to open a socket to server:port and returns True if successful."""
try:
log.debug('Checking connection to %s:%s', server, port)
host = socket.gethostbyname(server)
s = socket.create_connection((host, port), 2)
log.debug('Connection successful')
return True
except Exception as ex:
log.info(

View file

@ -321,4 +321,8 @@ class KademliaProtocol(protocol.DatagramProtocol):
except Exception, e:
log.exception('Failed to cancel %s', self._callLaterList[key])
del self._callLaterList[key]
# not sure why this is needed, but taking this out sometimes causes
# exceptions.AttributeError: 'Port' object has no attribute 'socket'
# to happen on shutdown
reactor.iterate()

View file

@ -78,12 +78,14 @@ def start():
log.debug('Final Settings: %s', settings.__dict__)
try:
log.debug('Checking for an existing lbrynet daemon instance')
JSONRPCProxy.from_url(settings.API_CONNECTION_STRING).is_running()
log.info("lbrynet-daemon is already running")
if not args.logtoconsole:
print "lbrynet-daemon is already running"
return
except:
except Exception:
log.debug('No lbrynet instance found, continuing to start')
pass
log.info("Starting lbrynet-daemon from command line")

View file

@ -255,11 +255,11 @@ class BundledUIManager(object):
Returns True if there is a bundled UI, False otherwise
"""
if not self.bundle_is_available():
log.debug('No bundled UI is available')
return False
if self.is_active_already_bundled_ui():
return True
log.info('Using bundled UI')
if not self.is_active_already_bundled_ui():
replace_dir(self.active_dir, self.bundled_ui_path)
log.info('Loading the bundled UI')
load_ui(self.root, self.active_dir)
return True

View file

@ -3,6 +3,7 @@ import hmac
import hashlib
import yaml
import os
import json
import logging
log = logging.getLogger(__name__)
@ -88,6 +89,4 @@ def initialize_api_key_file(key_path):
def get_auth_message(message_dict):
to_auth = message_dict.get('method').encode('hex')
to_auth += str(message_dict.get('id')).encode('hex')
return to_auth.decode('hex')
return json.dumps(message_dict, sort_keys=True)

View file

@ -6,10 +6,19 @@
set -euo pipefail
set -o xtrace
# changes to this script also need to be added to build.ps1 for windows
add_ui() {
wget https://s3.amazonaws.com/lbry-ui/development/dist.zip -O dist.zip
unzip -oq dist.zip -d lbrynet/resources/ui
wget https://s3.amazonaws.com/lbry-ui/development/data.json -O lbrynet/resources/ui/data.json
}
# changes here also need to be added to build.ps1 for windows
python packaging/append_sha_to_version.py lbrynet/__init__.py ${TRAVIS_COMMIT}
IS_RC_REGEX="v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+-rc[[:digit:]]+"
wget https://s3.amazonaws.com/lbry-ui/development/dist.zip -O dist.zip
unzip -oq dist.zip -d lbrynet/resources/ui
wget https://s3.amazonaws.com/lbry-ui/development/data.json -O lbrynet/resources/ui/data.json
if [[ -z "$TRAVIS_TAG" ]]; then
python packaging/append_sha_to_version.py lbrynet/__init__.py "${TRAVIS_COMMIT}"
add_ui
elif [[ "$TRAVIS_TAG" =~ $IS_RC_REGEX ]]; then
# If the tag looks like v0.7.6-rc0 then this is a tagged release candidate.
add_ui
fi

View file

@ -1,5 +1,5 @@
[Desktop Entry]
Version=0.7.5
Version=0.7.6rc0
Name=LBRY
Comment=The world's first user-owned content marketplace
Icon=lbry

View file

@ -1,13 +1,24 @@
# this is a port of setup_qa.sh used for the unix platforms
function AddUi {
wget https://s3.amazonaws.com/lbry-ui/development/dist.zip -OutFile dist.zip
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Expand-Archive dist.zip -dest lbrynet\resources\ui
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
wget https://s3.amazonaws.com/lbry-ui/development/data.json -OutFile lbrynet\resources\ui\data.json
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
}
If (${Env:APPVEYOR_REPO_TAG} -NotMatch "true") {
C:\Python27\python.exe packaging\append_sha_to_version.py lbrynet\__init__.py ${Env:APPVEYOR_REPO_COMMIT}
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
wget https://s3.amazonaws.com/lbry-ui/development/dist.zip -OutFile dist.zip
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Expand-Archive dist.zip -dest lbrynet\resources\ui
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
wget https://s3.amazonaws.com/lbry-ui/development/data.json -OutFile lbrynet\resources\ui\data.json
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
AddUi
}
ElseIf (${Env:APPVEYOR_REPO_TAG_NAME} -Match "v\d+\.\d+\.\d+-rc\d+") {
AddUi
}
C:\Python27\python.exe setup.py build bdist_msi