import console_logging as logging
    from rfassistant.settings import settings
    from rfassistant.items import RFGlobalVars, RFKeywordSource, RFVariable, RFKeyword
    from mixins import is_json_file, is_robot_or_txt_file, is_robot_format, insert_robot_var, is_robot_var
    from utils import Singleton, StaticDataReader, CachedData
    from get_text import get_text_under_cursor, select_item_and_do_action
else:
    from ..rfassistant import console_logging as logging
    from .settings import settings
    from .items import RFGlobalVars, RFKeywordSource, RFVariable, RFKeyword
    from .mixins import is_json_file, is_robot_language_file, is_robot_format, insert_robot_var, is_robot_var
    from .utils import Singleton, StaticDataReader, CachedData
    from .get_text import get_text_under_cursor, select_item_and_do_action

ALLOW_UNPROMPTED_GO_TO = True
logger = logging.getLogger(__name__)


class GoToItemThread(threading.Thread):
    def __init__(self, view, view_file, results, method, action):
        self.view = view
        self.view_file = view_file
        self.results = results
        self.method = method
        self.action = action
        threading.Thread.__init__(self)

    def run(self):
        sublime.set_timeout(
            lambda: self.method(self.view, self.results, self.action), 50)
Beispiel #2
0
import os
import sys
import subprocess
import json
import threading
from functools import partial
from collections import namedtuple

try:
    from Queue import Queue
    from console_logging import getLogger
except ImportError:
    from queue import Queue
    from .console_logging import getLogger

logger = getLogger(__name__)
CUR_DIR = os.path.dirname(os.path.abspath(__file__))

import sublime


def run_in_active_view(window_id, callback, response):
    for window in sublime.windows():
        if window.id() == window_id:
            callback(window.active_view(), response)
            break


class BaseThread(threading.Thread):

    def __init__(self, fd, window_id, waiting, lock):
    from rfassistant.settings import settings
    from rfassistant.items import RFGlobalVars, RFKeywordSource, RFVariable, RFKeyword
    from mixins import is_json_file, is_robot_or_txt_file, is_robot_format, insert_robot_var, is_robot_var
    from utils import Singleton, StaticDataReader, CachedData
    from get_text import get_text_under_cursor, select_item_and_do_action
else:
    from ..rfassistant import console_logging as logging
    from .settings import settings
    from .items import RFGlobalVars, RFKeywordSource, RFVariable, RFKeyword
    from .mixins import is_json_file, is_robot_or_txt_file, is_robot_format, insert_robot_var, is_robot_var
    from .utils import Singleton, StaticDataReader, CachedData
    from .get_text import get_text_under_cursor, select_item_and_do_action


ALLOW_UNPROMPTED_GO_TO = True
logger = logging.getLogger(__name__)


class GoToItemThread(threading.Thread):
    def __init__(self, view, view_file, results, method, action):
        self.view = view
        self.view_file = view_file
        self.results = results
        self.method = method
        self.action = action
        threading.Thread.__init__(self)

    def run(self):
        sublime.set_timeout(lambda: self.method(self.view, self.results, self.action), 50)