| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1f17349 commit 7d26530
46 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,9 +18,8 @@ | |||
| 18 | 18 | import importlib | |
| 19 | 19 | import pprint | |
| 20 | 20 | import textwrap | |
| 21 | - from dataclasses import dataclass | ||
| 22 | 21 | from types import ModuleType | |
| 23 | - from typing import Any, Dict, Iterable, Optional, Tuple, Type, Union | ||
| 22 | + from typing import Any, Dict, Iterable, Optional, Type, Union | ||
| 24 | 23 | ||
| 25 | 24 | import gitlab | |
| 26 | 25 | from gitlab import types as g_types | |
@@ -29,7 +28,6 @@ | |||
| 29 | 28 | from .client import Gitlab, GitlabList | |
| 30 | 29 | ||
| 31 | 30 | __all__ = [ | |
| 32 | - "RequiredOptional", | ||
| 33 | 31 | "RESTObject", | |
| 34 | 32 | "RESTObjectList", | |
| 35 | 33 | "RESTManager", | |
@@ -330,12 +328,6 @@ def total(self) -> Optional[int]: | |||
| 330 | 328 | return self._list.total | |
| 331 | 329 | ||
| 332 | 330 | ||
| 333 | - @dataclass(frozen=True) | ||
| 334 | - class RequiredOptional: | ||
| 335 | - required: Tuple[str, ...] = () | ||
| 336 | - optional: Tuple[str, ...] = () | ||
| 337 | - | ||
| 338 | - | ||
| 339 | 331 | class RESTManager: | |
| 340 | 332 | """Base class for CRUD operations on objects. | |
| 341 | 333 | ||
@@ -345,8 +337,8 @@ class RESTManager: | |||
| 345 | 337 | ``_obj_cls``: The class of objects that will be created | |
| 346 | 338 | """ | |
| 347 | 339 | ||
| 348 | - _create_attrs: RequiredOptional = RequiredOptional() | ||
| 349 | - _update_attrs: RequiredOptional = RequiredOptional() | ||
| 340 | + _create_attrs: g_types.RequiredOptional = g_types.RequiredOptional() | ||
| 341 | + _update_attrs: g_types.RequiredOptional = g_types.RequiredOptional() | ||
| 350 | 342 | _path: Optional[str] = None | |
| 351 | 343 | _obj_cls: Optional[Type[RESTObject]] = None | |
| 352 | 344 | _from_parent_attrs: Dict[str, Any] = {} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,14 @@ | |||
| 15 | 15 | # You should have received a copy of the GNU Lesser General Public License | |
| 16 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | 17 | ||
| 18 | - from typing import Any, Optional, TYPE_CHECKING | ||
| 18 | + import dataclasses | ||
| 19 | + from typing import Any, Optional, Tuple, TYPE_CHECKING | ||
| 20 | + | ||
| 21 | + | ||
| 22 | + @dataclasses.dataclass(frozen=True) | ||
| 23 | + class RequiredOptional: | ||
| 24 | + required: Tuple[str, ...] = () | ||
| 25 | + optional: Tuple[str, ...] = () | ||
| 19 | 26 | ||
| 20 | 27 | ||
| 21 | 28 | class GitlabAttribute: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,9 @@ | |||
| 1 | 1 | from typing import Any, cast, Dict, Optional, Union | |
| 2 | 2 | ||
| 3 | 3 | from gitlab import exceptions as exc | |
| 4 | - from gitlab.base import RequiredOptional, RESTManager, RESTObject | ||
| 4 | + from gitlab.base import RESTManager, RESTObject | ||
| 5 | 5 | from gitlab.mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin | |
| 6 | + from gitlab.types import RequiredOptional | ||
| 6 | 7 | ||
| 7 | 8 | __all__ = [ | |
| 8 | 9 | "ApplicationAppearance", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | - from gitlab.base import RequiredOptional, RESTManager, RESTObject | ||
| 1 | + from gitlab.base import RESTManager, RESTObject | ||
| 2 | 2 | from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin | |
| 3 | + from gitlab.types import RequiredOptional | ||
| 3 | 4 | ||
| 4 | 5 | __all__ = [ | |
| 5 | 6 | "Application", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,8 @@ | |||
| 1 | 1 | from typing import Any, cast, Union | |
| 2 | 2 | ||
| 3 | - from gitlab.base import RequiredOptional, RESTManager, RESTObject | ||
| 3 | + from gitlab.base import RESTManager, RESTObject | ||
| 4 | 4 | from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin | |
| 5 | + from gitlab.types import RequiredOptional | ||
| 5 | 6 | ||
| 6 | 7 | __all__ = [ | |
| 7 | 8 | "GroupEpicAwardEmoji", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,8 @@ | |||
| 1 | 1 | from typing import Any, cast, Union | |
| 2 | 2 | ||
| 3 | - from gitlab.base import RequiredOptional, RESTManager, RESTObject | ||
| 3 | + from gitlab.base import RESTManager, RESTObject | ||
| 4 | 4 | from gitlab.mixins import BadgeRenderMixin, CRUDMixin, ObjectDeleteMixin, SaveMixin | |
| 5 | + from gitlab.types import RequiredOptional | ||
| 5 | 6 | ||
| 6 | 7 | __all__ = [ | |
| 7 | 8 | "GroupBadge", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,8 @@ | |||
| 1 | 1 | from typing import Any, cast, Union | |
| 2 | 2 | ||
| 3 | - from gitlab.base import RequiredOptional, RESTManager, RESTObject | ||
| 3 | + from gitlab.base import RESTManager, RESTObject | ||
| 4 | 4 | from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin | |
| 5 | + from gitlab.types import RequiredOptional | ||
| 5 | 6 | ||
| 6 | 7 | __all__ = [ | |
| 7 | 8 | "GroupBoardList", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,8 @@ | |||
| 1 | 1 | from typing import Any, cast, Union | |
| 2 | 2 | ||
| 3 | - from gitlab.base import RequiredOptional, RESTManager, RESTObject | ||
| 3 | + from gitlab.base import RESTManager, RESTObject | ||
| 4 | 4 | from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin | |
| 5 | + from gitlab.types import RequiredOptional | ||
| 5 | 6 | ||
| 6 | 7 | __all__ = [ | |
| 7 | 8 | "ProjectBranch", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,8 @@ | |||
| 1 | 1 | from typing import Any, cast, Union | |
| 2 | 2 | ||
| 3 | - from gitlab.base import RequiredOptional, RESTManager, RESTObject | ||
| 3 | + from gitlab.base import RESTManager, RESTObject | ||
| 4 | 4 | from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin | |
| 5 | + from gitlab.types import RequiredOptional | ||
| 5 | 6 | ||
| 6 | 7 | __all__ = [ | |
| 7 | 8 | "BroadcastMessage", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,9 @@ | |||
| 1 | 1 | from typing import Any, cast, Dict, Optional, Union | |
| 2 | 2 | ||
| 3 | 3 | from gitlab import exceptions as exc | |
| 4 | - from gitlab.base import RequiredOptional, RESTManager, RESTObject | ||
| 4 | + from gitlab.base import RESTManager, RESTObject | ||
| 5 | 5 | from gitlab.mixins import CreateMixin, CRUDMixin, ObjectDeleteMixin, SaveMixin | |
| 6 | + from gitlab.types import RequiredOptional | ||
| 6 | 7 | ||
| 7 | 8 | __all__ = [ | |
| 8 | 9 | "GroupCluster", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments