Пример #1
0
def get_lazy_initialized_regex(pattern, flags = []):

  from libtbx.object_oriented_patterns import lazy_initialization

  return lazy_initialization(
    calculation = lambda: get_regex( pattern = pattern, flags = flags ),
    )
Пример #2
0
    std = self._standardize( identifier = identifier )

    if std in self._currents or std in self._retracteds or std in self._replaced_by:
      return std

    data = PDB_ENTRY_STATUS.single( identifier = std )
    self._insert( code = std, data = data )
    return std


  def _insert(self, code, data):

    status = data[0][ "status_code" ]

    if status == "REL":
      self._currents.add( code )

    elif status == "OBS":
      successor = data[0][ "superceded_by" ][0]

      if successor is None:
        self._retracteds.add( code )

      else:
        self._replaced_by[ code ] = successor


from libtbx.object_oriented_patterns import lazy_initialization
redirection = lazy_initialization( func = Redirections )
Пример #3
0
def get_lazy_initialized_regex(pattern, flags=[]):

    from libtbx.object_oriented_patterns import lazy_initialization

    return lazy_initialization(func=get_regex, pattern=pattern, flags=flags)
Пример #4
0
  def __init__(self, calculation, method):

    from libtbx.object_oriented_patterns import lazy_initialization
    self.instance = lazy_initialization( func = calculation )
    self.method = method
Пример #5
0
def get_lazy_initialized_regex(pattern, flags=[]):

    from libtbx.object_oriented_patterns import lazy_initialization

    return lazy_initialization(
        calculation=lambda: get_regex(pattern=pattern, flags=flags), )
Пример #6
0
    def _check_and_fetch(self, identifier):

        std = self._standardize(identifier=identifier)

        if std in self._currents or std in self._retracteds or std in self._replaced_by:
            return std

        data = PDB_ENTRY_STATUS.single(identifier=std)
        self._insert(code=std, data=data)
        return std

    def _insert(self, code, data):

        status = data[0]["status_code"]

        if status == "REL":
            self._currents.add(code)

        elif status == "OBS":
            successor = data[0]["superceded_by"][0]

            if successor is None:
                self._retracteds.add(code)

            else:
                self._replaced_by[code] = successor


from libtbx.object_oriented_patterns import lazy_initialization
redirection = lazy_initialization(func=Redirections)
Пример #7
0
  def __init__(self, calculation, method):

    from libtbx.object_oriented_patterns import lazy_initialization
    self.instance = lazy_initialization( func = calculation )
    self.method = method
Пример #8
0
def get_lazy_initialized_regex(pattern, flags = []):

  from libtbx.object_oriented_patterns import lazy_initialization

  return lazy_initialization( func = get_regex, pattern = pattern, flags = flags )