TwoPy 0.3.6__py3-none-any.whl → 0.3.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.
@@ -583,11 +583,12 @@ class _ResponsePlotWidget(QWidget):
583
583
  """Show the copyable update command when a newer release is known."""
584
584
  if notice is None:
585
585
  return
586
- self._update_notice_label.setText(notice.command)
586
+ self._update_notice_label.setText(notice.text)
587
+ print(notice.text, flush=True)
587
588
  if self._viewer is not None:
588
589
  refresh_empty_viewer_message(
589
590
  self._viewer,
590
- update_command=notice.command,
591
+ update_command=notice.text,
591
592
  )
592
593
 
593
594
  def _ignore_update_notice_error(self, _error: Exception) -> None:
@@ -1,7 +1,7 @@
1
1
  """Check whether PyPI has a newer twopy release for the napari app.
2
2
 
3
3
  Inputs: installed twopy version, PyPI JSON metadata, and local UI cache.
4
- Outputs: an optional copyable update command for the Metadata tab.
4
+ Outputs: an optional copyable update notice for the Metadata tab.
5
5
 
6
6
  The app only tells users how to update. It does not choose or run an
7
7
  environment manager, because users may launch twopy from pip, conda, or another
@@ -97,14 +97,24 @@ class UpdateNotice:
97
97
  latest_version: Newer version available from the package index.
98
98
  command: Update command shown to the user.
99
99
 
100
- The Metadata tab shows only ``command`` so twopy does not assume how the
101
- user's Python environment is managed.
100
+ The Metadata tab shows text the user can copy. The command stays plain so
101
+ twopy does not assume how the user's Python environment is managed.
102
102
  """
103
103
 
104
104
  current_version: str
105
105
  latest_version: str
106
106
  command: str = PIP_UPDATE_COMMAND
107
107
 
108
+ @property
109
+ def text(self) -> str:
110
+ """Return the copyable user-facing update notice."""
111
+ return (
112
+ "Update available!\n"
113
+ f"Latest version is {self.latest_version}.\n"
114
+ "To update, run:\n"
115
+ f"{self.command}"
116
+ )
117
+
108
118
 
109
119
  def check_for_update(
110
120
  *,
@@ -131,9 +141,9 @@ def check_for_update(
131
141
  Update notice, or ``None`` when twopy is current or the check cannot
132
142
  prove that a newer final release exists.
133
143
 
134
- A fresh cache avoids one network request per launch. If PyPI is unreachable
135
- and an older cache already proves a newer version exists, twopy can still
136
- show the update command.
144
+ A fresh cache avoids one network request per launch only after it has
145
+ already seen a newer version. If PyPI is unreachable and an older cache
146
+ proves a newer version exists, twopy can still show the update command.
137
147
  """
138
148
  checked_now = _utc(now)
139
149
  cache = read_version_check_cache(state_file=state_file)
@@ -261,7 +271,7 @@ def _cache_is_fresh(
261
271
  latest = Version(cache.latest_version)
262
272
  except InvalidVersion:
263
273
  return False
264
- if latest < current:
274
+ if latest <= current:
265
275
  return False
266
276
  return now - checked_at <= max_age
267
277
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: twopy
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: Two-photon imaging analysis tool with a napari interface.
5
5
  Author-email: Gustavo Madeira Santana <fromweb1@gumadeiras.com>
6
6
  License-Expression: MIT
@@ -120,7 +120,7 @@ twopy/napari/state.py,sha256=P4QD9XZdeHvm_Ebjn7nOqV49gmDUTqBr0kSlOSZruhU,7337
120
120
  twopy/napari/text.py,sha256=amsxpoq4zMj5sHnNIiWpcVS5sS2KzIh7d1vQD2C4paE,2127
121
121
  twopy/napari/trial_timeline.py,sha256=oZSrYDEWfV60mrI9yekc813cc2W8-8EQZVwb7EUQn74,24349
122
122
  twopy/napari/types.py,sha256=yBHw9FSWFdjf8Xp-bK2SKBlH2BW7nIhUgPZceG63amc,1201
123
- twopy/napari/version_check.py,sha256=hOBIfVb2_YwFqGh9LxwCDaYfTv4oOIqGqZqfDEFCG-A,8730
123
+ twopy/napari/version_check.py,sha256=YzU8-fzbcPpCxrdOPciudVnRKi4f2tAS7nWhkanm4R4,9084
124
124
  twopy/napari/viewer.py,sha256=FIIRjPmuBkgQshTNFVXzXQFtubgnMI2KOs4eAiXhMq4,22079
125
125
  twopy/napari/assets/twopy-app-icon-128.png,sha256=93BO_VF7_CsUCRKpd5OrIid0ax3eV1vUciUtc8UyjP8,10629
126
126
  twopy/napari/assets/twopy-app-icon-16.png,sha256=uTRc_JlpzN1jNrWAu4Zi_xUd2nTvNa9TI--yzkGoJZs,1284
@@ -167,7 +167,7 @@ twopy/napari/plotting/docks/options_panel.py,sha256=Lp5sieUtzt8iRetyv8_P_4-ST5nK
167
167
  twopy/napari/plotting/docks/paths.py,sha256=hR2kP5-benxEfxpDedpbbosW1h2c4-no9zN6Da6DD94,4253
168
168
  twopy/napari/plotting/docks/plot_area.py,sha256=m7tvd9DmESq-4nhwIXqVVahCmlzTF1oRF44ph3hpdBs,12765
169
169
  twopy/napari/plotting/docks/response_map_area.py,sha256=5jFrfH0CZOp8D70-Wt6eNDlS-ny7SuzxdthVdzUWIgk,16033
170
- twopy/napari/plotting/docks/response_plot_widget.py,sha256=YkytmkSE2P7REGSeocE1XyQHqy0NKllKFV5oBUJ8-5I,88192
170
+ twopy/napari/plotting/docks/response_plot_widget.py,sha256=5rXk3JaRUT4xdfBP_l0c4reWNt1N5xv9Yr7TdU9IPbo,88225
171
171
  twopy/napari/plotting/docks/save_actions.py,sha256=06xSrv_xzti7Ii1LtERiSQKDf4bt8898BucxxnHNgFk,6063
172
172
  twopy/napari/plotting/docks/visibility_state.py,sha256=kmj6fwRV1IrUPFOjAMaHC92P8fNOtWqpzTPJhPUKFKg,5229
173
173
  twopy/napari/plotting/roi_generation/__init__.py,sha256=-NGko64QCV08KtQR0L6jTswhAk-sQZzWWBE9hO-ax20,1067
@@ -180,8 +180,8 @@ twopy/parity/psycho5.py,sha256=Xg7Q8Ipyv6hH9AXYKLxU0cLx9z10uWDLg7PNxT-rDyk,13908
180
180
  twopy/parity/roi.py,sha256=Q3deH6xRGCmTXASTlPHQgzH7FhBWkdjRUgh9skyS8j0,4975
181
181
  twopy/parity/roi_extraction.py,sha256=Z-ABVSB4Z6IUqZMWU1bq6Ko1tGP4uTdzk3As0gHaHTA,10372
182
182
  twopy/parity/saved_analysis.py,sha256=Kbpaxh1zapR5XxnHEkin8r4mEZX8kEtonudeZcwI7Dw,5597
183
- twopy-0.3.6.dist-info/METADATA,sha256=8YmH-hI7C1Bz1ZkRgr190obrkmVPYrIFoAnaOfkdZfA,4143
184
- twopy-0.3.6.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
185
- twopy-0.3.6.dist-info/entry_points.txt,sha256=RnmRKOxEv5ZwLN-dArdSB678gM2iNxbE30VwRpwhp8o,44
186
- twopy-0.3.6.dist-info/top_level.txt,sha256=8MB6QGpnHMTeTfEE543DOr676HcemeoELujrJkFcvak,6
187
- twopy-0.3.6.dist-info/RECORD,,
183
+ twopy-0.3.7.dist-info/METADATA,sha256=z50WG35cIqK6rU9DCY_d3zCD0FNpJZZtKFAB2nwYhO8,4143
184
+ twopy-0.3.7.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
185
+ twopy-0.3.7.dist-info/entry_points.txt,sha256=RnmRKOxEv5ZwLN-dArdSB678gM2iNxbE30VwRpwhp8o,44
186
+ twopy-0.3.7.dist-info/top_level.txt,sha256=8MB6QGpnHMTeTfEE543DOr676HcemeoELujrJkFcvak,6
187
+ twopy-0.3.7.dist-info/RECORD,,
File without changes