File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 88
99
1010class NullGitAutograderRepo (GitAutograderRepoBase ):
11+ @property
1112 def repo (self ) -> Repo :
1213 raise AttributeError (
1314 "Cannot access attribute repo on NullGitAutograderRepo. Check that your repo_type is not 'ignore'."
1415 )
1516
17+ @property
1618 def branches (self ) -> BranchHelper :
1719 raise AttributeError (
1820 "Cannot access attribute branches on NullGitAutograderRepo. Check that your repo_type is not 'ignore'."
1921 )
2022
23+ @property
2124 def commits (self ) -> CommitHelper :
2225 raise AttributeError (
2326 "Cannot access attribute commits on NullGitAutograderRepo. Check that your repo_type is not 'ignore'."
2427 )
2528
29+ @property
2630 def remotes (self ) -> RemoteHelper :
2731 raise AttributeError (
2832 "Cannot access attribute remotes on NullGitAutograderRepo. Check that your repo_type is not 'ignore'."
2933 )
3034
35+ @property
3136 def files (self ) -> FileHelper :
3237 raise AttributeError (
3338 "Cannot access attribute files on NullGitAutograderRepo. Check that your repo_type is not 'ignore'."
Original file line number Diff line number Diff line change @@ -25,17 +25,22 @@ def __init__(
2525 self ._remotes : RemoteHelper = RemoteHelper (self ._repo )
2626 self ._files : FileHelper = FileHelper (self ._repo )
2727
28+ @property
2829 def repo (self ) -> Repo :
2930 return self ._repo
3031
32+ @property
3133 def branches (self ) -> BranchHelper :
3234 return self ._branches
3335
36+ @property
3437 def commits (self ) -> CommitHelper :
3538 return self ._commits
3639
40+ @property
3741 def remotes (self ) -> RemoteHelper :
3842 return self ._remotes
3943
44+ @property
4045 def files (self ) -> FileHelper :
4146 return self ._files
Original file line number Diff line number Diff line change 1- from abc import ABC , abstractmethod
1+ from abc import ABC , abstractmethod , abstractproperty
22
33from git import Repo
44
99
1010
1111class GitAutograderRepoBase (ABC ):
12+ @property
1213 @abstractmethod
1314 def repo (self ) -> Repo : ...
1415
16+ @property
1517 @abstractmethod
1618 def branches (self ) -> BranchHelper : ...
1719
20+ @property
1821 @abstractmethod
1922 def commits (self ) -> CommitHelper : ...
2023
24+ @property
2125 @abstractmethod
2226 def remotes (self ) -> RemoteHelper : ...
2327
28+ @property
2429 @abstractmethod
2530 def files (self ) -> FileHelper : ...
You can’t perform that action at this time.
0 commit comments