p4cmd 2.8.4__tar.gz → 2.8.5__tar.gz
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.
- {p4cmd-2.8.4 → p4cmd-2.8.5}/PKG-INFO +1 -1
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/__init__.py +1 -1
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/p4cmd.py +17 -6
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd.egg-info/PKG-INFO +1 -1
- {p4cmd-2.8.4 → p4cmd-2.8.5}/LICENSE +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/README.md +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/p4errors.py +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/p4file.py +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/resources/__init__.py +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/resources/perforce_DEPOT_ONLY.png +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/resources/perforce_MOVED.png +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/resources/perforce_NEED_SYNC.png +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/resources/perforce_OPEN_FOR_ADD.png +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/resources/perforce_OPEN_FOR_DELETE.png +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/resources/perforce_OPEN_FOR_EDIT.png +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/resources/perforce_UNKNOWN.png +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/resources/perforce_UNTRACKED.png +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/resources/perforce_UP_TO_DATE.png +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd/utils.py +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd.egg-info/SOURCES.txt +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd.egg-info/dependency_links.txt +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/p4cmd.egg-info/top_level.txt +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/setup.cfg +0 -0
- {p4cmd-2.8.4 → p4cmd-2.8.5}/setup.py +0 -0
|
@@ -243,7 +243,7 @@ class P4Client(object):
|
|
|
243
243
|
return p4files
|
|
244
244
|
|
|
245
245
|
@validate_not_empty
|
|
246
|
-
def folder_to_p4files(self, folder, include_subfolders=True, allow_invalid_files=False):
|
|
246
|
+
def folder_to_p4files(self, folder, include_subfolders=True, allow_invalid_files=False, specific_file_filter=""):
|
|
247
247
|
"""
|
|
248
248
|
Returns all the files in a folder as a list of P4File objects. Uses the files_to_p4files function if the host
|
|
249
249
|
is offline
|
|
@@ -252,14 +252,25 @@ class P4Client(object):
|
|
|
252
252
|
:param include_subfolders: *bool*
|
|
253
253
|
:param allow_invalid_files: *bool* if set to False, this function will skip any files that are deleted or
|
|
254
254
|
marked for delte
|
|
255
|
+
:param specific_file_filter: *string* will only return files that have this specific string in it. Can be used
|
|
256
|
+
for file extensions or just part of the file
|
|
255
257
|
:return: *list* P4Files
|
|
256
258
|
"""
|
|
257
259
|
|
|
260
|
+
folder = folder.rstrip(r"/")
|
|
261
|
+
folder = folder.rstrip(r"\\")
|
|
262
|
+
|
|
258
263
|
if self.host_online():
|
|
259
264
|
if include_subfolders:
|
|
260
|
-
|
|
265
|
+
if specific_file_filter:
|
|
266
|
+
folder = folder + f"/.../*{specific_file_filter}*"
|
|
267
|
+
else:
|
|
268
|
+
folder = folder + "/..."
|
|
261
269
|
else:
|
|
262
|
-
|
|
270
|
+
if specific_file_filter:
|
|
271
|
+
folder = folder + f"/*{specific_file_filter}*"
|
|
272
|
+
else:
|
|
273
|
+
folder = folder + "/*"
|
|
263
274
|
|
|
264
275
|
fstat_output = self.run_cmd("fstat", file_list=[folder])
|
|
265
276
|
p4files = self.fstat_to_p4_files(fstat_output, allow_invalid_files=allow_invalid_files)
|
|
@@ -269,13 +280,13 @@ class P4Client(object):
|
|
|
269
280
|
if include_subfolders:
|
|
270
281
|
all_files = []
|
|
271
282
|
for root, dirs, files in os.walk(folder):
|
|
272
|
-
for file_name in files:
|
|
283
|
+
for file_name in [f for f in files if specific_file_filter in f]:
|
|
273
284
|
complete_file_path = os.path.join(root, file_name)
|
|
274
|
-
if not complete_file_path in
|
|
285
|
+
if not complete_file_path in all_files:
|
|
275
286
|
all_files.append(complete_file_path)
|
|
276
287
|
else:
|
|
277
288
|
all_files = [os.path.join(folder, file) for file in os.listdir(folder) if
|
|
278
|
-
os.path.isfile(os.path.join(folder, file))]
|
|
289
|
+
os.path.isfile(os.path.join(folder, file)) and specific_file_filter in file]
|
|
279
290
|
|
|
280
291
|
return self.files_to_p4files(all_files)
|
|
281
292
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|