unknown-cli 0.9.2__tar.gz → 0.9.4__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 (23) hide show
  1. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/PKG-INFO +6 -4
  2. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/README.md +2 -2
  3. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/setup.py +101 -101
  4. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknown_cli.egg-info/PKG-INFO +6 -4
  5. unknown-cli-0.9.4/unknowncli/VERSION +1 -0
  6. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/__init__.py +16 -16
  7. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/commands/project.py +6 -5
  8. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/commands/task.py +58 -58
  9. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/commands/unreal.py +87 -87
  10. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/data/.p4ignore.txt +152 -152
  11. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/utils.py +1 -1
  12. unknown-cli-0.9.2/unknowncli/VERSION +0 -1
  13. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/setup.cfg +0 -0
  14. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknown_cli.egg-info/SOURCES.txt +0 -0
  15. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknown_cli.egg-info/dependency_links.txt +0 -0
  16. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknown_cli.egg-info/entry_points.txt +0 -0
  17. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknown_cli.egg-info/requires.txt +0 -0
  18. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknown_cli.egg-info/top_level.txt +0 -0
  19. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/__main__.py +0 -0
  20. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/commands/__init__.py +0 -0
  21. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/commands/preflight.py +0 -0
  22. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/set_registry_keys.py +0 -0
  23. {unknown-cli-0.9.2 → unknown-cli-0.9.4}/unknowncli/set_url_handler.py +0 -0
@@ -1,14 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unknown-cli
3
- Version: 0.9.2
3
+ Version: 0.9.4
4
4
  Summary: Unknown Commandline Tool
5
5
  Home-page: UNKNOWN
6
6
  Author:
7
7
  Author-email:
8
8
  License: MIT
9
- Description: # Unknown CLI
10
-
11
- Internal tool
12
9
  Platform: UNKNOWN
13
10
  Classifier: Intended Audience :: Developers
14
11
  Classifier: License :: OSI Approved :: MIT License
@@ -16,3 +13,8 @@ Classifier: Operating System :: OS Independent
16
13
  Classifier: Programming Language :: Python :: 3
17
14
  Requires-Python: >=3.6
18
15
  Description-Content-Type: text/markdown
16
+
17
+ # Unknown CLI
18
+
19
+ Internal tool
20
+
@@ -1,3 +1,3 @@
1
- # Unknown CLI
2
-
1
+ # Unknown CLI
2
+
3
3
  Internal tool
@@ -1,101 +1,101 @@
1
- #!/usr/bin/env python
2
- import os, sys
3
- from setuptools import setup, find_packages, Command
4
-
5
- if sys.version_info < (3, 8):
6
- raise NotImplementedError("""This tool does not support Python versions older than 3.6""")
7
-
8
-
9
- version_file = os.path.abspath(os.path.join("unknowncli", "VERSION"))
10
-
11
-
12
- def get_version():
13
- with open(version_file) as f:
14
- return f.readlines()[0].strip()
15
-
16
-
17
- class BumpCommand(Command):
18
- description = "Version bump"
19
- user_options = [("which=", None, "Specify which part of the version to bump")]
20
-
21
- def initialize_options(self):
22
- self.which = None
23
-
24
- def finalize_options(self):
25
- assert self.which in (None, "major", "minor", "patch"), "Invalid bump pragma"
26
-
27
- def run(self):
28
- bump_version(self.which)
29
-
30
-
31
- def bump_version(which):
32
- major, minor, patch = (0, 1, 0)
33
- old_version = get_version()
34
- major, minor, patch = old_version.split(".")
35
-
36
- if which == "major":
37
- major = int(major) + 1
38
- minor = 0
39
- patch = 0
40
- elif which == "minor":
41
- minor = int(minor) + 1
42
- patch = 0
43
- else:
44
- patch = int(patch.split("-")[0]) + 1
45
-
46
- new_version = "%s.%s.%s" % (major, minor, patch)
47
-
48
- with open(version_file, "w") as f:
49
- f.write(new_version)
50
- print(f"Version has been bumped from {old_version} to {new_version}")
51
-
52
-
53
- with open("README.md", "r") as fh:
54
- long_description = fh.read()
55
-
56
- version = get_version()
57
-
58
- setup(
59
- name="unknown-cli",
60
- python_requires=">=3.6",
61
- version=version,
62
- license="MIT",
63
- author="",
64
- author_email="",
65
- description="Unknown Commandline Tool",
66
- long_description=long_description,
67
- long_description_content_type="text/markdown",
68
- url="",
69
- packages=find_packages(exclude=["tests"]),
70
- package_data={"": ["VERSION", "data/.p4ignore.txt"]},
71
- install_requires=[
72
- "typer",
73
- "click",
74
- "requests",
75
- "boto3",
76
- "psutil",
77
- "jsonpath-rw",
78
- "pyyaml",
79
- "pyjwt",
80
- "tabulate",
81
- "colorama",
82
- "shellingham",
83
- "boto3",
84
- "loguru",
85
- "P4Python",
86
- "rich",
87
- "pyuac",
88
- "pywin32"
89
- ],
90
- extras_require={},
91
- include_package_data=False,
92
- classifiers=[
93
- "Intended Audience :: Developers",
94
- "License :: OSI Approved :: MIT License",
95
- "Operating System :: OS Independent",
96
- "Programming Language :: Python :: 3",
97
- ],
98
- test_suite="tests",
99
- cmdclass={"bump": BumpCommand},
100
- entry_points={"console_scripts": ["unknown = unknowncli.__main__:app", "unk = unknowncli.__main__:app"]},
101
- )
1
+ #!/usr/bin/env python
2
+ import os, sys
3
+ from setuptools import setup, find_packages, Command
4
+
5
+ if sys.version_info < (3, 8):
6
+ raise NotImplementedError("""This tool does not support Python versions older than 3.6""")
7
+
8
+
9
+ version_file = os.path.abspath(os.path.join("unknowncli", "VERSION"))
10
+
11
+
12
+ def get_version():
13
+ with open(version_file) as f:
14
+ return f.readlines()[0].strip()
15
+
16
+
17
+ class BumpCommand(Command):
18
+ description = "Version bump"
19
+ user_options = [("which=", None, "Specify which part of the version to bump")]
20
+
21
+ def initialize_options(self):
22
+ self.which = None
23
+
24
+ def finalize_options(self):
25
+ assert self.which in (None, "major", "minor", "patch"), "Invalid bump pragma"
26
+
27
+ def run(self):
28
+ bump_version(self.which)
29
+
30
+
31
+ def bump_version(which):
32
+ major, minor, patch = (0, 1, 0)
33
+ old_version = get_version()
34
+ major, minor, patch = old_version.split(".")
35
+
36
+ if which == "major":
37
+ major = int(major) + 1
38
+ minor = 0
39
+ patch = 0
40
+ elif which == "minor":
41
+ minor = int(minor) + 1
42
+ patch = 0
43
+ else:
44
+ patch = int(patch.split("-")[0]) + 1
45
+
46
+ new_version = "%s.%s.%s" % (major, minor, patch)
47
+
48
+ with open(version_file, "w") as f:
49
+ f.write(new_version)
50
+ print(f"Version has been bumped from {old_version} to {new_version}")
51
+
52
+
53
+ with open("README.md", "r") as fh:
54
+ long_description = fh.read()
55
+
56
+ version = get_version()
57
+
58
+ setup(
59
+ name="unknown-cli",
60
+ python_requires=">=3.6",
61
+ version=version,
62
+ license="MIT",
63
+ author="",
64
+ author_email="",
65
+ description="Unknown Commandline Tool",
66
+ long_description=long_description,
67
+ long_description_content_type="text/markdown",
68
+ url="",
69
+ packages=find_packages(exclude=["tests"]),
70
+ package_data={"": ["VERSION", "data/.p4ignore.txt"]},
71
+ install_requires=[
72
+ "typer",
73
+ "click",
74
+ "requests",
75
+ "boto3",
76
+ "psutil",
77
+ "jsonpath-rw",
78
+ "pyyaml",
79
+ "pyjwt",
80
+ "tabulate",
81
+ "colorama",
82
+ "shellingham",
83
+ "boto3",
84
+ "loguru",
85
+ "P4Python",
86
+ "rich",
87
+ "pyuac",
88
+ "pywin32"
89
+ ],
90
+ extras_require={},
91
+ include_package_data=False,
92
+ classifiers=[
93
+ "Intended Audience :: Developers",
94
+ "License :: OSI Approved :: MIT License",
95
+ "Operating System :: OS Independent",
96
+ "Programming Language :: Python :: 3",
97
+ ],
98
+ test_suite="tests",
99
+ cmdclass={"bump": BumpCommand},
100
+ entry_points={"console_scripts": ["unknown = unknowncli.__main__:app", "unk = unknowncli.__main__:app"]},
101
+ )
@@ -1,14 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unknown-cli
3
- Version: 0.9.2
3
+ Version: 0.9.4
4
4
  Summary: Unknown Commandline Tool
5
5
  Home-page: UNKNOWN
6
6
  Author:
7
7
  Author-email:
8
8
  License: MIT
9
- Description: # Unknown CLI
10
-
11
- Internal tool
12
9
  Platform: UNKNOWN
13
10
  Classifier: Intended Audience :: Developers
14
11
  Classifier: License :: OSI Approved :: MIT License
@@ -16,3 +13,8 @@ Classifier: Operating System :: OS Independent
16
13
  Classifier: Programming Language :: Python :: 3
17
14
  Requires-Python: >=3.6
18
15
  Description-Content-Type: text/markdown
16
+
17
+ # Unknown CLI
18
+
19
+ Internal tool
20
+
@@ -0,0 +1 @@
1
+ 0.9.4
@@ -1,16 +1,16 @@
1
- import os
2
- from typer import Typer, Context, Argument, Option, echo, secho, confirm
3
-
4
-
5
- def read_version():
6
- directory = os.path.dirname(__file__)
7
- with open(os.path.join(directory, "VERSION"), "r") as version_file:
8
- version = version_file.readline().strip()
9
- return version
10
-
11
-
12
- __version__ = read_version()
13
-
14
-
15
- def get_version_string():
16
- return f"unknown-cli/{__version__}"
1
+ import os
2
+ from typer import Typer, Context, Argument, Option, echo, secho, confirm
3
+
4
+
5
+ def read_version():
6
+ directory = os.path.dirname(__file__)
7
+ with open(os.path.join(directory, "VERSION"), "r") as version_file:
8
+ version = version_file.readline().strip()
9
+ return version
10
+
11
+
12
+ __version__ = read_version()
13
+
14
+
15
+ def get_version_string():
16
+ return f"unknown-cli/{__version__}"
@@ -24,10 +24,11 @@ STREAMS = {
24
24
  }
25
25
  SUB_STREAMS = {
26
26
  "//project/sn2-main": {
27
- "Project ": "//project/sn2-main-ue",
28
- "Project+Raw": "//project/sn2-main-ue-raw",
29
- "Everything ": "//project/sn2-main",
30
- "Staging ": "//project/sn2-staging",
27
+ "Project" : "//project/sn2-main-ue",
28
+ "Project+RawRecommended": "//project/sn2-main-ue-raw-content",
29
+ "Project+RawAll" : "//project/sn2-main-ue-raw",
30
+ "Everything" : "//project/sn2-main",
31
+ "Staging" : "//project/sn2-staging",
31
32
  }
32
33
  }
33
34
 
@@ -200,7 +201,7 @@ def setup(
200
201
  except:
201
202
  secho("Access denied setting subst registry key. Running elevated process...")
202
203
  path = Path(__file__).parent.parent / "set_registry_keys.py"
203
- cmd = f"{sys.executable} {path.resolve()} \"{subst_cmd}\""
204
+ cmd = f"{sys.executable} \"{path.resolve()}\" \"{subst_cmd}\""
204
205
  check_call(cmd)
205
206
 
206
207
  h = winreg.CreateKey(winreg.HKEY_CURRENT_USER, "SOFTWARE\\perforce\\environment")
@@ -3,6 +3,7 @@ import logging
3
3
  import socket
4
4
  import sys
5
5
  from ..utils import abort
6
+ from .project import SUB_STREAMS
6
7
  from P4 import P4, P4Exception
7
8
  from typing import Optional
8
9
  from subprocess import check_call
@@ -18,7 +19,8 @@ hostname = socket.gethostname().lower()
18
19
  SUBST_DRIVE = "S:"
19
20
  path = f"{SUBST_DRIVE}\\sn2-main\\"
20
21
  BASE_STREAM = "//Project/SN2-Main"
21
- UE_STREAM = "//project/sn2-main-ue"
22
+ STREAM_LIST_LOWER = [s.lower() for s in list(list(SUB_STREAMS.values())[0].values())]
23
+ STREAM_LIST_STRING = "\n\t" + "\n\t".join(STREAM_LIST_LOWER)
22
24
 
23
25
  p4 = None
24
26
 
@@ -53,9 +55,11 @@ def main():
53
55
  stream_name = ret["Stream"]
54
56
  parent = ret["Parent"]
55
57
  secho(f"You are currently working in stream: {stream_name}", fg="blue")
56
- if parent.lower() != UE_STREAM and stream_name.lower() != UE_STREAM:
58
+ if parent.lower() not in STREAM_LIST_LOWER and stream_name.lower() not in STREAM_LIST_LOWER:
57
59
  abort(
58
- f"To use this tool you must be working in the {UE_STREAM} stream but your workspace is set on {stream_name}. Please change your workspace with 'p4 set'"
60
+ f"To use this tool you must be working in a valid stream but your workspace is set to {stream_name}." +
61
+ "\nPlease change to a relevant workspace with 'p4 set p4client=<your_valid_workspace>'" +
62
+ "\nOr set up a workspace with 'unk project setup'."
59
63
  )
60
64
 
61
65
 
@@ -108,7 +112,9 @@ def sync():
108
112
 
109
113
  secho(f"Syncing latest...")
110
114
  try:
111
- ret = p4.run_sync("-q", f"{path}UE/Subnautica2/...")
115
+ ret = p4.run_client("-o")[0]
116
+ root_path = ret["Root"]
117
+ p4.run_sync("-q", f"{root_path}/...")
112
118
  except P4Exception as e:
113
119
  print(e)
114
120
 
@@ -118,37 +124,21 @@ def create(label: str = Option(None, prompt="Task branch label")):
118
124
  """
119
125
  Create a new task branch
120
126
  """
121
-
127
+
122
128
  if not label:
123
129
  abort("Aborted.")
124
- clients = get_clients()
125
- current_stream = get_current_stream()["Stream"].lower()
126
- if current_stream != UE_STREAM:
127
- abort(f"You are in the {current_stream} stream. Please switch to the {UE_STREAM} main stream before creating a new task stream")
128
-
129
- ue_stream_client = None
130
- for k, c in clients.items():
131
- if k == UE_STREAM:
132
- ue_stream_client = c
133
- if not ue_stream_client:
134
- abort(f"You have no workspace mapped to the {UE_STREAM} stream. Please set one up.")
130
+ current_stream = get_current_stream()["Stream"]
131
+ if current_stream.lower() not in STREAM_LIST_LOWER:
132
+ abort(f"You are working in stream {current_stream}. Please first run 'unk task switch' to a parent stream.\nValid parent streams:{STREAM_LIST_STRING}")
135
133
 
136
134
  ret = p4.run_opened()
137
135
  if len(ret):
138
136
  abort("You have opened files. Please revert or submit before creating new task stream.")
139
137
 
140
- # print(ue_stream_client)
141
- # task_client_name = ue_stream_client["client"] + "_task"
142
- # task_client = None
143
- # for k, c in clients.items():
144
- # if c["client"] == task_client_name:
145
- # echo(f"Reusing existin workspace {k}")
146
- # task_client = c
147
- # break
148
- # sync latest from parent
149
- echo(f"Syncing parent branch {path}...")
138
+ client_root = get_current_client()["Root"]
139
+ echo(f"Syncing parent branch {client_root}\...")
150
140
  try:
151
- ret = p4.run_sync("-q", f"{path}...")
141
+ ret = p4.run_sync("-q", f"{client_root}\...")
152
142
  except P4Exception as e:
153
143
  secho(str(e), fg="yellow")
154
144
  abort("Please fix the issues above before continuing")
@@ -157,12 +147,12 @@ def create(label: str = Option(None, prompt="Task branch label")):
157
147
  label = label.replace(" ", "_").lower()
158
148
  stream_name = f"{p4.user}-{d}-{label}"
159
149
  full_stream_name = f"//Project/{stream_name}"
160
- secho(f"Creating task stream {stream_name} from {UE_STREAM}...")
150
+ secho(f"Creating task stream {stream_name} from {current_stream} ...")
161
151
  args = f"""
162
152
  Stream: {full_stream_name}
163
153
  Owner: {p4.user}
164
154
  Name: {stream_name}
165
- Parent: {UE_STREAM}
155
+ Parent: {current_stream}
166
156
  Type: task
167
157
  Description:
168
158
  Created by {p4.user}.
@@ -181,14 +171,14 @@ Paths:
181
171
  TextColumn("Populating {task.description}"),
182
172
  transient=True,
183
173
  ) as progress:
184
- progress.add_task(description=f"{full_stream_name}...", total=None)
174
+ progress.add_task(description=f"{full_stream_name} ...", total=None)
185
175
  ret = p4.run_populate("-o", "-S", full_stream_name, "-r", "-d", "Initial branch")
186
-
176
+
187
177
  except P4Exception as e:
188
178
  if e.errors:
189
179
  secho(e.errors[0], fg="yellow")
190
180
 
191
- secho(f"Switching current workspace {p4.client} to {full_stream_name}...")
181
+ secho(f"Switching current workspace {p4.client} to {full_stream_name} ...")
192
182
  p4.run_client("-s", "-S", full_stream_name)
193
183
  ret = p4.run_client("-o")[0]
194
184
  root_path = ret["Root"]
@@ -201,7 +191,7 @@ Paths:
201
191
  abort(f"Something went wrong. Current stream {stream_name} is not a task stream")
202
192
 
203
193
  # update the server without syncing
204
- ret = p4.run_sync("-q", "-k", f"{path}...")
194
+ ret = p4.run_sync("-q", "-k", f"{root_path}\...")
205
195
 
206
196
  secho(f"You are now working in task stream {stream_name} from parent {parent}", bold=True, fg="green")
207
197
 
@@ -270,7 +260,7 @@ def mergedown(nosubmit: Optional[bool] = Option(False, help="Do not submit the c
270
260
  """
271
261
  ret = p4.run_stream("-o")[0]
272
262
  stream_name = ret["Stream"]
273
- parent = ret["Parent"]
263
+ parent_stream = ret["Parent"]
274
264
  if ret["Type"] != "task":
275
265
  abort(f"Current stream {stream_name} is not a task stream")
276
266
 
@@ -291,7 +281,7 @@ def mergedown(nosubmit: Optional[bool] = Option(False, help="Do not submit the c
291
281
  TextColumn("{task.description}"),
292
282
  transient=True,
293
283
  ) as progress:
294
- progress.add_task(description=f"Merging files from {UE_STREAM} to {stream_name}...", total=None)
284
+ progress.add_task(description=f"Merging files from {parent_stream} to {stream_name}/...", total=None)
295
285
  try:
296
286
  cmd = ["-Af", "-S", stream_name, "-r", f"{stream_name}/..."]
297
287
  merge_response = p4.run_merge(*cmd)
@@ -302,7 +292,7 @@ def mergedown(nosubmit: Optional[bool] = Option(False, help="Do not submit the c
302
292
  if e.warnings:
303
293
  secho(e.warnings[0], fg="yellow")
304
294
  if "already integrated" in str(e):
305
- secho(f"Your task stream is already up to date with {UE_STREAM}", fg="green")
295
+ secho(f"Your task stream is already up to date with {parent_stream}", fg="green")
306
296
  return
307
297
 
308
298
  except P4Exception as e:
@@ -342,13 +332,13 @@ def mergedown(nosubmit: Optional[bool] = Option(False, help="Do not submit the c
342
332
  for r in ret:
343
333
  if "unresolved" in r:
344
334
  unresolved.append(r)
345
- secho(f" {r['clientFile']}... conflict", fg="yellow")
335
+ secho(f" {r['clientFile']} ... conflict", fg="yellow")
346
336
  else:
347
- secho(f" {r['clientFile']}... ok", fg="green")
337
+ secho(f" {r['clientFile']} ... ok", fg="green")
348
338
 
349
339
  if unresolved:
350
340
  secho(
351
- f"\nThere are conflicting files where you have changed files which have also been changed in {UE_STREAM}.\nYou can force overwrite these files in your task stream or resolve yourself via p4v."
341
+ f"\nThere are conflicting files where you have changed files which have also been changed in {parent_stream}.\nYou can force overwrite these files in your task stream or resolve yourself via p4v."
352
342
  )
353
343
  overwrite_all = False
354
344
  overwrite_none = False
@@ -359,7 +349,7 @@ def mergedown(nosubmit: Optional[bool] = Option(False, help="Do not submit the c
359
349
  y = prompt(f"[{i+1}/{len(unresolved)}] Overwrite {r['clientFile']} [Yes/No/None/All] ").upper()
360
350
  if y not in ("YES", "Y", "NO", "N", "NONE", "ALL"):
361
351
  abort(
362
- f"Please resolve remaining files in p4v. You can use this description: Automatically merge {UE_STREAM} to {stream_name}"
352
+ f"Please resolve remaining files in p4v. You can use this description: Automatically merge {parent_stream} to {stream_name}"
363
353
  )
364
354
  if y in ("ALL"):
365
355
  overwrite_none = False
@@ -371,12 +361,12 @@ def mergedown(nosubmit: Optional[bool] = Option(False, help="Do not submit the c
371
361
  if y in ("Y", "YES") or overwrite_all:
372
362
  ret = p4.run_resolve("-f", "-at", f"{r['clientFile']}")
373
363
  if y in ("N", "NO") or overwrite_none:
374
- secho(f"Skipping {r['clientFile']}...")
364
+ secho(f"Skipping {r['clientFile']} ...")
375
365
  num_skipped += 1
376
366
 
377
367
  if num_skipped:
378
368
  abort(
379
- f"Please resolve remaining files in p4v. You can use this description: Automatically merge {UE_STREAM} to {stream_name}"
369
+ f"Please resolve remaining files in p4v. You can use this description: Automatically merge {parent_stream} to {stream_name}"
380
370
  )
381
371
 
382
372
  secho("All Unresolved files have been overwritten by parent stream")
@@ -401,7 +391,7 @@ Client: {client}
401
391
  User: {p4.user}
402
392
 
403
393
  Description:
404
- Automatically merge {UE_STREAM} to {stream_name}. {mr}
394
+ Automatically merge {parent_stream} to {stream_name}. {mr}
405
395
  Files:
406
396
  {filelist}"""
407
397
  p4.input = txt
@@ -416,17 +406,17 @@ Files:
416
406
  ret = p4.run_fstat("-Olhp", "-Rco", "-e", "default", f"{root_path}/...")
417
407
  except P4Exception as e:
418
408
  if "not opened on this client." in str(e) or "no such file(s)." in str(e):
419
- secho(f"Your task stream is now up to date with {UE_STREAM}", fg="green")
409
+ secho(f"Your task stream is now up to date with {parent_stream}", fg="green")
420
410
  return
421
411
  else:
422
412
  echo(str(e))
423
413
  if not ret:
424
- secho(f"Your task stream is now up to date with {UE_STREAM}", fg="green")
414
+ secho(f"Your task stream is now up to date with {parent_stream}", fg="green")
425
415
  else:
426
416
  abort("Something is amiss. Your task stream is not up to date after the merge. Take a look at p4v")
427
417
  else:
428
418
  echo(
429
- f"Your merge changelist is now ready for submitting. Use this description: 'Automatically merge {UE_STREAM} to {stream_name}. {mr}"
419
+ f"Your merge changelist is now ready for submitting. Use this description: 'Automatically merge {parent_stream} to {stream_name}. {mr}"
430
420
  )
431
421
 
432
422
 
@@ -446,17 +436,20 @@ def copyup():
446
436
  if ret["Type"] != "task":
447
437
  abort(f"Current stream {stream_name} is not a task stream")
448
438
 
449
- echo(f"Switching to parent stream {parent}...")
439
+ secho(f"Switching to parent stream {parent} ...", fg="blue")
450
440
  p4.run_client("-s", "-S", parent)
451
441
 
452
442
  p4.run_sync("-q")
453
- echo(f"Performing copy from {stream_name} to {ret['baseParent']}...")
443
+ echo(f"Performing copy from {stream_name} to {ret['baseParent']}/...")
454
444
  try:
455
445
  copy_ret = p4.run_copy("-Af", "-S", stream_name, ret["baseParent"] + "/...")
456
446
  except P4Exception as e:
457
447
  if "up-to-date" in str(e):
458
448
  secho(f"Nothing to do. Parent {parent} is identical to task stream {stream_name}", fg="green")
459
449
  return
450
+ elif "No such file(s)" in str(e):
451
+ secho(f"Nothing to do. No changes were made yet in task stream {stream_name}", fg="green")
452
+ return
460
453
  else:
461
454
  raise
462
455
  else:
@@ -475,13 +468,12 @@ def delete(current: Optional[bool] = Option(False, help="Delete the current task
475
468
  ret = p4.run_stream("-o")[0]
476
469
  current_stream_name = ret["Stream"]
477
470
  parent = ret["Parent"]
471
+ root_path = get_current_client()["Root"]
478
472
 
479
473
  if current:
480
474
  if ret["Type"] != "task":
481
475
  abort(f"Current stream {current_stream_name} is not a task stream")
482
-
483
- if confirm("Are you sure you want to delete the current task stream?"):
484
- streams_to_delete = [current_stream_name]
476
+ streams_to_delete = [current_stream_name]
485
477
  else:
486
478
  client = p4.run_client("-o")[0]
487
479
  client_owner = client["Owner"]
@@ -505,24 +497,32 @@ def delete(current: Optional[bool] = Option(False, help="Delete the current task
505
497
  if n <= 0 or n > len(task_streams):
506
498
  abort("Aborted.")
507
499
  stream_name = task_streams[n - 1]["Stream"]
508
- if confirm(f"Are you sure you want to delete the task stream {stream_name}?"):
509
- streams_to_delete = [stream_name]
500
+ streams_to_delete = [stream_name]
510
501
 
511
502
  if streams_to_delete:
503
+ streams_to_delete_string = "\n\t" + "\n\t".join(
504
+ [f"(**YOUR CURRENT TASK STREAM**) {x}" if current_stream_name == x else x for x in streams_to_delete]
505
+ )
506
+ if not confirm(
507
+ f"==============\nTask stream(s) to delete:{streams_to_delete_string}" +
508
+ "\nAre you sure you want to delete these task stream(s)?"
509
+ ):
510
+ abort("Aborted.")
511
+
512
512
  if current_stream_name in streams_to_delete:
513
513
  if not parent:
514
- abort("Please switch to sn2-main stream before continuing")
515
- secho(f"Switching to {parent}...")
514
+ abort(f"Please run 'unk task switch' to a parent stream before continuing:{STREAM_LIST_STRING}")
515
+ secho(f"Switching to {parent} before deleting the task stream ...")
516
516
  p4.run_client("-s", "-S", parent)
517
- ret = p4.run_sync("-q", f"{path}...")
517
+ ret = p4.run_sync("-q", f"{root_path}\...")
518
518
 
519
519
  for stream_name in streams_to_delete:
520
520
  cmd = [sys.executable, "s:/sn2-main/BuildScripts/trigger_task_stream_deletion.py", stream_name]
521
- secho(f"Deleting task stream {stream_name}...")
521
+ secho(f"Deleting task stream {stream_name} ...")
522
522
 
523
523
  check_call(cmd)
524
524
  secho("Request to delete selected streams has been sent. It might take a few minutes to finish", fg="green")
525
525
  else:
526
526
  abort("Aborted")
527
- ret = p4.run_sync("-q", "-k", f"{path}...")
527
+ ret = p4.run_sync("-q", "-k", f"{root_path}\...")
528
528
  # sync()
@@ -1,87 +1,87 @@
1
- import time
2
- import requests
3
- import logging
4
- from pathlib import Path
5
- from ..utils import abort
6
- from subprocess import Popen
7
- import psutil
8
- from urllib.parse import quote_plus
9
- from typer import echo, secho, Typer
10
- from ..utils import set_url_handler
11
-
12
- log = logging.getLogger(__name__)
13
-
14
- UNREAL_EDITOR = r"s:\sn2-main\UE\Engine\Binaries\Win64\UnrealEditor.exe s:\sn2-main\UE\Subnautica2\Subnautica2.uproject"
15
- EDITOR_URL = "http://127.0.0.1:8082"
16
-
17
- app = Typer()
18
-
19
- def ensure_editor_running():
20
- for proc in psutil.process_iter():
21
- if "UnrealEditor" in proc.name():
22
- return
23
- echo(f"Running editor: {UNREAL_EDITOR}")
24
- Popen(UNREAL_EDITOR, shell=True)
25
- time.sleep(3.0)
26
- echo("Checking for response...")
27
- n = 0
28
- num_tries = 10
29
- while n < num_tries:
30
- try:
31
- url = f"http://127.0.0.1:8082/"
32
- resp = requests.get(url)
33
- return
34
- except:
35
- time.sleep(1.0)
36
- abort("Could not start editor.")
37
-
38
-
39
- @app.command()
40
- def diff(first, second):
41
- """
42
- Diff two .uasset files in the editor.
43
- """
44
- ensure_editor_running()
45
- try:
46
- first_file = Path(first)
47
- second_file = Path(second)
48
- if not first_file.is_file() or not second_file.is_file():
49
- abort(f"{first} or {second} not found")
50
- secho(f"Diffing the following files:\n {first}\n {second}", bold=True)
51
-
52
- # with open("c:/temp/out.log", "w") as f:
53
- # f.write(f"Diffing the following files:\n {first}\n {second}")
54
- left = quote_plus(first)
55
- right = quote_plus(second)
56
- left = first.replace("#", "%23")
57
- url = f"{EDITOR_URL}/diff?left={left}&right={right}"
58
- echo(url)
59
- resp = requests.get(url)
60
- print(resp.text)
61
- except Exception as e:
62
- raise
63
- # with open("c:/temp/out.log", "w") as f:
64
- # f.write(str(e))
65
-
66
- @app.command()
67
- def asset(name):
68
- """
69
- Open an asset in a running editor or spawn an editor
70
- """
71
- ensure_editor_running()
72
- p = Path(name)
73
- if p.is_file():
74
- asset_name = p.stem
75
- else:
76
- asset_name = p.name
77
- print(f"Getting {asset_name}...")
78
- resp = requests.get(f"{EDITOR_URL}/asset/{asset_name}")
79
- print(resp.text)
80
- time.sleep(5.0)
81
-
82
- @app.command()
83
- def handler():
84
- """
85
- Set the URL handler
86
- """
87
- set_url_handler(True)
1
+ import time
2
+ import requests
3
+ import logging
4
+ from pathlib import Path
5
+ from ..utils import abort
6
+ from subprocess import Popen
7
+ import psutil
8
+ from urllib.parse import quote_plus
9
+ from typer import echo, secho, Typer
10
+ from ..utils import set_url_handler
11
+
12
+ log = logging.getLogger(__name__)
13
+
14
+ UNREAL_EDITOR = r"s:\sn2-main\UE\Engine\Binaries\Win64\UnrealEditor.exe s:\sn2-main\UE\Subnautica2\Subnautica2.uproject"
15
+ EDITOR_URL = "http://127.0.0.1:8082"
16
+
17
+ app = Typer()
18
+
19
+ def ensure_editor_running():
20
+ for proc in psutil.process_iter():
21
+ if "UnrealEditor" in proc.name():
22
+ return
23
+ echo(f"Running editor: {UNREAL_EDITOR}")
24
+ Popen(UNREAL_EDITOR, shell=True)
25
+ time.sleep(3.0)
26
+ echo("Checking for response...")
27
+ n = 0
28
+ num_tries = 10
29
+ while n < num_tries:
30
+ try:
31
+ url = f"http://127.0.0.1:8082/"
32
+ resp = requests.get(url)
33
+ return
34
+ except:
35
+ time.sleep(1.0)
36
+ abort("Could not start editor.")
37
+
38
+
39
+ @app.command()
40
+ def diff(first, second):
41
+ """
42
+ Diff two .uasset files in the editor.
43
+ """
44
+ ensure_editor_running()
45
+ try:
46
+ first_file = Path(first)
47
+ second_file = Path(second)
48
+ if not first_file.is_file() or not second_file.is_file():
49
+ abort(f"{first} or {second} not found")
50
+ secho(f"Diffing the following files:\n {first}\n {second}", bold=True)
51
+
52
+ # with open("c:/temp/out.log", "w") as f:
53
+ # f.write(f"Diffing the following files:\n {first}\n {second}")
54
+ left = quote_plus(first)
55
+ right = quote_plus(second)
56
+ left = first.replace("#", "%23")
57
+ url = f"{EDITOR_URL}/diff?left={left}&right={right}"
58
+ echo(url)
59
+ resp = requests.get(url)
60
+ print(resp.text)
61
+ except Exception as e:
62
+ raise
63
+ # with open("c:/temp/out.log", "w") as f:
64
+ # f.write(str(e))
65
+
66
+ @app.command()
67
+ def asset(name):
68
+ """
69
+ Open an asset in a running editor or spawn an editor
70
+ """
71
+ ensure_editor_running()
72
+ p = Path(name)
73
+ if p.is_file():
74
+ asset_name = p.stem
75
+ else:
76
+ asset_name = p.name
77
+ print(f"Getting {asset_name}...")
78
+ resp = requests.get(f"{EDITOR_URL}/asset/{asset_name}")
79
+ print(resp.text)
80
+ time.sleep(5.0)
81
+
82
+ @app.command()
83
+ def handler():
84
+ """
85
+ Set the URL handler
86
+ """
87
+ set_url_handler(True)
@@ -1,152 +1,152 @@
1
- # Here you can specify files to ignore when adding files to the depot.
2
- #
3
- # The syntax for P4IGNORE files is not the same as Perforce syntax.
4
- # Instead, it is similar to that used by other versioning systems:
5
- #
6
- # - Files are specified in local syntax
7
- # - a # character at the beginning of a line denotes a comment
8
- # - a ! character at the beginning of a line excludes the file specification
9
- # - a * wildcard matches substrings.
10
- #
11
- # http://stackoverflow.com/questions/18240084/how-does-perforce-ignore-file-syntax-differ-from-gitignore-syntax
12
-
13
- /*.sln
14
- /.p4sync.txt
15
-
16
- # Ignore all Visual Studio temp files.
17
- *.suo
18
- *.opensdf
19
- *.sdf
20
- .patch_*
21
-
22
- */DerivedDataCache/
23
- **/DerivedDataCache/Boot.ddc
24
- **/DerivedDataCache/**/*.udd
25
-
26
- # Ignore all Intermediate and Saved directories
27
- */Intermediate/*
28
- */Saved/*
29
-
30
- # Ignore UBT's configuration.xml
31
- Engine/Programs/UnrealBuildTool/*
32
- *.uatbuildrecord
33
- *.tmp
34
-
35
- # Ignore built binaries and temporary build files
36
- */obj/*
37
- *.csprojAssemblyReference.cache
38
-
39
- # Ignore UBT's log output files
40
- /Engine/Programs/UnrealBuildTool/*.txt
41
-
42
- # Ignore Python cached files
43
- *.pyc
44
-
45
- # Ignore JetBrain's IDE folders
46
- .idea/
47
- .gradle/
48
-
49
- # Ignore autogenerated files from HoloLens WMRInterop
50
- /Engine/Source/ThirdParty/WindowsMixedRealityInterop/packages/*
51
- /Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/Generated Files/*
52
- /Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/x64/*
53
- /Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/ARM64/*
54
- /Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/x64/*
55
- /Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/ARM64/*
56
-
57
- Saved/
58
- LocalBuilds/
59
- *.csproj.*
60
- .vs/*
61
- .vsconfig
62
- *.pdb
63
- *.suo
64
- *.opensdf
65
- *.sdf
66
- *.tmp
67
- *.mdb
68
- obj/
69
- *.vcxproj
70
- *.sln
71
- *-Debug.*
72
- FileOpenOrder/
73
- *.xcworkspace
74
- *.xcodeproj
75
- ./Makefile
76
- ./CMakeLists.txt
77
- .ue4dependencies
78
- Samples/*
79
- FeaturePacks/*
80
- Templates/*
81
- Engine/Documentation/*
82
-
83
- # Engine intermediates
84
- Engine/Intermediate/*
85
- Intermediate/
86
-
87
- # Intermediate folders for programs should not be checked in
88
- Engine\Programs\*\Intermediate\*
89
-
90
- # Intermediate folders created for various C# programs
91
- Engine\Source\Programs\*\obj\*
92
-
93
- # Saved folders for programs should not be checked in
94
- Engine\Programs\*\Saved\*
95
- Engine\Programs\UnrealBuildTool\*
96
-
97
- # Derived data cache should never be checked in
98
- Engine/DerivedDataCache/*
99
-
100
- # Ignore any build receipts
101
- Engine/Build/Receipts/*
102
-
103
- # Ignore personal workspace vars
104
- p4config.txt
105
-
106
- # Ignore Unix backup files
107
- *~
108
-
109
- # Ignore Mac desktop services store files
110
- .DS_Store
111
-
112
- # Ignore crash reports
113
- crashinfo--*
114
-
115
- # Ignore linux project files
116
- *.user
117
- *.pro
118
- *.pri
119
- *.kdev4
120
-
121
- # Obj-C/Swift specific
122
- *.hmap
123
- *.ipa
124
- *.dSYM.zip
125
- *.dSYM
126
-
127
- # Ignore documentation generated for C# tools
128
- Engine/Binaries/DotNET/UnrealBuildTool.xml
129
- Engine/Binaries/DotNET/AutomationScripts/BuildGraph.Automation.xml
130
-
131
- # Ignore version files in the Engine/Binaries directory created by UBT
132
- /Engine/Binaries/**/*.version
133
-
134
- # Ignore exp files in the the Engine/Binaries directory as they aren't C/C++ source files
135
- /Engine/Binaries/**/*.exp
136
-
137
- # Ignore Swarm local save files
138
- Engine/Binaries/DotNET/SwarmAgent.DeveloperOptions.xml
139
- Engine/Binaries/DotNET/SwarmAgent.Options.xml
140
-
141
- # Intermediary Files
142
- *.target.xml
143
- *.exe.config
144
- *.exe.manifest
145
-
146
- # Ignore project-specific files
147
- */Build/Receipts/*
148
- */DerivedDataCache/*
149
- */Binaries/*-Shipping.*
150
- */Intermediate/*
151
-
152
- */Logs/*
1
+ # Here you can specify files to ignore when adding files to the depot.
2
+ #
3
+ # The syntax for P4IGNORE files is not the same as Perforce syntax.
4
+ # Instead, it is similar to that used by other versioning systems:
5
+ #
6
+ # - Files are specified in local syntax
7
+ # - a # character at the beginning of a line denotes a comment
8
+ # - a ! character at the beginning of a line excludes the file specification
9
+ # - a * wildcard matches substrings.
10
+ #
11
+ # http://stackoverflow.com/questions/18240084/how-does-perforce-ignore-file-syntax-differ-from-gitignore-syntax
12
+
13
+ /*.sln
14
+ /.p4sync.txt
15
+
16
+ # Ignore all Visual Studio temp files.
17
+ *.suo
18
+ *.opensdf
19
+ *.sdf
20
+ .patch_*
21
+
22
+ */DerivedDataCache/
23
+ **/DerivedDataCache/Boot.ddc
24
+ **/DerivedDataCache/**/*.udd
25
+
26
+ # Ignore all Intermediate and Saved directories
27
+ */Intermediate/*
28
+ */Saved/*
29
+
30
+ # Ignore UBT's configuration.xml
31
+ Engine/Programs/UnrealBuildTool/*
32
+ *.uatbuildrecord
33
+ *.tmp
34
+
35
+ # Ignore built binaries and temporary build files
36
+ */obj/*
37
+ *.csprojAssemblyReference.cache
38
+
39
+ # Ignore UBT's log output files
40
+ /Engine/Programs/UnrealBuildTool/*.txt
41
+
42
+ # Ignore Python cached files
43
+ *.pyc
44
+
45
+ # Ignore JetBrain's IDE folders
46
+ .idea/
47
+ .gradle/
48
+
49
+ # Ignore autogenerated files from HoloLens WMRInterop
50
+ /Engine/Source/ThirdParty/WindowsMixedRealityInterop/packages/*
51
+ /Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/Generated Files/*
52
+ /Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/x64/*
53
+ /Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/ARM64/*
54
+ /Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/x64/*
55
+ /Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/ARM64/*
56
+
57
+ Saved/
58
+ LocalBuilds/
59
+ *.csproj.*
60
+ .vs/*
61
+ .vsconfig
62
+ *.pdb
63
+ *.suo
64
+ *.opensdf
65
+ *.sdf
66
+ *.tmp
67
+ *.mdb
68
+ obj/
69
+ *.vcxproj
70
+ *.sln
71
+ *-Debug.*
72
+ FileOpenOrder/
73
+ *.xcworkspace
74
+ *.xcodeproj
75
+ ./Makefile
76
+ ./CMakeLists.txt
77
+ .ue4dependencies
78
+ Samples/*
79
+ FeaturePacks/*
80
+ Templates/*
81
+ Engine/Documentation/*
82
+
83
+ # Engine intermediates
84
+ Engine/Intermediate/*
85
+ Intermediate/
86
+
87
+ # Intermediate folders for programs should not be checked in
88
+ Engine\Programs\*\Intermediate\*
89
+
90
+ # Intermediate folders created for various C# programs
91
+ Engine\Source\Programs\*\obj\*
92
+
93
+ # Saved folders for programs should not be checked in
94
+ Engine\Programs\*\Saved\*
95
+ Engine\Programs\UnrealBuildTool\*
96
+
97
+ # Derived data cache should never be checked in
98
+ Engine/DerivedDataCache/*
99
+
100
+ # Ignore any build receipts
101
+ Engine/Build/Receipts/*
102
+
103
+ # Ignore personal workspace vars
104
+ p4config.txt
105
+
106
+ # Ignore Unix backup files
107
+ *~
108
+
109
+ # Ignore Mac desktop services store files
110
+ .DS_Store
111
+
112
+ # Ignore crash reports
113
+ crashinfo--*
114
+
115
+ # Ignore linux project files
116
+ *.user
117
+ *.pro
118
+ *.pri
119
+ *.kdev4
120
+
121
+ # Obj-C/Swift specific
122
+ *.hmap
123
+ *.ipa
124
+ *.dSYM.zip
125
+ *.dSYM
126
+
127
+ # Ignore documentation generated for C# tools
128
+ Engine/Binaries/DotNET/UnrealBuildTool.xml
129
+ Engine/Binaries/DotNET/AutomationScripts/BuildGraph.Automation.xml
130
+
131
+ # Ignore version files in the Engine/Binaries directory created by UBT
132
+ /Engine/Binaries/**/*.version
133
+
134
+ # Ignore exp files in the the Engine/Binaries directory as they aren't C/C++ source files
135
+ /Engine/Binaries/**/*.exp
136
+
137
+ # Ignore Swarm local save files
138
+ Engine/Binaries/DotNET/SwarmAgent.DeveloperOptions.xml
139
+ Engine/Binaries/DotNET/SwarmAgent.Options.xml
140
+
141
+ # Intermediary Files
142
+ *.target.xml
143
+ *.exe.config
144
+ *.exe.manifest
145
+
146
+ # Ignore project-specific files
147
+ */Build/Receipts/*
148
+ */DerivedDataCache/*
149
+ */Binaries/*-Shipping.*
150
+ */Intermediate/*
151
+
152
+ */Logs/*
@@ -351,5 +351,5 @@ def set_url_handler(force=False):
351
351
 
352
352
  if add_key:
353
353
  path = Path(__file__).parent / "set_url_handler.py"
354
- cmd = f"{sys.executable} {path.resolve()} {exe}"
354
+ cmd = f"{sys.executable} \"{path.resolve()}\" {exe}"
355
355
  call(cmd)
@@ -1 +0,0 @@
1
- 0.9.2
File without changes