def _aus(auid_files): """Read each line of each file and make a list of lockss_daemon.AUs""" aus = list() for auid_file in auid_files: if auid_file == '-': f = sys.stdin else: f = open(auid_file) for auid in f.readlines(): aus.append(lockss_daemon.AU(auid)) return aus
def create(self): '''Parses the content description and creates an AU''' logging.info('Creating AU from "%s"' % self.description) try: self.action, AU_ID = self.description.split(':', 1) self.local_clients = local_clients[self.action][:] self.remote_clients = remote_clients[self.action][:] self.AU = simulated_AU_cache.get(AU_ID, lockss_daemon.AU(AU_ID)) except (ValueError, KeyError, lockss_daemon.LockssError), exception: logging.error(exception) logging.warn('Failed to create AU from "%s"' % self.description) self.state = Content.State.CREATION_FAILURE raise Leaving_Pipeline
def __slurp_articles(self): for aid, auid in self.__db.get_auids_for_session(self.__sid): retries = 0 while retries <= self.__options.daemon_ui_retries: try: lst = self.__ui.getListOfArticles(lockss_daemon.AU(auid)) break except URLError: retries = retries + 1 else: continue # Go on to the next AUID ###FIXME self.__db.make_many_articles(aid, lst) self.__db.or_session_flags(self.__sid, slurpdb.SESSIONS_FLAGS_ARTICLES)