p4cmd 2.0.1__tar.gz → 2.0.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p4cmd
3
- Version: 2.0.1
3
+ Version: 2.0.3
4
4
  Summary: Simple P4 python module
5
5
  Home-page: https://github.com/nielsvaes/p4cmd
6
6
  Author: Niels Vaes
@@ -24,6 +24,7 @@ class P4Client(object):
24
24
  :param silent: *bool* if True, suppresses error messages to cut down on terminal spam
25
25
  """
26
26
  self.perforce_root = perforce_root
27
+ self.silent = silent
27
28
 
28
29
  self.user = user
29
30
  self.client = client
@@ -46,7 +47,9 @@ class P4Client(object):
46
47
  if self.server is None:
47
48
  raise p4errors.WorkSpaceError("Could not find P4PORT")
48
49
 
49
- self.silent = silent
50
+
51
+ # print(self.user)
52
+ # print(self.client)
50
53
 
51
54
  @classmethod
52
55
  def from_env(cls, *args, **kwargs):
@@ -126,6 +129,21 @@ class P4Client(object):
126
129
 
127
130
  return dict_list
128
131
 
132
+ def get_ticket_expiration(self):
133
+ """
134
+ Get the time in seconds when the current authentication ticket will expire
135
+
136
+ :return: *int* seconds until authentication ticket expires or *None*
137
+ """
138
+ if not self.host_online():
139
+ return None
140
+ result = self.run_cmd("login", args=["-s"])
141
+ info_dict = result[0]
142
+ expiration_seconds = self.__get_dict_value(info_dict, "TicketExpiration", None)
143
+ if expiration_seconds is not None:
144
+ return int(expiration_seconds)
145
+ return None
146
+
129
147
  def get_p4_setting(self, setting):
130
148
  """
131
149
  Gets a Perforce setting
@@ -836,6 +854,11 @@ class P4Client(object):
836
854
  if other_open in key and key != other_open:
837
855
  value = self.__get_dict_value(file_dict, key)
838
856
  opened_by.append(value)
857
+ action_owner = "actionOwner" if sys.version_info == 2 else "actionOwner".encode()
858
+ if action_owner in key:
859
+ value = self.__get_dict_value(file_dict, key)
860
+ value = value.decode() + "@" + self.find_p4_client()
861
+ opened_by.append(value.encode())
839
862
 
840
863
  p4file.set_checked_out_by(opened_by)
841
864
 
@@ -10,6 +10,8 @@ class Status:
10
10
  MOVED = "MOVED"
11
11
  UP_TO_DATE = "UP_TO_DATE"
12
12
  UNKNOWN = "UNKNOWN"
13
+ DELETED = "DELETED"
14
+ MOVED_DELETED = "MOVED_DELETED"
13
15
 
14
16
 
15
17
  class P4File(object):
@@ -117,6 +119,10 @@ class P4File(object):
117
119
  def get_status(self):
118
120
  if self.is_marked_for_delete():
119
121
  return Status.OPEN_FOR_DELETE
122
+ if self.is_deleted():
123
+ return Status.DELETED
124
+ if self.is_moved_deleted():
125
+ return Status.MOVED_DELETED
120
126
  if self.needs_syncing():
121
127
  return Status.NEED_SYNC
122
128
  if self.is_depot_only():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p4cmd
3
- Version: 2.0.1
3
+ Version: 2.0.3
4
4
  Summary: Simple P4 python module
5
5
  Home-page: https://github.com/nielsvaes/p4cmd
6
6
  Author: Niels Vaes
@@ -7,7 +7,7 @@ data_files_to_include = ["*.png"]
7
7
 
8
8
  setuptools.setup(
9
9
  name="p4cmd",
10
- version="2.0.1",
10
+ version="2.0.3",
11
11
  author="Niels Vaes",
12
12
  license='MIT',
13
13
  author_email="nielsvaes@gmail.com",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes