Пример #1
0
 def __init__(self):
     Worker.__init__(self)
     self.translationUnits = TranslationUnitCache.LockedVariable({})
     self.parsingList = TranslationUnitCache.LockedVariable([])
     self.busyList = TranslationUnitCache.LockedVariable([])
     self.index_parse_options = 13
     self.index = None
Пример #2
0
    def __init__(self):
        super(F, self).__init__()
        self.worker = Worker()
        self.mutex = QMutex()
        self.worker.run()

        def tree():
            return defaultdict(tree)

        rootnode = tree()
        rootpath = ROOT
        for basepath, dirnames, filenames in os.walk(rootpath):
            relpath = os.path.relpath(basepath, rootpath)
            parent = rootnode
            if relpath != '.':
                for name in relpath.split(os.sep):
                    parent = parent[name]
            #for name in dirnames >> sm.append(filenames):
            for name in dirnames:
                parent[name]

        self.tree = TreeQuery(tree=rootnode,
                              query='',
                              insertion_cost=1,
                              deletion_cost=100,
                              substitution_cost=100,
                              transposition_cost=10)

        print(len(self.tree.nodes))
Пример #3
0
 def __init__(self):
     Worker.__init__(self)
     self.translationUnits = TranslationUnitCache.LockedVariable({})
     self.parsingList = TranslationUnitCache.LockedVariable([])
     self.busyList = TranslationUnitCache.LockedVariable([])
     self.index_parse_options = 13
     self.index = None
Пример #4
0
Файл: f.py Проект: Answeror/lit
class F(LitPlugin):

    def __init__(self):
        super(F, self).__init__()
        self.worker = Worker()
        self.mutex = QMutex()
        self.worker.run()

        def tree():
            return defaultdict(tree)

        rootnode = tree()
        rootpath = ROOT
        for basepath, dirnames, filenames in os.walk(rootpath):
            relpath = os.path.relpath(basepath, rootpath)
            parent = rootnode
            if relpath != '.':
                for name in relpath.split(os.sep):
                    parent = parent[name]
            #for name in dirnames >> sm.append(filenames):
            for name in dirnames:
                parent[name]

        self.tree = TreeQuery(
            tree=rootnode,
            query='',
            insertion_cost=1,
            deletion_cost=100,
            substitution_cost=100,
            transposition_cost=10
        )

        print(len(self.tree.nodes))

    @property
    def name(self):
        return 'f'

    @property
    def paths(self):
        assert False, 'Not implemented.'

    def lit(self, query, upper_bound, *args, **kargs):
        return Job(self, query, upper_bound)

    def select(self, content, index):
        # check content type
        if not isinstance(content, RunnableModel):
            logging.info('wrong content type {}'.format(type(content)))
            return

        name = content.data(index, RunnableModel.NAME_ROLE)
        try:
            win32api.ShellExecute(0, 'open', name, '', '', 1)
        except Exception as e:
            logging.error(e)
Пример #5
0
class F(LitPlugin):
    def __init__(self):
        super(F, self).__init__()
        self.worker = Worker()
        self.mutex = QMutex()
        self.worker.run()

        def tree():
            return defaultdict(tree)

        rootnode = tree()
        rootpath = ROOT
        for basepath, dirnames, filenames in os.walk(rootpath):
            relpath = os.path.relpath(basepath, rootpath)
            parent = rootnode
            if relpath != '.':
                for name in relpath.split(os.sep):
                    parent = parent[name]
            #for name in dirnames >> sm.append(filenames):
            for name in dirnames:
                parent[name]

        self.tree = TreeQuery(tree=rootnode,
                              query='',
                              insertion_cost=1,
                              deletion_cost=100,
                              substitution_cost=100,
                              transposition_cost=10)

        print(len(self.tree.nodes))

    @property
    def name(self):
        return 'f'

    @property
    def paths(self):
        assert False, 'Not implemented.'

    def lit(self, query, upper_bound, *args, **kargs):
        return Job(self, query, upper_bound)

    def select(self, content, index):
        # check content type
        if not isinstance(content, RunnableModel):
            logging.info('wrong content type {}'.format(type(content)))
            return

        name = content.data(index, RunnableModel.NAME_ROLE)
        try:
            win32api.ShellExecute(0, 'open', name, '', '', 1)
        except Exception as e:
            logging.error(e)
Пример #6
0
Файл: f.py Проект: Answeror/lit
    def __init__(self):
        super(F, self).__init__()
        self.worker = Worker()
        self.mutex = QMutex()
        self.worker.run()

        def tree():
            return defaultdict(tree)

        rootnode = tree()
        rootpath = ROOT
        for basepath, dirnames, filenames in os.walk(rootpath):
            relpath = os.path.relpath(basepath, rootpath)
            parent = rootnode
            if relpath != '.':
                for name in relpath.split(os.sep):
                    parent = parent[name]
            #for name in dirnames >> sm.append(filenames):
            for name in dirnames:
                parent[name]

        self.tree = TreeQuery(
            tree=rootnode,
            query='',
            insertion_cost=1,
            deletion_cost=100,
            substitution_cost=100,
            transposition_cost=10
        )

        print(len(self.tree.nodes))