def read_tasks(session):
 skipped = 0
 for toppath in session.paths:
  session.ask_resume(toppath)
  user_toppath = toppath
  archive_task = None
  if ArchiveImportTask.is_archive(syspath(toppath)):
   if (not (session.config['move'] or session.config['copy'])):
    log.warn(u"Archive importing requires either 'copy' or 'move' to be enabled.")
    continue
   log.debug(u'extracting archive {0}'.format(displayable_path(toppath)))
   archive_task = ArchiveImportTask(toppath)
   try:
    archive_task.extract()
   except Exception as exc:
    log.error(u'extraction failed: {0}'.format(exc))
    continue
   toppath = archive_task.toppath
  task_factory = ImportTaskFactory(toppath, session)
  imported = False
  for t in task_factory.tasks():
   imported |= (not t.skip)
   (yield t)
  if (archive_task is None):
   (yield task_factory.sentinel())
  else:
   (yield archive_task)
  if (not imported):
   log.warn(u'No files imported from {0}'.format(displayable_path(user_toppath)))
 if skipped:
  log.info(u'Skipped {0} directories.'.format(skipped))

def read_tasks ( session ) : skipped = 0 for toppath in session . paths : session . ask_resume ( toppath ) user_toppath = toppath archive_task = None if ArchiveImportTask . is_archive ( syspath ( toppath ) ) : if ( not ( session . config [ 'move' ] or session . config [ 'copy' ] ) ) : log . warn ( u"Archive importing requires either 'copy' or 'move' to be enabled." ) continue log . debug ( u'extracting archive {0}' . format ( displayable_path ( toppath ) ) ) archive_task = ArchiveImportTask ( toppath ) try : archive_task . extract ( ) except Exception as exc : log . error ( u'extraction failed: {0}' . format ( exc ) ) continue toppath = archive_task . toppath task_factory = ImportTaskFactory ( toppath , session ) imported = False for t in task_factory . tasks ( ) : imported |= ( not t . skip ) ( yield t ) if ( archive_task is None ) : ( yield task_factory . sentinel ( ) ) else : ( yield archive_task ) if ( not imported ) : log . warn ( u'No files imported from {0}' . format ( displayable_path ( user_toppath ) ) ) if skipped : log . info ( u'Skipped {0} directories.' . format ( skipped ) )
a generator yielding all the albums found in the user-specified list of paths .