NikGapps 3.16__py3-none-any.whl → 3.17__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- NikGapps/helper/git/GitlabManager.py +13 -12
- {NikGapps-3.16.dist-info → NikGapps-3.17.dist-info}/METADATA +1 -1
- {NikGapps-3.16.dist-info → NikGapps-3.17.dist-info}/RECORD +7 -7
- {NikGapps-3.16.dist-info → NikGapps-3.17.dist-info}/LICENSE +0 -0
- {NikGapps-3.16.dist-info → NikGapps-3.17.dist-info}/WHEEL +0 -0
- {NikGapps-3.16.dist-info → NikGapps-3.17.dist-info}/entry_points.txt +0 -0
- {NikGapps-3.16.dist-info → NikGapps-3.17.dist-info}/top_level.txt +0 -0
|
@@ -6,6 +6,7 @@ from pathlib import Path
|
|
|
6
6
|
import gitlab
|
|
7
7
|
|
|
8
8
|
from NikGapps.helper.FileOp import FileOp
|
|
9
|
+
from NikGapps.helper.P import P
|
|
9
10
|
from NikGapps.helper.Statics import Statics
|
|
10
11
|
from NikGapps.helper.git.GitOperations import GitOperations
|
|
11
12
|
|
|
@@ -41,7 +42,7 @@ class GitLabManager:
|
|
|
41
42
|
gitattributes = ""
|
|
42
43
|
for extn in extn_list:
|
|
43
44
|
gitattributes += f"*.{extn} filter=lfs diff=lfs merge=lfs -text\n"
|
|
44
|
-
|
|
45
|
+
self.create_and_commit_file(project_id=project.id, file_path=".gitattributes", content=gitattributes)
|
|
45
46
|
return project
|
|
46
47
|
|
|
47
48
|
def provide_owner_access(self, project_id, user_id):
|
|
@@ -51,7 +52,7 @@ class GitLabManager:
|
|
|
51
52
|
'user_id': user_id,
|
|
52
53
|
'access_level': 50
|
|
53
54
|
})
|
|
54
|
-
|
|
55
|
+
P.green(f"Owner access provided to user with ID {user_id}.")
|
|
55
56
|
return member
|
|
56
57
|
|
|
57
58
|
def get_project(self, project_name):
|
|
@@ -79,8 +80,8 @@ class GitLabManager:
|
|
|
79
80
|
]
|
|
80
81
|
}
|
|
81
82
|
commit = project.commits.create(commit_data)
|
|
82
|
-
|
|
83
|
-
print(commit)
|
|
83
|
+
P.green(f"README.md created and committed to the repository {project.name}.")
|
|
84
|
+
# print(commit)
|
|
84
85
|
return commit
|
|
85
86
|
|
|
86
87
|
def create_and_commit_file(self, project_id, branch_name="main", file_path="file.txt", content=""):
|
|
@@ -98,8 +99,8 @@ class GitLabManager:
|
|
|
98
99
|
]
|
|
99
100
|
}
|
|
100
101
|
commit = project.commits.create(commit_data)
|
|
101
|
-
|
|
102
|
-
print(commit)
|
|
102
|
+
P.green(f"{file_path} created and committed to the repository {project.name}.")
|
|
103
|
+
# print(commit)
|
|
103
104
|
return commit
|
|
104
105
|
|
|
105
106
|
def create_gitlab_repository(self, project_name, visibility='public'):
|
|
@@ -162,13 +163,13 @@ class GitLabManager:
|
|
|
162
163
|
new_repo_name = f"{repo_name}_{time.strftime('%Y%m%d')}"
|
|
163
164
|
new_project = self.get_project(new_repo_name)
|
|
164
165
|
if new_project is not None:
|
|
165
|
-
|
|
166
|
+
P.red(f"Project {new_repo_name} already exists. Deleting...")
|
|
166
167
|
self.delete_project(new_project.id)
|
|
167
168
|
project.name = new_repo_name
|
|
168
169
|
project.path = new_repo_name
|
|
169
|
-
|
|
170
|
+
P.yellow(f"Repository {repo_name} renaming to {new_repo_name}.")
|
|
170
171
|
project.save()
|
|
171
|
-
|
|
172
|
+
P.green(f"Repository {repo_name} renamed to {new_repo_name}.")
|
|
172
173
|
return project
|
|
173
174
|
|
|
174
175
|
def reset_repository(self, repo_name, gitattributes=None, user_id=8064473, sleep_for=10, delete_only=False):
|
|
@@ -177,13 +178,13 @@ class GitLabManager:
|
|
|
177
178
|
project = self.get_project(repo_name)
|
|
178
179
|
self.delete_project(project.id)
|
|
179
180
|
if not delete_only:
|
|
180
|
-
|
|
181
|
+
P.red(f"Waiting for {sleep_for} seconds for the project to be completely deleted...")
|
|
181
182
|
time.sleep(sleep_for)
|
|
182
183
|
project = self.create_repository(repo_name, provide_owner_access=True, user_id=user_id)
|
|
183
184
|
if gitattributes is not None:
|
|
184
185
|
commit = self.create_and_commit_file(project_id=project.id, file_path=".gitattributes",
|
|
185
186
|
content=gitattributes)
|
|
186
|
-
print(commit)
|
|
187
|
+
# print(commit)
|
|
187
188
|
return project
|
|
188
189
|
except Exception as e:
|
|
189
190
|
print(f"Failed to reset repository: {e}")
|
|
@@ -241,7 +242,7 @@ class GitLabManager:
|
|
|
241
242
|
if override_target:
|
|
242
243
|
target_project = self.get_project(target_repo_name)
|
|
243
244
|
if target_project is not None:
|
|
244
|
-
|
|
245
|
+
P.red(f"Project {target_repo_name} already exists. Deleting...")
|
|
245
246
|
self.delete_project(target_project.id)
|
|
246
247
|
if self.get_project(target_repo_name) is not None:
|
|
247
248
|
print(f"Project {target_repo_name} already exists. Exiting...")
|
|
@@ -80,7 +80,7 @@ NikGapps/helper/git/Git.py,sha256=rHK81xZMfLjH9uNBAnQWVW2a5StmHrmnNc6Lvh_mjiU,10
|
|
|
80
80
|
NikGapps/helper/git/GitOperations.py,sha256=iaAVkwYfMGn0oRv7ef8UIt6tZ5KAwaMSBtMnYtN6kdY,6169
|
|
81
81
|
NikGapps/helper/git/GitStatics.py,sha256=Y63VP_oV4q97y3s3kJq4Z74HRNLBEf7Dli6ZWVn0jJQ,683
|
|
82
82
|
NikGapps/helper/git/GithubManager.py,sha256=MuD8wAh362SjiHVUJwU4Q450AUT9HF-dPqlywOa4AcQ,499
|
|
83
|
-
NikGapps/helper/git/GitlabManager.py,sha256=
|
|
83
|
+
NikGapps/helper/git/GitlabManager.py,sha256=fpQaJ1peWjv2roJViT54jUHXF8JVvZndu9ntMZCFIgw,12862
|
|
84
84
|
NikGapps/helper/git/TestGit.py,sha256=_XCN2cRy_yWNtk0AZDTmsw_fSebR2Twy8uOYMG06q-A,2126
|
|
85
85
|
NikGapps/helper/git/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
86
|
NikGapps/helper/overlay/ApkMetaInfo.py,sha256=WyEMGl_7fM2KdudB4pIGUuYbjSstieKMpjflfUosi5U,1565
|
|
@@ -99,9 +99,9 @@ NikGapps/helper/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
99
99
|
NikGapps/helper/web/Requests.py,sha256=HaZUHe_xi_7LjPLOYBUwK3uwOYOcVaW2E1zazjw2wow,5502
|
|
100
100
|
NikGapps/helper/web/TelegramApi.py,sha256=XREdngh0vPvPMUOJsCJ3wSqXMFqS8q3qJUhmFMY6SH8,4743
|
|
101
101
|
NikGapps/helper/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
|
-
NikGapps-3.
|
|
103
|
-
NikGapps-3.
|
|
104
|
-
NikGapps-3.
|
|
105
|
-
NikGapps-3.
|
|
106
|
-
NikGapps-3.
|
|
107
|
-
NikGapps-3.
|
|
102
|
+
NikGapps-3.17.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
103
|
+
NikGapps-3.17.dist-info/METADATA,sha256=IAnNO0LVL_Qba72FGvs4CirqxCOy6OnErGTcjcXCMsc,4070
|
|
104
|
+
NikGapps-3.17.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
105
|
+
NikGapps-3.17.dist-info/entry_points.txt,sha256=iKbeOiuELwTDu5kmQHrU9XBVASWRR6_TuRIRva2UnAY,286
|
|
106
|
+
NikGapps-3.17.dist-info/top_level.txt,sha256=CD7RpCb7bzjyvpQLt8hh2gU6X1wj3Z0NIErVkg-nJI4,9
|
|
107
|
+
NikGapps-3.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|