コード例 #1
0
def main():      
  arg_helper = CmdArgumentsHelper();
  arg_helper.add_argument('query', 'q', 'query', 1);
  arg_helper.add_argument('root_dir', 'r', 'root', 1);
  arg_helper.add_argument('division_id', 'd', 'division', 1);
  args = arg_helper.read_arguments();
  print (args);

  query_string = args['query'];
  division_id = int(args['division_id']);
  
  dbHelper = DBHelper();
  dbHelper.init(args['root_dir']);
  dbHelper.gen_config_file(query_string);
  configFileName = dbHelper.get_config_filepath(query_string);
  dbHelper.genPCDBFile(query_string);
  pcdbFileName = dbHelper.getPCDBPath(query_string);
  outputDir = dbHelper.rawdataDir;
  downloadQuery(query_string, configFileName, pcdbFileName, outputDir, division_id);
コード例 #2
0
ファイル: task_download_meta.py プロジェクト: Asperado/iconic
def main():      
  arg_helper = CmdArgumentsHelper();
  arg_helper.add_argument('query', 'q', 'query', 1);
  arg_helper.add_argument('root_dir', 'r', 'root', 1);
  args = arg_helper.read_arguments();
  print (args);
  
  # Load keyword for querying Flickr.
  query_string = args['query'];
  
  dbHelper = DBHelper();
  dbHelper.init(args['root_dir'])
  dbHelper.gen_config_file(query_string)
  configFileName = dbHelper.get_config_filepath(query_string)
  dbHelper.genPCDBFile(query_string)
  pcdbFileName = dbHelper.getPCDBPath(query_string)
  outputDir = dbHelper.rawdataDir

  # Split the division further to config.numThreadPerDivisions divisions, and 
  # download data for each division sequentially.
  total_division = config.numSearchDivisions / config.numThreadPerDivisions
  for division_id in range(0, total_division):
    downloadQuery(query_string, configFileName, pcdbFileName, outputDir, division_id)