dart-tools 0.3.7__tar.gz → 0.3.9__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.

Potentially problematic release.


This version of dart-tools might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dart-tools
3
- Version: 0.3.7
3
+ Version: 0.3.9
4
4
  Summary: The Dart CLI and Python Library
5
5
  Author-email: Dart Software Team <software@itsdart.com>
6
6
  License: MIT License
@@ -4,6 +4,7 @@
4
4
  """A CLI to interact with the Dart web app."""
5
5
 
6
6
  import argparse
7
+ from functools import wraps
7
8
  import json
8
9
  import os
9
10
  import random
@@ -90,6 +91,17 @@ def _get_task_url(host, duid):
90
91
  return f"{host}/search?t={duid}"
91
92
 
92
93
 
94
+ def suppress_exception(fn):
95
+ @wraps(fn)
96
+ def wrapper(*args, **kwargs):
97
+ try:
98
+ return fn(*args, **kwargs)
99
+ except Exception:
100
+ pass
101
+
102
+ return wrapper
103
+
104
+
93
105
  def _exit_gracefully(_signal_received, _frame) -> None:
94
106
  sys.exit("Quitting.")
95
107
 
@@ -178,13 +190,21 @@ class _Session:
178
190
  class _Git:
179
191
  @staticmethod
180
192
  def _format_for_branch(s):
181
- return re.sub("[^A-Za-z0-9_]+", "-", s.lower())
193
+ return re.sub(
194
+ r"-{2,}", "-", re.sub(r"[^a-z0-9-]+", "-", s.lower().replace("'", ""))
195
+ ).strip("-")
182
196
 
183
197
  @staticmethod
184
198
  def make_task_name(email, task):
185
199
  username = _Git._format_for_branch(email.split("@")[0])
186
200
  title = _Git._format_for_branch(task["title"])
187
- return f"{username}/{task['duid']}-{title}"[:60]
201
+ long = f"{username}/{task['duid']}-{title}"
202
+ if len(long) <= 60:
203
+ return long
204
+ for i in range(1, 11):
205
+ if long[60 - i] == "-":
206
+ return long[: 60 - i]
207
+ return long[:60]
188
208
 
189
209
  @staticmethod
190
210
  def get_current_branch():
@@ -261,10 +281,12 @@ def print_version():
261
281
  print(f"dart-tools version {_VERSION}")
262
282
 
263
283
 
284
+ @suppress_exception
264
285
  def print_version_update_message_maybe():
265
286
  latest = (
266
- _run_cmd("pip index versions dart-tools 2>&1")
287
+ _run_cmd("pip --disable-pip-version-check index versions dart-tools 2>&1")
267
288
  .rsplit("LATEST:", maxsplit=1)[-1]
289
+ .split("\n", maxsplit=1)[0]
268
290
  .strip()
269
291
  )
270
292
  if latest == _VERSION or [int(e) for e in latest.split(".")] <= [
@@ -273,7 +295,7 @@ def print_version_update_message_maybe():
273
295
  return
274
296
 
275
297
  print(
276
- f"A new version of dart-tools is available. To upgrade from {_VERSION} to {latest}, run\n\n\tpip install --upgrade dart-tools\n"
298
+ f"A new version of dart-tools is available. Upgrade from {_VERSION} to {latest} with\n\n pip install --upgrade dart-tools\n"
277
299
  )
278
300
 
279
301
 
@@ -319,7 +341,7 @@ def _begin_task(config, session, user_email, get_task):
319
341
  _Git.checkout_branch(branch_name)
320
342
 
321
343
  print(
322
- f"Started work on {task['title']} at {_get_task_url(config.host, task['duid'])} on branch {branch_name}"
344
+ f"Started work on\n\n {task['title']}\n {_get_task_url(config.host, task['duid'])}\n"
323
345
  )
324
346
 
325
347
 
@@ -354,7 +376,7 @@ def begin_task():
354
376
  return filtered_tasks[
355
377
  pick(
356
378
  [e["title"] for e in filtered_tasks],
357
- "Which of your active, unfinalized tasks are you beginning work on?",
379
+ "Which of your active, incomplete tasks are you beginning work on?",
358
380
  "→",
359
381
  )[1]
360
382
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dart-tools
3
- Version: 0.3.7
3
+ Version: 0.3.9
4
4
  Summary: The Dart CLI and Python Library
5
5
  Author-email: Dart Software Team <software@itsdart.com>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dart-tools"
3
- version = "0.3.7"
3
+ version = "0.3.9"
4
4
  description = "The Dart CLI and Python Library"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
File without changes
File without changes
File without changes
File without changes