p4cmd 2.8.5__tar.gz → 2.8.6__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.
Files changed (24) hide show
  1. {p4cmd-2.8.5 → p4cmd-2.8.6}/PKG-INFO +1 -1
  2. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/__init__.py +1 -1
  3. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/p4cmd.py +3 -2
  4. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/p4file.py +14 -1
  5. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd.egg-info/PKG-INFO +1 -1
  6. {p4cmd-2.8.5 → p4cmd-2.8.6}/LICENSE +0 -0
  7. {p4cmd-2.8.5 → p4cmd-2.8.6}/README.md +0 -0
  8. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/p4errors.py +0 -0
  9. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/resources/__init__.py +0 -0
  10. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/resources/perforce_DEPOT_ONLY.png +0 -0
  11. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/resources/perforce_MOVED.png +0 -0
  12. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/resources/perforce_NEED_SYNC.png +0 -0
  13. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/resources/perforce_OPEN_FOR_ADD.png +0 -0
  14. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/resources/perforce_OPEN_FOR_DELETE.png +0 -0
  15. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/resources/perforce_OPEN_FOR_EDIT.png +0 -0
  16. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/resources/perforce_UNKNOWN.png +0 -0
  17. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/resources/perforce_UNTRACKED.png +0 -0
  18. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/resources/perforce_UP_TO_DATE.png +0 -0
  19. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd/utils.py +0 -0
  20. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd.egg-info/SOURCES.txt +0 -0
  21. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd.egg-info/dependency_links.txt +0 -0
  22. {p4cmd-2.8.5 → p4cmd-2.8.6}/p4cmd.egg-info/top_level.txt +0 -0
  23. {p4cmd-2.8.5 → p4cmd-2.8.6}/setup.cfg +0 -0
  24. {p4cmd-2.8.5 → p4cmd-2.8.6}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p4cmd
3
- Version: 2.8.5
3
+ Version: 2.8.6
4
4
  Summary: Simple P4 python module
5
5
  Home-page: https://github.com/nielsvaes/p4cmd
6
6
  Author: Niels Vaes
@@ -1,4 +1,4 @@
1
- VERSION = "2.8.5"
1
+ VERSION = "2.8.6"
2
2
 
3
3
  from .p4cmd import P4Client
4
4
  from .p4file import P4File
@@ -229,7 +229,7 @@ class P4Client(object):
229
229
  file_list = convert_to_list(file_list) if not isinstance(file_list, list) else file_list
230
230
 
231
231
  if self.host_online():
232
- fstat_output = self.run_cmd("fstat", file_list=file_list)
232
+ fstat_output = self.run_cmd("fstat", args=["-Ol"], file_list=file_list)
233
233
  p4files = self.fstat_to_p4_files(fstat_output, allow_invalid_files=allow_invalid_files)
234
234
  return p4files
235
235
  else:
@@ -272,7 +272,7 @@ class P4Client(object):
272
272
  else:
273
273
  folder = folder + "/*"
274
274
 
275
- fstat_output = self.run_cmd("fstat", file_list=[folder])
275
+ fstat_output = self.run_cmd("fstat", args=["-Ol"], file_list=[folder])
276
276
  p4files = self.fstat_to_p4_files(fstat_output, allow_invalid_files=allow_invalid_files)
277
277
  return p4files
278
278
 
@@ -1287,6 +1287,7 @@ class P4Client(object):
1287
1287
  p4file.set_action(self.__get_dict_value(file_dict, "action"))
1288
1288
  p4file.set_head_action(self.__get_dict_value(file_dict, "headAction"))
1289
1289
  p4file.set_raw_data(str(file_dict))
1290
+ p4file.set_file_size(self.__get_dict_value(file_dict, "fileSize"))
1290
1291
 
1291
1292
  opened_by = []
1292
1293
  for key, value in file_dict.items():
@@ -28,6 +28,7 @@ class P4File(object):
28
28
  self.__action = None
29
29
  self.__raw_data = None
30
30
  self.__head_action = None
31
+ self.__file_size = None
31
32
 
32
33
  def update_self(self, p4client):
33
34
  if self.__depot_file_path is not None:
@@ -213,6 +214,17 @@ class P4File(object):
213
214
  def set_last_submitted_by(self, value):
214
215
  self.__last_submitted_by = value
215
216
 
217
+ def set_file_size(self, value):
218
+ self.__file_size = value
219
+
220
+ def get_file_size(self, in_megabyte=True):
221
+ try:
222
+ if in_megabyte:
223
+ return round(int(self.__file_size) / 1048576, 2)
224
+ return int(self.__file_size)
225
+ except:
226
+ return None
227
+
216
228
  def __eq__(self, other):
217
229
  if not isinstance(other, P4File):
218
230
  return NotImplemented
@@ -220,7 +232,8 @@ class P4File(object):
220
232
  private_attributes = [
221
233
  '_P4File__local_file_path', '_P4File__depot_file_path', '_P4File__last_submitted_by',
222
234
  '_P4File__have_revision', '_P4File__head_revision', '_P4File__checked_out_by',
223
- '_P4File__last_submit_time', '_P4File__action', '_P4File__raw_data', '_P4File__head_action'
235
+ '_P4File__last_submit_time', '_P4File__action', '_P4File__raw_data', '_P4File__head_action',
236
+ '_P4File__file_size'
224
237
  ]
225
238
 
226
239
  for attr in private_attributes:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p4cmd
3
- Version: 2.8.5
3
+ Version: 2.8.6
4
4
  Summary: Simple P4 python module
5
5
  Home-page: https://github.com/nielsvaes/p4cmd
6
6
  Author: Niels Vaes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes