forked from LBRYCommunity/lbry-sdk
Merge branch 'master' into error-messages
# Conflicts: # lbrynet/dht/protocol.py
This commit is contained in:
commit
5ae3485411
12 changed files with 63 additions and 33 deletions
|
@ -1,9 +1,19 @@
|
||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 0.7.5
|
current_version = 0.7.6rc0
|
||||||
commit = True
|
commit = True
|
||||||
tag = 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:lbrynet/__init__.py]
|
||||||
|
|
||||||
[bumpversion:file:packaging/ubuntu/lbry.desktop]
|
[bumpversion:file:packaging/ubuntu/lbry.desktop]
|
||||||
|
|
||||||
|
[bumpversion:part:release]
|
||||||
|
optional_value = production
|
||||||
|
values =
|
||||||
|
rc
|
||||||
|
production
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ cache:
|
||||||
before_install:
|
before_install:
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./packaging/travis/setup_osx.sh; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./packaging/travis/setup_osx.sh; fi
|
||||||
- mkdir -p lbrynet/resources/ui
|
- mkdir -p lbrynet/resources/ui
|
||||||
- if [[ -z "$TRAVIS_TAG" ]]; then ./packaging/travis/setup_qa.sh; fi
|
- ./packaging/travis/setup_qa.sh
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./packaging/travis/install_dependencies_and_run_tests.sh; fi
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./packaging/travis/install_dependencies_and_run_tests.sh; fi
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
__version__ = "0.7.5"
|
__version__ = "0.7.6rc0"
|
||||||
version = tuple(__version__.split('.'))
|
version = tuple(__version__.split('.'))
|
||||||
|
|
||||||
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
||||||
|
|
|
@ -370,22 +370,15 @@ class Wallet(object):
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def get_my_claim(self, name):
|
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):
|
def _get_claim_for_return(claim):
|
||||||
if not claim:
|
if not claim:
|
||||||
return False
|
return False
|
||||||
d = self.get_claim(name, claim['claim_id'])
|
claim['value'] = json.loads(claim['value'])
|
||||||
d.addCallback(_convert_units)
|
return claim
|
||||||
d.addCallback(lambda clm: self._format_claim_for_return(name, clm, claim['txid']))
|
|
||||||
return d
|
|
||||||
|
|
||||||
def _get_my_unspent_claim(claims):
|
def _get_my_unspent_claim(claims):
|
||||||
for claim in 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 claim
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -78,8 +78,10 @@ def obfuscate(plain):
|
||||||
def check_connection(server="www.lbry.io", port=80):
|
def check_connection(server="www.lbry.io", port=80):
|
||||||
"""Attempts to open a socket to server:port and returns True if successful."""
|
"""Attempts to open a socket to server:port and returns True if successful."""
|
||||||
try:
|
try:
|
||||||
|
log.debug('Checking connection to %s:%s', server, port)
|
||||||
host = socket.gethostbyname(server)
|
host = socket.gethostbyname(server)
|
||||||
s = socket.create_connection((host, port), 2)
|
s = socket.create_connection((host, port), 2)
|
||||||
|
log.debug('Connection successful')
|
||||||
return True
|
return True
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
log.info(
|
log.info(
|
||||||
|
|
|
@ -321,4 +321,8 @@ class KademliaProtocol(protocol.DatagramProtocol):
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
log.exception('Failed to cancel %s', self._callLaterList[key])
|
log.exception('Failed to cancel %s', self._callLaterList[key])
|
||||||
del 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()
|
reactor.iterate()
|
||||||
|
|
|
@ -78,12 +78,14 @@ def start():
|
||||||
log.debug('Final Settings: %s', settings.__dict__)
|
log.debug('Final Settings: %s', settings.__dict__)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
log.debug('Checking for an existing lbrynet daemon instance')
|
||||||
JSONRPCProxy.from_url(settings.API_CONNECTION_STRING).is_running()
|
JSONRPCProxy.from_url(settings.API_CONNECTION_STRING).is_running()
|
||||||
log.info("lbrynet-daemon is already running")
|
log.info("lbrynet-daemon is already running")
|
||||||
if not args.logtoconsole:
|
if not args.logtoconsole:
|
||||||
print "lbrynet-daemon is already running"
|
print "lbrynet-daemon is already running"
|
||||||
return
|
return
|
||||||
except:
|
except Exception:
|
||||||
|
log.debug('No lbrynet instance found, continuing to start')
|
||||||
pass
|
pass
|
||||||
|
|
||||||
log.info("Starting lbrynet-daemon from command line")
|
log.info("Starting lbrynet-daemon from command line")
|
||||||
|
|
|
@ -255,11 +255,11 @@ class BundledUIManager(object):
|
||||||
Returns True if there is a bundled UI, False otherwise
|
Returns True if there is a bundled UI, False otherwise
|
||||||
"""
|
"""
|
||||||
if not self.bundle_is_available():
|
if not self.bundle_is_available():
|
||||||
|
log.debug('No bundled UI is available')
|
||||||
return False
|
return False
|
||||||
if self.is_active_already_bundled_ui():
|
if not self.is_active_already_bundled_ui():
|
||||||
return True
|
|
||||||
log.info('Using bundled UI')
|
|
||||||
replace_dir(self.active_dir, self.bundled_ui_path)
|
replace_dir(self.active_dir, self.bundled_ui_path)
|
||||||
|
log.info('Loading the bundled UI')
|
||||||
load_ui(self.root, self.active_dir)
|
load_ui(self.root, self.active_dir)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import hmac
|
||||||
import hashlib
|
import hashlib
|
||||||
import yaml
|
import yaml
|
||||||
import os
|
import os
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -88,6 +89,4 @@ def initialize_api_key_file(key_path):
|
||||||
|
|
||||||
|
|
||||||
def get_auth_message(message_dict):
|
def get_auth_message(message_dict):
|
||||||
to_auth = message_dict.get('method').encode('hex')
|
return json.dumps(message_dict, sort_keys=True)
|
||||||
to_auth += str(message_dict.get('id')).encode('hex')
|
|
||||||
return to_auth.decode('hex')
|
|
|
@ -6,10 +6,19 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
|
||||||
|
# changes to this script also need to be added to build.ps1 for windows
|
||||||
# changes here also need to be added to build.ps1 for windows
|
add_ui() {
|
||||||
python packaging/append_sha_to_version.py lbrynet/__init__.py ${TRAVIS_COMMIT}
|
|
||||||
|
|
||||||
wget https://s3.amazonaws.com/lbry-ui/development/dist.zip -O dist.zip
|
wget https://s3.amazonaws.com/lbry-ui/development/dist.zip -O dist.zip
|
||||||
unzip -oq dist.zip -d lbrynet/resources/ui
|
unzip -oq dist.zip -d lbrynet/resources/ui
|
||||||
wget https://s3.amazonaws.com/lbry-ui/development/data.json -O lbrynet/resources/ui/data.json
|
wget https://s3.amazonaws.com/lbry-ui/development/data.json -O lbrynet/resources/ui/data.json
|
||||||
|
}
|
||||||
|
|
||||||
|
IS_RC_REGEX="v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+-rc[[:digit:]]+"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Version=0.7.5
|
Version=0.7.6rc0
|
||||||
Name=LBRY
|
Name=LBRY
|
||||||
Comment=The world's first user-owned content marketplace
|
Comment=The world's first user-owned content marketplace
|
||||||
Icon=lbry
|
Icon=lbry
|
||||||
|
|
|
@ -1,13 +1,24 @@
|
||||||
# this is a port of setup_qa.sh used for the unix platforms
|
# 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") {
|
If (${Env:APPVEYOR_REPO_TAG} -NotMatch "true") {
|
||||||
C:\Python27\python.exe packaging\append_sha_to_version.py lbrynet\__init__.py ${Env:APPVEYOR_REPO_COMMIT}
|
C:\Python27\python.exe packaging\append_sha_to_version.py lbrynet\__init__.py ${Env:APPVEYOR_REPO_COMMIT}
|
||||||
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
|
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) }
|
AddUi
|
||||||
Expand-Archive dist.zip -dest lbrynet\resources\ui
|
}
|
||||||
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
|
ElseIf (${Env:APPVEYOR_REPO_TAG_NAME} -Match "v\d+\.\d+\.\d+-rc\d+") {
|
||||||
wget https://s3.amazonaws.com/lbry-ui/development/data.json -OutFile lbrynet\resources\ui\data.json
|
AddUi
|
||||||
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
C:\Python27\python.exe setup.py build bdist_msi
|
C:\Python27\python.exe setup.py build bdist_msi
|
||||||
|
|
Loading…
Reference in a new issue