def parse_features(feature_files, language=None):
 scenario_collector = FeatureScenarioLocationCollector()
 features = []
 for location in feature_files:
  if (not isinstance(location, FileLocation)):
   assert isinstance(location, string_types)
   location = FileLocation(os.path.normpath(location))
  if (location.filename == scenario_collector.filename):
   scenario_collector.add_location(location)
   continue
  elif scenario_collector.feature:
   current_feature = scenario_collector.build_feature()
   features.append(current_feature)
   scenario_collector.clear()
  assert isinstance(location, FileLocation)
  filename = os.path.abspath(location.filename)
  feature = parser.parse_file(filename, language=language)
  if feature:
   scenario_collector.feature = feature
   scenario_collector.add_location(location)
 if scenario_collector.feature:
  current_feature = scenario_collector.build_feature()
  features.append(current_feature)
 return features

def parse_features ( feature_files , language = None ) : scenario_collector = FeatureScenarioLocationCollector ( ) features = [ ] for location in feature_files : if ( not isinstance ( location , FileLocation ) ) : assert isinstance ( location , string_types ) location = FileLocation ( os . path . normpath ( location ) ) if ( location . filename == scenario_collector . filename ) : scenario_collector . add_location ( location ) continue elif scenario_collector . feature : current_feature = scenario_collector . build_feature ( ) features . append ( current_feature ) scenario_collector . clear ( ) assert isinstance ( location , FileLocation ) filename = os . path . abspath ( location . filename ) feature = parser . parse_file ( filename , language = language ) if feature : scenario_collector . feature = feature scenario_collector . add_location ( location ) if scenario_collector . feature : current_feature = scenario_collector . build_feature ( ) features . append ( current_feature ) return features
parse feature files and return list of feature model objects .