def init_library(self, owner, repo, create=True): self.owner = owner.lower() self.repo = repo.lower() if create: self.library = Library.get_or_insert(Library.id(owner, repo)) self.is_new = self.library.metadata is None and self.library.error is None else: self.library = Library.get_by_id(Library.id(owner, repo)) if self.library.status == Status.suppressed: raise RequestAborted('library is suppressed')
def init_library(self, owner, repo, create=True): self.owner = owner.lower() self.repo = repo.lower() if create: self.library = Library.get_or_insert(Library.id(owner, repo)) self.is_new = self.library.metadata is None and self.library.error is None else: self.library = Library.get_by_id(Library.id(owner, repo)) if self.library.status == Status.suppressed: raise RequestAborted('library is suppressed')
def init_library(self, scope, package, create=True): self.scope = scope.lower() self.package = package.lower() if create: self.library = Library.get_or_insert(Library.id(self.scope, self.package)) self.is_new = self.library.metadata is None and self.library.error is None else: self.library = Library.get_by_id(Library.id(self.scope, self.package)) if self.library.status == Status.suppressed: raise RequestAborted('library is suppressed')
def init_library(self, scope, package, create=True): self.scope = scope.lower() self.package = package.lower() if create: self.library = Library.get_or_insert(Library.id(self.scope, self.package)) self.is_new = self.library.metadata is None and self.library.error is None else: self.library = Library.get_by_id(Library.id(self.scope, self.package)) if self.library.status == Status.suppressed: raise RequestAborted('library is suppressed')