richqueue 1.3__tar.gz → 1.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: richqueue
3
- Version: 1.3
3
+ Version: 1.4
4
4
  Summary: RichQueue
5
5
  Project-URL: Homepage, https://github.com/mwinokan/RichQueue/issues
6
6
  Project-URL: Bug Tracker, https://github.com/mwinokan/RichQueue/issues
@@ -3,7 +3,7 @@ requires = ["hatchling"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name = "richqueue"
6
- version = "1.3"
6
+ version = "1.4"
7
7
  authors = [
8
8
  { name = "Max Winokan", email = "max@winokan.com" },
9
9
  ]
@@ -16,12 +16,12 @@ def dual_layout(function, **kwargs):
16
16
  try:
17
17
  upper.size = upper.renderable.renderable.row_count + PANEL_PADDING
18
18
  except AttributeError:
19
- upper.size = 3 # + PANEL_PADDING
19
+ upper.size = 3 # + PANEL_PADDING
20
20
 
21
21
  try:
22
22
  lower.size = lower.renderable.renderable.row_count + PANEL_PADDING
23
23
  except AttributeError:
24
- lower.size = 3 # + PANEL_PADDING
24
+ lower.size = 3 # + PANEL_PADDING
25
25
 
26
26
  layout.split_column(
27
27
  upper,
@@ -40,20 +40,22 @@ def get_layout_pair(user: str | None, **kwargs):
40
40
  hide_pending = False
41
41
 
42
42
  console_height = console.size.height
43
-
43
+
44
44
  history_df = df[~df["job_state"].isin(["RUNNING", "PENDING"])]
45
45
 
46
46
  if n_running + n_pending > 0:
47
47
 
48
48
  running_df = df[df["job_state"].isin(["RUNNING", "PENDING"])]
49
49
 
50
+ active_height = n_running + n_pending + PANEL_PADDING
51
+
50
52
  max_rows = console_height - 2 * PANEL_PADDING
51
53
 
52
54
  if n_rows > max_rows:
53
55
 
54
56
  # hide history?
55
- if n_running + n_pending + PANEL_PADDING + 1 < console_height:
56
- history_limit = 0
57
+ if active_height < console_height - PANEL_PADDING:
58
+ history_limit = max(0, console_height - PANEL_PADDING - active_height)
57
59
  running_limit = None
58
60
 
59
61
  # hide pending?
@@ -89,7 +91,13 @@ def get_layout_pair(user: str | None, **kwargs):
89
91
  running = Panel(Text("No active jobs", style="bold"), expand=False)
90
92
 
91
93
  if history_limit == 0:
92
- history = Panel(Text("history hidden, resize window or use smaller --hist value", style="bold"), expand=False)
94
+ history = Panel(
95
+ Text(
96
+ "history hidden, resize window or use smaller --hist value",
97
+ style="bold",
98
+ ),
99
+ expand=False,
100
+ )
93
101
  else:
94
102
  history = Panel(
95
103
  history_job_table(history_df, limit=history_limit, user=user, **kwargs),
@@ -213,6 +213,8 @@ def color_by_state(state):
213
213
  return "[bright_yellow]Pending"
214
214
  elif state == "MIXED":
215
215
  return "[bright_yellow]Mixed"
216
+ elif state == "TIMEOUT":
217
+ return "[bold bright_yellow]Timed Out"
216
218
  elif state == "CANCELLED":
217
219
  return "[orange3]Cancelled"
218
220
  elif state == "FAILED":
@@ -332,8 +332,10 @@ QUOTES = [
332
332
  "THE WORLD IS YOUR HOSTAGE", #
333
333
  ]
334
334
 
335
+
335
336
  def main():
336
- app()
337
+ app()
338
+
337
339
 
338
340
  if __name__ == "__main__":
339
341
  app()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes