def print_before_scenario(scenario): if not scenario.is_dry_run(): if not Config().no_indentation: sys.stdout.write(scenario.get_indentation()) if not Config().no_numbers: sys.stdout.write(colorful.bold_white("%*d. " % (0 if Config().no_indentation else len(str(Config().highest_scenario_id)), scenario.get_id()))) if Config().with_section_names: sys.stdout.write(colorful.bold_white("Scenario: ")) sys.stdout.write(colorful.bold_white(scenario.get_sentence())) sys.stdout.write("\n") sys.stdout.flush()
def get_representation(self): output = "" if not Config().no_indentation: output += self.get_indentation() if not Config().no_numbers: output += colorful.bold_white("%*d. " % (0 if Config().no_indentation else len(str(Config().highest_feature_id)), self._id)) if Config().with_section_names: output += colorful.bold_white("%s: " % self._title) output += colorful.bold_white(self._sentence + " " * (Config().longest_feature_text - len(self._sentence))) output += " " * 10 + colorful.bold_black("# " + fsh.filename(self._filename)) + "\n" for l in self._description.splitlines(): if not Config().no_indentation: output += self.get_indentation() + " " * len(str(Config().highest_feature_id)) + " " output += colorful.white(l) + "\n" return output + "\n"
def print_before_feature(feature): if not feature.is_dry_run(): if not Config().no_indentation: sys.stdout.write(feature.get_indentation()) if not Config().no_numbers: sys.stdout.write(colorful.bold_white("%*d. " % (0 if Config().no_indentation else len(str(Config().highest_feature_id)), feature.get_id()))) if Config().with_section_names: sys.stdout.write(colorful.bold_white("Feature: ")) sys.stdout.write(colorful.bold_white(feature.get_sentence() + " " * (Config().longest_feature_text - len(feature.get_sentence())))) sys.stdout.write(" " * 10 + colorful.bold_black("# " + fsh.filename(feature.get_filename()))) sys.stdout.write("\n") for l in feature.get_description().splitlines(): if not Config().no_indentation: sys.stdout.write(feature.get_indentation() + " " * len(str(Config().highest_feature_id)) + " ") colorful.out.white(l) sys.stdout.write("\n") sys.stdout.flush()