예제 #1
0
        override public void __FillStartInputItemQueue(InputItemQueue start_input_item_queue, Type start_input_item_type)
        {
            Log.Main.Write("Filling queue of " + start_input_item_queue.Name + " with input file.");

            if (!File.Exists(Bot.Settings.Input.File))
            {
                throw (new Exception("Input file " + Bot.Settings.Input.File + " does not exist."));
            }

            if (Path.GetExtension(Bot.Settings.Input.File).StartsWith(".xls", StringComparison.InvariantCultureIgnoreCase))
            {
                throw new Exception("Reading excel is not supported");
            }

            FileReader fr = new FileReader(Bot.Settings.Input.File, Bot.Settings.Input.FileFormat);
            string     input_locations = Cliver.Log.AppDir + "\\" + PathRoutines.GetFileNameFromPath("input_locations.txt");

            if (!File.Exists(input_locations))
            {
                throw (new Exception("Input file " + input_locations + " does not exist."));
            }
            for (FileReader.Row r = fr.ReadLine(); r != null; r = fr.ReadLine())
            {
                FileReader fr2 = new FileReader(input_locations, FileFormatEnum.TSV);
                for (FileReader.Row r2 = fr2.ReadLine(); r2 != null; r2 = fr2.ReadLine())
                {
                    start_input_item_queue.Add(new CustomBotCycle.SearchItem(r["Keyword"], r2["City"] + ", " + r2["State"]));
                }
            }

            if (start_input_item_queue.CountOfNew < 1)
            {
                LogMessage.Error("Input queue is empty so nothing is to do. Check your input data.");
            }
        }
예제 #2
0
 void Session_InputItemQueueProgress(InputItemQueue input_item_queue, int total_item_count, int processed_item_count)
 {
     This.DisplayStatus(input_item_queue.Name, "taken " + processed_item_count.ToString() + " /remain " + (total_item_count - processed_item_count).ToString());
     if (ProgressBarInputItemQueueName == input_item_queue.Name)
     {
         This.display_progress(total_item_count, processed_item_count);
     }
 }