def __init__( self, name, path, assumed_doc_version=None, git_ssh=None, pkey=None, git_action_class=PhylesystemGitAction, push_mirror_repo_path=None, new_doc_prefix=None, # IGNORED in this shard type infrastructure_commit_author='OpenTree API <*****@*****.**>', **kwargs): self.max_file_size = get_config_setting('phylesystem', 'max_file_size') TypeAwareGitShard.__init__( self, name, path, doc_holder_subpath, assumed_doc_version, None, # version detection refresh_amendment_index, # populates _doc_index git_ssh, pkey, git_action_class, push_mirror_repo_path, infrastructure_commit_author, **kwargs) self.filepath_for_doc_id_fn = filepath_for_amendment_id self._doc_counter_lock = Lock() self._next_ott_id = None self._id_minting_file = os.path.join(path, 'next_ott_id.json') # N.B. This is for minting invididual taxon (OTT) ids, not amendment ids! # We construct each amendment from its unique series of ottids. self.filepath_for_global_resource_fn = lambda frag: os.path.join( path, frag)
def __init__(self, name, path, assumed_doc_version=None, git_ssh=None, pkey=None, git_action_class=PhylesystemGitAction, push_mirror_repo_path=None, new_doc_prefix=None, # IGNORED in this shard type infrastructure_commit_author='OpenTree API <*****@*****.**>', **kwargs): self.max_file_size = get_config_setting('phylesystem', 'max_file_size') TypeAwareGitShard.__init__(self, name, path, doc_holder_subpath, assumed_doc_version, None, # version detection refresh_amendment_index, # populates _doc_index git_ssh, pkey, git_action_class, push_mirror_repo_path, infrastructure_commit_author, **kwargs) self.filepath_for_doc_id_fn = filepath_for_amendment_id self._doc_counter_lock = Lock() self._next_ott_id = None self._id_minting_file = os.path.join(path, 'next_ott_id.json') # N.B. This is for minting invididual taxon (OTT) ids, not amendment ids! # We construct each amendment from its unique series of ottids. self.filepath_for_global_resource_fn = lambda frag: os.path.join(path, frag)
def __init__(self, name, path, assumed_doc_version=None, git_ssh=None, pkey=None, git_action_class=PhylesystemGitAction, push_mirror_repo_path=None, new_doc_prefix=None, # IGNORED in this shard type infrastructure_commit_author='OpenTree API <*****@*****.**>', **kwargs): self.max_file_size = get_config_setting('phylesystem', 'max_file_size') TypeAwareGitShard.__init__(self, name, path, doc_holder_subpath, assumed_doc_version, None, # version detection refresh_collection_index, # populates _doc_index git_ssh, pkey, git_action_class, push_mirror_repo_path, infrastructure_commit_author, **kwargs) self.filepath_for_doc_id_fn = filepath_for_collection_id self._doc_counter_lock = Lock() self.filepath_for_global_resource_fn = lambda frag: os.path.join(path, frag)
def __init__( self, name, path, assumed_doc_version=None, git_ssh=None, pkey=None, git_action_class=PhylesystemGitAction, push_mirror_repo_path=None, new_doc_prefix=None, # IGNORED in this shard type infrastructure_commit_author='OpenTree API <*****@*****.**>', **kwargs): self.max_file_size = get_config_setting('phylesystem', 'max_file_size') TypeAwareGitShard.__init__( self, name, path, doc_holder_subpath, assumed_doc_version, None, # version detection refresh_collection_index, # populates _doc_index git_ssh, pkey, git_action_class, push_mirror_repo_path, infrastructure_commit_author, **kwargs) self.filepath_for_doc_id_fn = filepath_for_collection_id self._doc_counter_lock = Lock() self.filepath_for_global_resource_fn = lambda frag: os.path.join( path, frag)
def __init__( self, name, path, assumed_doc_version=None, git_ssh=None, pkey=None, git_action_class=PhylesystemGitAction, push_mirror_repo_path=None, new_study_prefix=None, infrastructure_commit_author='OpenTree API <*****@*****.**>', **kwargs): self.max_file_size = get_config_setting('phylesystem', 'max_file_size') TypeAwareGitShard.__init__( self, name, path, doc_holder_subpath, assumed_doc_version, diagnose_repo_nexml2json, # version detection refresh_study_index, # populates 'study_index' git_ssh, pkey, git_action_class, push_mirror_repo_path, infrastructure_commit_author, **kwargs) self._doc_counter_lock = Lock() self._next_study_id = None self._new_study_prefix = new_study_prefix if self._new_study_prefix is None: prefix_file = os.path.join(path, 'new_study_prefix') if os.path.exists(prefix_file): with open(prefix_file, 'r') as f: pre_content = f.read().strip() valid_pat = re.compile('^[a-zA-Z0-9]+_$') if len(pre_content) != 3 or not valid_pat.match(pre_content): raise FailedShardCreationError( 'Expecting prefix in new_study_prefix file to be two ' 'letters followed by an underscore') self._new_study_prefix = pre_content else: self._new_study_prefix = 'ot_' # ot_ is the default if there is no file self._id_minting_file = os.path.join(path, 'next_study_id.json') self.filepath_for_global_resource_fn = lambda frag: os.path.join( path, frag)
def __init__(self, name, path, assumed_doc_version=None, git_ssh=None, pkey=None, git_action_class=PhylesystemGitAction, push_mirror_repo_path=None, new_study_prefix=None, infrastructure_commit_author='OpenTree API <*****@*****.**>', **kwargs): self.max_file_size = get_config_setting('phylesystem', 'max_file_size') TypeAwareGitShard.__init__(self, name, path, doc_holder_subpath, assumed_doc_version, diagnose_repo_nexml2json, # version detection refresh_study_index, # populates 'study_index' git_ssh, pkey, git_action_class, push_mirror_repo_path, infrastructure_commit_author, **kwargs) self._doc_counter_lock = Lock() self._next_study_id = None self._new_study_prefix = new_study_prefix if self._new_study_prefix is None: prefix_file = os.path.join(path, 'new_study_prefix') if os.path.exists(prefix_file): with open(prefix_file, 'r') as f: pre_content = f.read().strip() valid_pat = re.compile('^[a-zA-Z0-9]+_$') if len(pre_content) != 3 or not valid_pat.match(pre_content): raise FailedShardCreationError('Expecting prefix in new_study_prefix file to be two ' 'letters followed by an underscore') self._new_study_prefix = pre_content else: self._new_study_prefix = 'ot_' # ot_ is the default if there is no file self._id_minting_file = os.path.join(path, 'next_study_id.json') self.filepath_for_global_resource_fn = lambda frag: os.path.join(path, frag)