Consistently use lbryid over lbry_id variable name

This commit is contained in:
Job Evers-Meltzer 2016-12-21 10:34:09 -08:00
parent 47f71fd363
commit 26bc6d05a0
2 changed files with 11 additions and 11 deletions

View file

@ -17,9 +17,9 @@ def get_sd_hash(stream_info):
class Events(object): class Events(object):
def __init__(self, context, lbry_id, session_id): def __init__(self, context, lbryid, session_id):
self.context = context self.context = context
self.lbry_id = lbry_id self.lbryid = lbryid
self.session_id = session_id self.session_id = session_id
def update_context(self, context): def update_context(self, context):
@ -71,7 +71,7 @@ class Events(object):
def _properties(self, event_properties=None): def _properties(self, event_properties=None):
event_properties = event_properties or {} event_properties = event_properties or {}
properties = { properties = {
'lbry_id': self.lbry_id, 'lbry_id': self.lbryid,
'session_id': self.session_id, 'session_id': self.session_id,
} }
properties.update(event_properties) properties.update(event_properties)

View file

@ -361,20 +361,20 @@ class Daemon(AuthJSONRPCServer):
def _load_caches(self): def _load_caches(self):
name_cache_filename = os.path.join(self.db_dir, "stream_info_cache.json") name_cache_filename = os.path.join(self.db_dir, "stream_info_cache.json")
lbry_id_filename = os.path.join(self.db_dir, "lbry_id") lbryid_filename = os.path.join(self.db_dir, "lbryid")
if os.path.isfile(name_cache_filename): if os.path.isfile(name_cache_filename):
with open(name_cache_filename, "r") as name_cache: with open(name_cache_filename, "r") as name_cache:
self.name_cache = json.loads(name_cache.read()) self.name_cache = json.loads(name_cache.read())
log.info("Loaded claim info cache") log.info("Loaded claim info cache")
if os.path.isfile(lbry_id_filename): if os.path.isfile(lbryid_filename):
with open(lbry_id_filename, "r") as lbry_id_file: with open(lbryid_filename, "r") as lbryid_file:
self.lbryid = base58.b58decode(lbry_id_file.read()) self.lbryid = base58.b58decode(lbryid_file.read())
else: else:
with open(lbry_id_filename, "w") as lbry_id_file: with open(lbryid_filename, "w") as lbryid_file:
self.lbryid = utils.generate_id() self.lbryid = utils.generate_id()
lbry_id_file.write(base58.b58encode(self.lbryid)) lbryid_file.write(base58.b58encode(self.lbryid))
def _set_events(self): def _set_events(self):
context = analytics.make_context(self._get_platform(), self.wallet_type) context = analytics.make_context(self._get_platform(), self.wallet_type)
@ -543,9 +543,9 @@ class Daemon(AuthJSONRPCServer):
def _upload_log(self, log_type=None, exclude_previous=False, force=False): def _upload_log(self, log_type=None, exclude_previous=False, force=False):
if self.upload_log or force: if self.upload_log or force:
lbry_id = base58.b58encode(self.lbryid)[:SHORT_ID_LEN] lbryid = base58.b58encode(self.lbryid)[:SHORT_ID_LEN]
try: try:
self.log_uploader.upload(exclude_previous, lbry_id, log_type) self.log_uploader.upload(exclude_previous, lbryid, log_type)
except requests.RequestException: except requests.RequestException:
log.warning('Failed to upload log file') log.warning('Failed to upload log file')
return defer.succeed(None) return defer.succeed(None)