# Path: lacli/log.py
# def getLogger(logger='lacli'):
#     return lacore.log.getLogger(logger)


import os
from urlparse import urlparse
from netrc import netrc
from lacli.log import getLogger
from lacore.decorators import cached_property



API_URL = 'https://www.longaccess.com/api/v1/'


class LaRegistry(object):
    cache = None
    prefs = None
    session = None

    def __init__(self, cache, prefs, cmd):
        if prefs['api'].get('url') is None:
            prefs['api']['url'] = API_URL
        self.cache = cache
        self.prefs = prefs
        self.cmd = cmd
        self.session = self.new_session()

    def init_prefs(self):
        prefs = self.prefs['api']
        if prefs.get('url') is None:
            prefs['url'] = API_URL
        if not prefs['user']:
            prefs['user'] = self._saved_session[0]
            prefs['pass'] = self._saved_session[1]

# Path: lacli/log.py
# def getLogger(logger='lacli'):
#     return lacore.log.getLogger(logger)


# Path: lacli/registry.py
import os
from urlparse import urlparse
from netrc import netrc
from lacli.log import getLogger
from lacore.decorators import cached_property




API_URL = 'https://www.longaccess.com/api/v1/'


class LaRegistry(object):
    cache = None
    prefs = None
    session = None

    def __init__(self, cache, prefs, cmd):
        if prefs['api'].get('url') is None:
            prefs['api']['url'] = API_URL
        self.cache = cache
        self.prefs = prefs
        self.cmd = cmd
        self.session = self.new_session()

    def init_prefs(self):
        prefs = self.prefs['api']
        if prefs.get('url') is None:
            prefs['url'] = API_URL
        if not prefs['user']:
            prefs['user'] = self._saved_session[0]
            prefs['pass'] = self._saved_session[1]

        return prefs