mwxlib 1.2.7__py3-none-any.whl → 1.2.8__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 mwxlib might be problematic. Click here for more details.

mwx/framework.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "1.2.7"
4
+ __version__ = "1.2.8"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from contextlib import contextmanager
mwx/graphman.py CHANGED
@@ -1410,7 +1410,7 @@ class Frame(mwx.Frame):
1410
1410
  frames = self.load_buffer(paths, view)
1411
1411
  if frames:
1412
1412
  for frame in frames:
1413
- frame.set_attributes(res.get(frame.name))
1413
+ frame.update_attr(res.get(frame.name))
1414
1414
 
1415
1415
  n = len(frames)
1416
1416
  self.message(
@@ -1486,14 +1486,16 @@ class Frame(mwx.Frame):
1486
1486
  res.update(eval(i.read())) # read res <dict>
1487
1487
 
1488
1488
  for name, attr in tuple(res.items()):
1489
- fn = os.path.join(savedir, name)
1490
- if not os.path.exists(fn): # search by relpath (dir+name)
1491
- fn = attr.get('pathname')
1492
- if not os.path.exists(fn): # check & pop missing files
1493
- res.pop(name)
1494
- mis.update({name:attr})
1489
+ fn = os.path.join(savedir, name) # search by relpath (dir / name)
1490
+ if os.path.exists(fn):
1491
+ attr.update(pathname=fn) # if found, update pathname
1495
1492
  else:
1496
- attr.update(pathname=fn)
1493
+ fn = attr.get('pathname') # if not found, try pathname
1494
+ if fn.startswith(r'\\'):
1495
+ warn(f"The pathnme of {fn!r} contains network path, "
1496
+ f"so the search may take long time.", stacklevel=3)
1497
+ if not os.path.exists(fn):
1498
+ mis[name] = res.pop(name) # pop missing items
1497
1499
  except FileNotFoundError:
1498
1500
  pass
1499
1501
  except Exception as e:
@@ -1507,7 +1509,7 @@ class Frame(mwx.Frame):
1507
1509
  """Write attributes file."""
1508
1510
  try:
1509
1511
  res, mis = self.read_attributes(filename)
1510
- new = dict((x.name, x.get_attributes()) for x in frames)
1512
+ new = dict((x.name, x.attributes) for x in frames)
1511
1513
 
1512
1514
  ## `res` order may differ from that of given frames,
1513
1515
  ## so we take a few steps to merge `new` to be exported.
@@ -1540,7 +1542,7 @@ class Frame(mwx.Frame):
1540
1542
  res, mis = self.read_attributes(fn)
1541
1543
  savedirs[savedir] = res
1542
1544
  results = savedirs[savedir]
1543
- frame.set_attributes(results.get(frame.name))
1545
+ frame.update_attr(results.get(frame.name))
1544
1546
  return frames
1545
1547
 
1546
1548
  def save_frame(self, path=None, frame=None):
mwx/matplot2g.py CHANGED
@@ -157,11 +157,7 @@ class AxesImagePhantom:
157
157
  ## Called in `on_pick` and `__contains__` to check objects in.
158
158
  return x is self.__art
159
159
 
160
- def get_attributes(self):
161
- """Auxiliary info about the frame."""
162
- return self.__attributes
163
-
164
- def set_attributes(self, attr):
160
+ def update_attr(self, attr):
165
161
  """Update frame-specifc attributes:
166
162
 
167
163
  annotation : aux info (also displayed as a message in the infobar)
@@ -234,14 +230,18 @@ class AxesImagePhantom:
234
230
  lambda self,v: self.__art.set_clim(v),
235
231
  doc="Lower/Upper color limit values of the buffer.")
236
232
 
233
+ attributes = property(
234
+ lambda self: self.__attributes,
235
+ doc="Auxiliary info about the frame.")
236
+
237
237
  pathname = property(
238
238
  lambda self: self.__attributes.get('pathname'),
239
- lambda self,v: self.set_attributes({'pathname': v}),
239
+ lambda self,v: self.update_attr({'pathname': v}),
240
240
  doc="Fullpath of the buffer, if bound to a file.")
241
241
 
242
242
  annotation = property(
243
243
  lambda self: self.__attributes.get('annotation', ''),
244
- lambda self,v: self.set_attributes({'annotation': v}),
244
+ lambda self,v: self.update_attr({'annotation': v}),
245
245
  doc="Annotation of the buffer.")
246
246
 
247
247
  @property
@@ -648,8 +648,8 @@ class GraphPlot(MatplotPanel):
648
648
  j = names.index(name) # existing frame
649
649
  if j != -1:
650
650
  art = self.__Arts[j]
651
- art.update_buffer(buf) # => [frame_modified]
652
- art.set_attributes(kwargs) # => [frame_updated] localunit => [canvas_draw]
651
+ art.update_buffer(buf) # => [frame_modified]
652
+ art.update_attr(kwargs) # => [frame_updated] localunit => [canvas_draw]
653
653
  art.update_extent()
654
654
  if show:
655
655
  self.select(j)
@@ -185,7 +185,7 @@ class CheckList(wx.ListCtrl, ListCtrlAutoWidthMixin, CtrlInterface):
185
185
  if selected_frames:
186
186
  text = ''
187
187
  for frame in selected_frames:
188
- text += pformat(frame.get_attributes(), sort_dicts=0) # ALL attributes
188
+ text += pformat(frame.attributes, sort_dicts=0) # ALL attributes
189
189
  ## text += '{}\n{}\n'.format(frame.name, frame.annotation)
190
190
  Clipboard.write(text)
191
191
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: A wrapper of matplotlib and wxPython (phoenix)
5
5
  Home-page: https://github.com/komoto48g/mwxlib
6
6
  Author: Kazuya O'moto
@@ -1,11 +1,11 @@
1
1
  mwx/__init__.py,sha256=pS7ZG8QKRypiFFiaWAq_opBB6I_1viZ0zUMk2TbjzE0,667
2
2
  mwx/bookshelf.py,sha256=b_TMDaNIzLHoL0xbbqb3tt0BnRvhLAqaCn_pBdrigZw,7523
3
3
  mwx/controls.py,sha256=5PCy3zguDRuwYl89P9tOCUU7xAGUETs944qZBy5MS9g,48146
4
- mwx/framework.py,sha256=wurY8uvLFJW6Xig5kTTI84MkFWAK3v4-a6H2eSEwv7M,76125
5
- mwx/graphman.py,sha256=6ON1lckAyCbIMhIPHRbi9yvWYI2yT_CIWhNFbW31-mc,70110
4
+ mwx/framework.py,sha256=aWRouIUMqBCH3Uv1FpGC6GKfbwb79fSV_e23Limhx-E,76125
5
+ mwx/graphman.py,sha256=sKwPy31H4lwtShTAui_6upe_Ys2-MwBHhdFq-3onBNE,70328
6
6
  mwx/images.py,sha256=oxCn0P-emiWujSS2gUgU5TUnr5cPjix2jBcjOBDr24I,48701
7
7
  mwx/matplot2.py,sha256=Zwte-wwzCg_OHzsBniVgKdaNLzsvJaa1gc0n7VdAqxw,33150
8
- mwx/matplot2g.py,sha256=gs9U6VDdSX9wmzgrzDCWEZEL3DTOc5XkZOWZE5mffxc,64207
8
+ mwx/matplot2g.py,sha256=ceeAjFkrDz49aSLo_9dIWZZd4HhnSjxe8u9G_ipBHek,64195
9
9
  mwx/matplot2lg.py,sha256=JRWjWnLJUytbSq6wxs4P0gbVUr3xoLSF6Wwqd5V_pJI,27404
10
10
  mwx/mgplt.py,sha256=8mXbHpCmm7lz3XbAxOg7IVC7DaSGBEby1UfTlMl9kjk,5604
11
11
  mwx/nutshell.py,sha256=7nQ7UUFM9kvjDjHNUEdOkkeqZPiU6zOERwamqBdJpQs,140856
@@ -18,12 +18,12 @@ mwx/wxwit.py,sha256=1hHtMi2YEy2T_LnUpwdmrIdtCuvxMOFyykqnbq6jLP0,7294
18
18
  mwx/plugins/__init__.py,sha256=jnJ-Sl9XJ_7BFDslD_r7dsbxsOT57q_IaEriV53XIGY,41
19
19
  mwx/plugins/ffmpeg_view.py,sha256=NIHFJLPeliOXH3ke0NvQzYBhY0oeEP6dgZQofB5Ry1c,11031
20
20
  mwx/plugins/fft_view.py,sha256=08A_Y73XirV7kXpwf-v0mUA0Hr0MOfdMXv3tvL1hvWA,2789
21
- mwx/plugins/frame_listview.py,sha256=z2mGbOTStjaICU7vkn-fs_C8uvCD1xMldSOdr-_IKH0,10426
21
+ mwx/plugins/frame_listview.py,sha256=gowjQ-ARNonMkDSXkQgPKq4U9YBJ-vQ0jK2krBVOdCs,10420
22
22
  mwx/plugins/line_profile.py,sha256=zzm6_7lnAnNepLbh07ordp3nRWDFQJtu719ZVjrVf8s,819
23
23
  mwx/py/__init__.py,sha256=xykgfOytOwNuvXsfkLoumFZSTN-iBsHOjczYXngjmUE,12
24
24
  mwx/py/filling.py,sha256=fumUG1F5M9TL-Dfqni4G85uk7TmvnUunTbdcPDV0vfo,16857
25
- mwxlib-1.2.7.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
26
- mwxlib-1.2.7.dist-info/METADATA,sha256=sEkzDsdCV7wSQmHtCWDZLv9-2pbqdEQ7XvuD_VSyo5o,7258
27
- mwxlib-1.2.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
28
- mwxlib-1.2.7.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
29
- mwxlib-1.2.7.dist-info/RECORD,,
25
+ mwxlib-1.2.8.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
26
+ mwxlib-1.2.8.dist-info/METADATA,sha256=FKLkLzB6CRVzJ0JFJdYx3ngDSQR5aHxMm0HdQL5feTA,7258
27
+ mwxlib-1.2.8.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
28
+ mwxlib-1.2.8.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
29
+ mwxlib-1.2.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.7.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5