from sys import argv from threading import Thread, Lock, Event, Condition import lib from lib import script, scriptLines import data from data import PathList from find_compatible_dts import FindCompatibleDTS verbose = False dts_comp_support = int(script('dts-comp')) compatibles_parser = FindCompatibleDTS() db = data.DB(lib.getDataDir(), readonly=False, dtscomp=dts_comp_support) # Number of cpu threads (+2 for version indexing) cpu = 10 threads_list = [] hash_file_lock = Lock() # Lock for db.hash and db.file blobs_lock = Lock() # Lock for db.blobs defs_lock = Lock() # Lock for db.defs refs_lock = Lock() # Lock for db.refs docs_lock = Lock() # Lock for db.docs comps_lock = Lock() # Lock for db.comps comps_docs_lock = Lock() # Lock for db.comps_docs tag_ready = Condition() # Waiting for new tags new_idxes = [
# along with Elixir. If not, see <http://www.gnu.org/licenses/>. # Throughout, an "idx" is the sequential number associated with a blob. # This is different from that blob's Git hash. from sys import argv from lib import scriptLines import lib import data import os from data import PathList from threading import Thread, Lock, Event, Condition verbose = False db = data.DB(lib.getDataDir(), readonly=False) hash_file_lock = Lock() #Lock for db.hash and db.file defs_lock = Lock() #Lock for db.defs tag_ready = Condition() #Waiting for new tags new_idxes = [] # (new idxes, Event idxes ready, Event defs ready) tags_done = False #True if all tags have been added to new_idxes class UpdateIdVersion(Thread): def __init__(self, tag_buf): Thread.__init__(self, name="UpdateIdVersionElixir") self.tag_buf = tag_buf
# # Elixir is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Elixir. If not, see <http://www.gnu.org/licenses/>. from lib import script, scriptLines import lib import data import os from collections import OrderedDict db = data.DB(lib.getDataDir(), readonly=True) from io import BytesIO class SymbolInstance(object): def __init__(self, path, line, type=None): self.path = path self.line = line self.type = type def __repr__(self): type_repr = "" if self.type: type_repr = f" , type: {self.type}"