urwid 2.6.6__py3-none-any.whl → 2.6.7__py3-none-any.whl

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 urwid might be problematic. Click here for more details.

@@ -190,7 +190,7 @@ class MainLoop:
190
190
  else:
191
191
  self._topmost_widget = self._widget
192
192
 
193
- def _set_pop_ups(self, pop_ups) -> None:
193
+ def _set_pop_ups(self, pop_ups: bool) -> None:
194
194
  warnings.warn(
195
195
  f"method `{self.__class__.__name__}._set_pop_ups` is deprecated, "
196
196
  f"please use `{self.__class__.__name__}.pop_ups` property",
@@ -214,7 +214,7 @@ class MainLoop:
214
214
  """
215
215
  self.logger.debug(f"Setting alarm in {sec!r} seconds with callback {callback!r}")
216
216
 
217
- def cb():
217
+ def cb() -> None:
218
218
  callback(self, user_data)
219
219
 
220
220
  return self.event_loop.alarm(sec, cb)
@@ -236,7 +236,7 @@ class MainLoop:
236
236
  sec = tm - time.time()
237
237
  self.logger.debug(f"Setting alarm in {sec!r} seconds with callback {callback!r}")
238
238
 
239
- def cb():
239
+ def cb() -> None:
240
240
  callback(self, user_data)
241
241
 
242
242
  return self.event_loop.alarm(sec, cb)
@@ -250,33 +250,28 @@ class MainLoop:
250
250
 
251
251
  if not IS_WINDOWS:
252
252
 
253
- def watch_pipe(self, callback: Callable[[bytes], bool]) -> int:
253
+ def watch_pipe(self, callback: Callable[[bytes], bool | None]) -> int:
254
254
  """
255
255
  Create a pipe for use by a subprocess or thread to trigger a callback
256
256
  in the process/thread running the main loop.
257
257
 
258
- :param callback: function taking one parameter to call from within
259
- the process/thread running the main loop
258
+ :param callback: function taking one parameter to call from within the process/thread running the main loop
260
259
  :type callback: callable
261
260
 
262
- This method returns a file descriptor attached to the write end of a
263
- pipe. The read end of the pipe is added to the list of files
264
- :attr:`event_loop` is watching. When data is written to the pipe the
265
- callback function will be called and passed a single value containing
266
- data read from the pipe.
261
+ This method returns a file descriptor attached to the write end of a pipe.
262
+ The read end of the pipe is added to the list of files :attr:`event_loop` is watching.
263
+ When data is written to the pipe the callback function will be called
264
+ and passed a single value containing data read from the pipe.
267
265
 
268
- This method may be used any time you want to update widgets from
269
- another thread or subprocess.
266
+ This method may be used any time you want to update widgets from another thread or subprocess.
270
267
 
271
- Data may be written to the returned file descriptor with
272
- ``os.write(fd, data)``. Ensure that data is less than 512 bytes (or 4K
273
- on Linux) so that the callback will be triggered just once with the
274
- complete value of data passed in.
268
+ Data may be written to the returned file descriptor with ``os.write(fd, data)``.
269
+ Ensure that data is less than 512 bytes (or 4K on Linux)
270
+ so that the callback will be triggered just once with the complete value of data passed in.
275
271
 
276
- If the callback returns ``False`` then the watch will be removed from
277
- :attr:`event_loop` and the read end of the pipe will be closed. You
278
- are responsible for closing the write end of the pipe with
279
- ``os.close(fd)``.
272
+ If the callback returns ``False`` then the watch will be removed from :attr:`event_loop`
273
+ and the read end of the pipe will be closed.
274
+ You are responsible for closing the write end of the pipe with ``os.close(fd)``.
280
275
  """
281
276
  import fcntl
282
277
 
@@ -286,7 +281,7 @@ class MainLoop:
286
281
 
287
282
  def cb() -> None:
288
283
  data = os.read(pipe_rd, PIPE_BUFFER_READ_SIZE)
289
- if not callback(data):
284
+ if callback(data) is False:
290
285
  self.event_loop.remove_watch_file(watch_handle)
291
286
  os.close(pipe_rd)
292
287
 
@@ -296,9 +291,9 @@ class MainLoop:
296
291
 
297
292
  def remove_watch_pipe(self, write_fd: int) -> bool:
298
293
  """
299
- Close the read end of the pipe and remove the watch created by
300
- :meth:`watch_pipe`. You are responsible for closing the write end of
301
- the pipe.
294
+ Close the read end of the pipe and remove the watch created by :meth:`watch_pipe`.
295
+
296
+ ..note:: You are responsible for closing the write end of the pipe.
302
297
 
303
298
  Returns ``True`` if the watch pipe exists, ``False`` otherwise
304
299
  """
urwid/version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '2.6.6'
16
- __version_tuple__ = version_tuple = (2, 6, 6)
15
+ __version__ = version = '2.6.7'
16
+ __version_tuple__ = version_tuple = (2, 6, 7)
urwid/widget/grid_flow.py CHANGED
@@ -116,7 +116,9 @@ class GridFlow(WidgetWrap[Pile], WidgetContainerMixin, WidgetContainerListConten
116
116
  super()._invalidate()
117
117
 
118
118
  def _contents_modified(
119
- self, slc, new_items: Iterable[tuple[Widget, tuple[Literal["given", WHSettings.GIVEN], int]]]
119
+ self,
120
+ _slc: tuple[int, int, int],
121
+ new_items: Iterable[tuple[Widget, tuple[Literal["given", WHSettings.GIVEN], int]]],
120
122
  ) -> None:
121
123
  for item in new_items:
122
124
  try:
@@ -291,7 +293,7 @@ class GridFlow(WidgetWrap[Pile], WidgetContainerMixin, WidgetContainerListConten
291
293
  return None
292
294
  return self.contents[self.focus_position][0]
293
295
 
294
- def _get_focus(self) -> Widget:
296
+ def _get_focus(self) -> Widget | None:
295
297
  warnings.warn(
296
298
  f"method `{self.__class__.__name__}._get_focus` is deprecated, "
297
299
  f"please use `{self.__class__.__name__}.focus` property",
@@ -479,7 +481,7 @@ class GridFlow(WidgetWrap[Pile], WidgetContainerMixin, WidgetContainerListConten
479
481
 
480
482
  # Use width == maxcol in case of maxcol < width amount
481
483
  # Columns will use empty widget in case of GIVEN width > maxcol
482
- c.contents.append((w, c.options(WHSettings.GIVEN, width_amount if width_amount <= maxcol else maxcol)))
484
+ c.contents.append((w, c.options(WHSettings.GIVEN, min(width_amount, maxcol))))
483
485
  if (i == self.focus_position) or (not column_focused and w.selectable()):
484
486
  c.focus_position = len(c.contents) - 1
485
487
  column_focused = True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: urwid
3
- Version: 2.6.6
3
+ Version: 2.6.7
4
4
  Summary: A full-featured console (xterm et al.) user interface library
5
5
  Home-page: https://urwid.org/
6
6
  Author-email: Ian Ward <ian@excess.org>
@@ -11,7 +11,7 @@ urwid/split_repr.py,sha256=pXzuddzQ4RnfIl537Gvoe8PVaBRHCPnxgdYvKK0qm8k,3899
11
11
  urwid/str_util.py,sha256=1ss-LHAhjXTynTVBcoSgYWIpBeN_RirqHYhP7fq7MrA,10844
12
12
  urwid/text_layout.py,sha256=lHiGfo7clmwHt5dMl_AaQSs2ov9IbY9JySTATZBm7h0,22821
13
13
  urwid/util.py,sha256=pGXnma03_IBx3v6_qN9cDWPXPj_YjkhQ9IxLjm_0TpU,15747
14
- urwid/version.py,sha256=MQfDMt8obmx1lA3bZQCXZ_K2e1cj5mqx2lfvQITAvzA,411
14
+ urwid/version.py,sha256=tZREgQXhRCjy8CaVlbDdgPh_RAE1RKJtFgHzY2HTyfw,411
15
15
  urwid/vterm.py,sha256=q9-8dxJpVr_7a0Bj_z_FYDiRgzos3IS17BjhYcy1RDw,58410
16
16
  urwid/wimp.py,sha256=o1YsjL_tBLXba8ZRr1MTHH0poLSlXT_atY3-uD_Ualg,567
17
17
  urwid/display/__init__.py,sha256=y90WbHPNRHlimPrXhzsSfFsBbBHy8QErmB1y4Xza-xo,1732
@@ -32,7 +32,7 @@ urwid/event_loop/__init__.py,sha256=6di4AYD6HbCf6v5p0rZOoteKnM9U5tfk4NKcWMH4FV4,
32
32
  urwid/event_loop/abstract_loop.py,sha256=6Kkw3KCJ4ndiI2I1P8fPdtHzjuekRxUuvzFOiR0Myok,5494
33
33
  urwid/event_loop/asyncio_loop.py,sha256=QoK1zO6YHg5dn2DPlCXSf9uXPHEe6k6P9pPJMWISB-Q,8473
34
34
  urwid/event_loop/glib_loop.py,sha256=GFoLAenoWKm-13rTBKzCF2JdCEryJKpMo25aidZ7BWs,9351
35
- urwid/event_loop/main_loop.py,sha256=ndrnkWbdrNrRS_L1Qht0J7FaYBJfwuZK26BFJ8I6L7I,26045
35
+ urwid/event_loop/main_loop.py,sha256=gR2jGmqg1-CXFdNDlt-NizdS5AA7EZfmp6sW-nXwa18,26000
36
36
  urwid/event_loop/select_loop.py,sha256=5ZkIPqyIVJdWRTC89Ca5h8ub_-jpqXjFZaKqiWhdkDg,7534
37
37
  urwid/event_loop/tornado_loop.py,sha256=VNgXW2gO4edcYDjyEGb86yOHrE0NNXQUPXIOfJyZnAk,7100
38
38
  urwid/event_loop/trio_loop.py,sha256=2SBX1pbiJddAsXbe1itPPXYdoX5_U00m56A4h0x9dWI,10467
@@ -51,7 +51,7 @@ urwid/widget/divider.py,sha256=cM0gWHAqBz7E8l52CGEWWDMSVQkPNDjwy-t3ptbmh2s,3251
51
51
  urwid/widget/edit.py,sha256=qgVYeg_hX6tqRUiuLQkYwYKmWcfVLrLzAG1a5Au6S-w,23732
52
52
  urwid/widget/filler.py,sha256=EEnyAawdKXuwf79pErfNuvqsU1SVTutcMUrwWkU4wfo,14665
53
53
  urwid/widget/frame.py,sha256=AOe4FwjvwcIwrpXqyZkCwSZWwAALNl1XRMAKx6ZXYWs,21834
54
- urwid/widget/grid_flow.py,sha256=OSUaquJFWtvhXHzHb_BhEZLGQlGLDvZ1j3HE4VR8ldQ,21492
54
+ urwid/widget/grid_flow.py,sha256=otujeOTWYDr4gwuDikBm9zZd8SUgma9yvQ1hDWI-dGk,21514
55
55
  urwid/widget/line_box.py,sha256=V750xiZtkw6_uRXLhNY91ER3pXwwrZstVv_IJUZd_YY,6884
56
56
  urwid/widget/listbox.py,sha256=s3hg3VoiDY3pfqEmkURIE_Fa8WcLLzuaJn-_LVfG0EM,69495
57
57
  urwid/widget/monitored_list.py,sha256=M0PjNc_Vtuk6fnWdDelx-nbs3jLtXAo4JKB_OTk8McI,18773
@@ -67,8 +67,8 @@ urwid/widget/treetools.py,sha256=7b2US3Dj_akQ2JCf5gPo1SKGfvIhnQjbkpcLfYl0Kk4,173
67
67
  urwid/widget/widget.py,sha256=dMGNVewj2NGFdGKAtDJYgOzhuJAtrr_BALOMwNzUyj0,29550
68
68
  urwid/widget/widget_decoration.py,sha256=aHP9Y7JKVCI2dw2OdRrzMj9p--C1pMIbxSJskWBLIgc,5633
69
69
  urwid/widget/wimp.py,sha256=4wfzTQBLMbhicSlL64hBPb-1W5FAFrIKfb43i10MKSY,27305
70
- urwid-2.6.6.dist-info/COPYING,sha256=NrbT-keRaUP9X-wxPFhHhJRgR-wTN6eLRA5ZkstZX4k,26434
71
- urwid-2.6.6.dist-info/METADATA,sha256=HG2vqY4oV76l6feC2qBZG4sbTSg_Pa4io8aS7lDKZc0,11042
72
- urwid-2.6.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
- urwid-2.6.6.dist-info/top_level.txt,sha256=AwxQA43kNkjHbhYELXHBKrQ01X5CR2KnDzU07cVqilY,6
74
- urwid-2.6.6.dist-info/RECORD,,
70
+ urwid-2.6.7.dist-info/COPYING,sha256=NrbT-keRaUP9X-wxPFhHhJRgR-wTN6eLRA5ZkstZX4k,26434
71
+ urwid-2.6.7.dist-info/METADATA,sha256=Eb5tCnShmcVDexTEGqLILy1Du58ABPC31aGqbwmMRIc,11042
72
+ urwid-2.6.7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
+ urwid-2.6.7.dist-info/top_level.txt,sha256=AwxQA43kNkjHbhYELXHBKrQ01X5CR2KnDzU07cVqilY,6
74
+ urwid-2.6.7.dist-info/RECORD,,
File without changes
File without changes