1919from markdownify import markdownify
2020
2121from typings import drupal , osv
22- from helpers .text import Text
22+ from helpers .text_is import TextIs
2323from user_agent import user_agent
2424
2525
@@ -351,11 +351,11 @@ def patch_advisory(sa_id: str, sa_advisory: drupal.Advisory) -> bool:
351351
352352 if before == sa_advisory ['field_affected_versions' ]:
353353 sa_advisory ['field_affected_versions' ] = after
354- print (' \\ - ' + Text .success ('patched affected versions' ))
354+ print (' \\ - ' + TextIs .success ('patched affected versions' ))
355355 return True
356356 print (
357357 ' \\ - '
358- + Text .warning (
358+ + TextIs .warning (
359359 f'skipped patching as affected version is now "{ sa_advisory ["field_affected_versions" ]} "'
360360 )
361361 )
@@ -379,14 +379,14 @@ def build_osv_advisory(
379379 # we expect that the downloader has excluded PSA type entries, but
380380 # we still guard against them here just in case one slips through
381381 if sa_advisory ['field_is_psa' ] == '1' :
382- print (' \\ -' + Text .error ('skipping as it is a psa? (this should not happen)' ))
382+ print (' \\ -' + TextIs .error ('skipping as it is a psa? (this should not happen)' ))
383383 return None
384384
385385 # there's not really much we can do if there isn't an affected version
386386 # todo: since build_affected_ranges throws if this isn't present, it might
387387 # make more sense to use that, with a custom exception class
388388 if sa_advisory ['field_affected_versions' ] is None :
389- print (' \\ - ' + Text .notice ('skipping as we do not have any affected versions' ))
389+ print (' \\ - ' + TextIs .notice ('skipping as we do not have any affected versions' ))
390390 return None
391391
392392 osv_advisory : osv .Vulnerability = {
@@ -466,7 +466,7 @@ def generate_osv_advisories() -> None:
466466 if is_existing_advisory_ahead (name , sa_id , osv_advisory ['modified' ]):
467467 print (
468468 ' \\ - '
469- + Text .error (
469+ + TextIs .error (
470470 'error: current modified date is ahead of the proposed modified date (is your cache up to date?)'
471471 )
472472 )
0 commit comments