@@ -390,7 +390,8 @@ ABC hierarchy::
390
390
This ABC is deprecated in favour of supporting resource loading
391
391
through :class: `importlib.resources.abc.TraversableResources `.
392
392
393
- .. abstractmethod :: get_data(path)
393
+ .. method :: get_data(path)
394
+ :abstractmethod:
394
395
395
396
An abstract method to return the bytes for the data located at *path *.
396
397
Loaders that have a file-like storage back-end
@@ -427,7 +428,8 @@ ABC hierarchy::
427
428
.. versionchanged :: 3.4
428
429
No longer abstract and a concrete implementation is provided.
429
430
430
- .. abstractmethod :: get_source(fullname)
431
+ .. method :: get_source(fullname)
432
+ :abstractmethod:
431
433
432
434
An abstract method to return the source of a module. It is returned as
433
435
a text string using :term: `universal newlines `, translating all
@@ -484,7 +486,8 @@ ABC hierarchy::
484
486
when implemented, helps a module to be executed as a script. The ABC
485
487
represents an optional :pep: `302 ` protocol.
486
488
487
- .. abstractmethod :: get_filename(fullname)
489
+ .. method :: get_filename(fullname)
490
+ :abstractmethod:
488
491
489
492
An abstract method that is to return the value of
490
493
:attr: `~module.__file__ ` for the specified module. If no path is
@@ -524,11 +527,13 @@ ABC hierarchy::
524
527
.. deprecated-removed :: 3.4 3.15
525
528
Use :meth: `Loader.exec_module ` instead.
526
529
527
- .. abstractmethod :: get_filename(fullname)
530
+ .. method :: get_filename(fullname)
531
+ :abstractmethod:
528
532
529
533
Returns :attr: `path `.
530
534
531
- .. abstractmethod :: get_data(path)
535
+ .. method :: get_data(path)
536
+ :abstractmethod:
532
537
533
538
Reads *path * as a binary file and returns the bytes from it.
534
539
@@ -664,27 +669,31 @@ ABC hierarchy::
664
669
.. deprecated-removed :: 3.12 3.14
665
670
Use :class: `importlib.resources.abc.TraversableResources ` instead.
666
671
667
- .. abstractmethod :: open_resource(resource)
672
+ .. method :: open_resource(resource)
673
+ :abstractmethod:
668
674
669
675
Returns an opened, :term: `file-like object ` for binary reading
670
676
of the *resource *.
671
677
672
678
If the resource cannot be found, :exc: `FileNotFoundError ` is
673
679
raised.
674
680
675
- .. abstractmethod :: resource_path(resource)
681
+ .. method :: resource_path(resource)
682
+ :abstractmethod:
676
683
677
684
Returns the file system path to the *resource *.
678
685
679
686
If the resource does not concretely exist on the file system,
680
687
raise :exc: `FileNotFoundError `.
681
688
682
- .. abstractmethod :: is_resource(name)
689
+ .. method :: is_resource(name)
690
+ :abstractmethod:
683
691
684
692
Returns ``True `` if the named *name * is considered a resource.
685
693
:exc: `FileNotFoundError ` is raised if *name * does not exist.
686
694
687
- .. abstractmethod :: contents()
695
+ .. method :: contents()
696
+ :abstractmethod:
688
697
689
698
Returns an :term: `iterable ` of strings over the contents of
690
699
the package. Do note that it is not required that all names
@@ -720,27 +729,33 @@ ABC hierarchy::
720
729
721
730
Abstract. The base name of this object without any parent references.
722
731
723
- .. abstractmethod :: iterdir()
732
+ .. method :: iterdir()
733
+ :abstractmethod:
724
734
725
735
Yield ``Traversable `` objects in ``self ``.
726
736
727
- .. abstractmethod :: is_dir()
737
+ .. method :: is_dir()
738
+ :abstractmethod:
728
739
729
740
Return ``True `` if ``self `` is a directory.
730
741
731
- .. abstractmethod :: is_file()
742
+ .. method :: is_file()
743
+ :abstractmethod:
732
744
733
745
Return ``True `` if ``self `` is a file.
734
746
735
- .. abstractmethod :: joinpath(child)
747
+ .. method :: joinpath(child)
748
+ :abstractmethod:
736
749
737
750
Return Traversable child in ``self ``.
738
751
739
- .. abstractmethod :: __truediv__(child)
752
+ .. method :: __truediv__(child)
753
+ :abstractmethod:
740
754
741
755
Return ``Traversable `` child in ``self ``.
742
756
743
- .. abstractmethod :: open(mode='r', *args, **kwargs)
757
+ .. method :: open(mode='r', *args, **kwargs)
758
+ :abstractmethod:
744
759
745
760
*mode * may be 'r' or 'rb' to open as text or binary. Return a handle
746
761
suitable for reading (same as :attr: `pathlib.Path.open `).
@@ -774,7 +789,8 @@ ABC hierarchy::
774
789
.. deprecated-removed :: 3.12 3.14
775
790
Use :class: `importlib.resources.abc.TraversableResources ` instead.
776
791
777
- .. abstractmethod :: files()
792
+ .. method :: files()
793
+ :abstractmethod:
778
794
779
795
Returns a :class: `importlib.resources.abc.Traversable ` object for the loaded
780
796
package.
0 commit comments