Beispiel #1
0
def init(queue, **kw):
    '''
    A initialization function for anything requiring a first boot.
    '''
    socket_uri = kw.get('socket_uri', None)
    cache_path = kw.get('cache_path', None)

    # global socket
    # if socket_uri is not None:
    #     print 'Making loop socket'
    #     socket = make_socket(socket_uri)
    print 'Init main loop'
    basepath = os.path.abspath(os.path.dirname(__file__))
    set_global_root(cache_path)
    secondary_functions.init(socket_uri=socket_uri)
    start(queue, socket_uri=socket_uri)
def init(socket_uri="ws://127.0.0.1:8009"):
    '''
    A initialisztion function for anything requiring a first boot.
    '''
    global command
    global loop_data
    global queue
    # global socket
    # if socket_uri is not None:
    #     socket = make_socket(socket_uri)
    command = Command()
    basepath = os.path.abspath(os.path.dirname(__file__))
    cache_path = os.path.join(basepath, 'cache')
    set_global_root(cache_path)
    loop_data = dict(socket_uri=socket_uri, cache_path=cache_path)

    queue, procs = loop.init_thread(**loop_data)
Beispiel #3
0
def init(socket_uri=SOCKET_ADDRESS):
    '''
    A initialisztion function for anything requiring a first boot.
    '''
    print('init')
    global command
    global loop_data
    global queue
    # global socket
    # if socket_uri is not None:
    #     socket = make_socket(socket_uri)
    #command = Command()
    basepath = os.path.abspath(os.path.dirname(__file__))
    cache_path = os.path.join(basepath, '..', 'cache')
    cache_path = os.path.abspath(cache_path)
    set_global_root(cache_path)
    loop_data = dict(socket_uri=socket_uri, cache_path=cache_path)
    pc.init(socket_uri)
    cli.init(socket_uri)
    cli.ask_loop(assess_string)
Beispiel #4
0
"""
from v4 import dictionary
CACHE_PATH = "C:/Users/jay/Documents/projects/context-api/context/src/cache"
set_global_root(CACHE_PATH)
# Set global cache dir C:/Users/jay/Documents/projects/context-api/context/src/cache

from v4 import dictionary as D
D.get_word('apples')
"""
from PyDictionary import PyDictionary
from cache import get_cache, set_cache, set_global_root

dictionary = None

CACHE_PATH = "C:/Users/jay/Documents/projects/context-api/context/src/cache"

set_global_root(CACHE_PATH)


def make_dictionary():
    global dictionary
    dictionary = PyDictionary()
    return dictionary


def get_dictionary():
    global dictionary
    if dictionary is None:
        dictionary = make_dictionary()
    return dictionary
def _base_boot(socket_uri="ws://127.0.0.1:8009"):
    basepath = os.path.abspath(os.path.dirname(__file__))
    cache_path = os.path.join(basepath, 'cache')
    set_global_root(cache_path)