wolfhece 2.1.71__py3-none-any.whl → 2.1.72__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.
wolfhece/PyDraw.py CHANGED
@@ -140,24 +140,42 @@ class draw_type(Enum):
140
140
  WMSFORE = 'wms-foreground'
141
141
  TILES = 'tiles'
142
142
 
143
- COLORS1TO9 = [(0, 0, 255, 255),
144
- (0, 255, 0, 255),
145
- (0, 128, 255, 255),
146
- (255, 255, 0, 255),
147
- (255, 165, 0, 255),
148
- (128, 0, 128, 255),
149
- (255, 192, 203, 255),
150
- (165, 42, 42, 255),
151
- (128, 128, 128, 255)]
152
-
153
143
  class Colors_1to9(wx.Frame):
154
144
 
155
145
  def __init__(self, parent):
156
146
 
157
- super(Colors_1to9, self).__init__(parent, title=_('Colors 1 to 9'), size=(200, 380))
147
+ self._parent = parent
148
+ self.colors1to9 = [(0, 0, 255, 255),
149
+ (0, 255, 0, 255),
150
+ (0, 128, 255, 255),
151
+ (255, 255, 0, 255),
152
+ (255, 165, 0, 255),
153
+ (128, 0, 128, 255),
154
+ (255, 192, 203, 255),
155
+ (165, 42, 42, 255),
156
+ (128, 128, 128, 255)]
157
+
158
+ if self.file.exists():
159
+ self.OnLoad(None)
160
+
161
+ @property
162
+ def directory(self):
163
+ tmp = Path(__file__).parent / 'data'
164
+ if not tmp.exists():
165
+ tmp.mkdir()
166
+
167
+ return tmp
168
+
169
+ @property
170
+ def file(self):
171
+ return self.directory / 'colors1to9.json'
172
+
173
+ def __get_item__(self, i):
174
+ return self.colors1to9[i]
158
175
 
159
- global COLORS1TO9
176
+ def change_colors(self, e):
160
177
 
178
+ super(Colors_1to9, self).__init__(self._parent, title=_('Colors 1 to 9'), size=(200, 400))
161
179
  panel = wx.Panel(self)
162
180
  panel.SetBackgroundColour(wx.Colour(255, 255, 255))
163
181
 
@@ -167,7 +185,7 @@ class Colors_1to9(wx.Frame):
167
185
  for i in range(9):
168
186
  horsizer = wx.BoxSizer(wx.HORIZONTAL)
169
187
  horsizer.Add(wx.StaticText(panel, label=_('Color ') + str(i + 1)), 0, wx.ALL, 2)
170
- color = COLORS1TO9[i]
188
+ color = self.colors1to9[i]
171
189
  color = wx.Colour(color[0], color[1], color[2], color[3])
172
190
  self.pickers[i] = wx.ColourPickerCtrl(panel, colour=color)
173
191
  horsizer.Add(self.pickers[i], 0, wx.ALL, 2)
@@ -175,32 +193,65 @@ class Colors_1to9(wx.Frame):
175
193
 
176
194
  cmdOK = wx.Button(panel, wx.ID_OK, _('OK'))
177
195
  cmdCancel = wx.Button(panel, wx.ID_CANCEL, _('Cancel'))
196
+ cdmSetDefault = wx.Button(panel, wx.ID_APPLY, _('Default'))
197
+ cmdSave = wx.Button(panel, wx.ID_SAVE, _('Save'))
178
198
 
179
199
  horsizer = wx.BoxSizer(wx.HORIZONTAL)
180
- horsizer.Add(cmdOK, 0, wx.ALL, 5)
181
- horsizer.Add(cmdCancel, 0, wx.ALL, 5)
200
+ horsizer2 = wx.BoxSizer(wx.HORIZONTAL)
201
+ horsizer.Add(cmdOK, 0, wx.ALL, 2)
202
+ horsizer.Add(cmdCancel, 0, wx.ALL, 2)
203
+ horsizer2.Add(cdmSetDefault, 0, wx.ALL, 2)
204
+ horsizer2.Add(cmdSave, 0, wx.ALL, 2)
182
205
 
183
- sizer.Add(horsizer, 0, wx.ALL, 5)
206
+ sizer.Add(horsizer, 0, wx.ALL, 2)
207
+ sizer.Add(horsizer2, 0, wx.ALL, 2)
184
208
 
185
209
  panel.SetSizer(sizer)
186
210
 
187
211
  self.Bind(wx.EVT_BUTTON, self.OnOK, cmdOK)
188
212
  self.Bind(wx.EVT_BUTTON, self.OnCancel, cmdCancel)
213
+ self.Bind(wx.EVT_BUTTON, self.OnSetDefault, cdmSetDefault)
214
+ self.Bind(wx.EVT_BUTTON, self.OnSave, cmdSave)
189
215
 
190
216
  self.Show()
191
217
 
192
- def OnOK(self, event):
193
- global COLORS1TO9
218
+ def Apply(self):
194
219
 
195
220
  for i in range(9):
196
221
  color = self.pickers[i].GetColour()
197
- COLORS1TO9[i] = (color.Red(), color.Green(), color.Blue(), color.Alpha())
222
+ self.colors1to9[i] = (color.Red(), color.Green(), color.Blue(), color.Alpha())
198
223
 
224
+ def OnOK(self, event):
225
+
226
+ self.Apply()
199
227
  self.Close()
200
228
 
201
229
  def OnCancel(self, event):
202
230
  self.Close()
203
231
 
232
+ def OnSetDefault(self, event):
233
+ self.colors1to9 = [(0, 0, 255, 255),
234
+ (0, 255, 0, 255),
235
+ (0, 128, 255, 255),
236
+ (255, 255, 0, 255),
237
+ (255, 165, 0, 255),
238
+ (128, 0, 128, 255),
239
+ (255, 192, 203, 255),
240
+ (165, 42, 42, 255),
241
+ (128, 128, 128, 255)]
242
+ for i in range(9):
243
+ color = self.colors1to9[i]
244
+ color = wx.Colour(color[0], color[1], color[2], color[3])
245
+ self.pickers[i].SetColour(color)
246
+
247
+ def OnSave(self, event):
248
+ self.Apply()
249
+ with open(self.file, 'w') as f:
250
+ json.dump(self.colors1to9, f)
251
+
252
+ def OnLoad(self, event):
253
+ with open(self.file, 'r') as f:
254
+ self.colors1to9 = json.load(f)
204
255
  class DragdropFileTarget(wx.FileDropTarget):
205
256
  def __init__(self, window:"WolfMapViewer"):
206
257
  wx.FileDropTarget.__init__(self)
@@ -368,6 +419,9 @@ class WolfMapViewer(wx.Frame):
368
419
 
369
420
  """
370
421
 
422
+ self.treewidth = treewidth
423
+ super(WolfMapViewer, self).__init__(wxparent, title=title, size=(w + self.treewidth, h))
424
+
371
425
  self._wxlogging = wxlogging
372
426
  self.action = None # Action à entreprendre
373
427
  self.update_absolute_minmax = False # Force la MAJ de la palette
@@ -419,8 +473,7 @@ class WolfMapViewer(wx.Frame):
419
473
  # self.mylazdata_colors = None
420
474
  self.mylazgrid = None
421
475
 
422
- self.treewidth = treewidth
423
- super(WolfMapViewer, self).__init__(wxparent, title=title, size=(w + self.treewidth, h))
476
+ self.colors1to9 = Colors_1to9(self)
424
477
 
425
478
  self._dragdrop = DragdropFileTarget(self)
426
479
  self.SetDropTarget(self._dragdrop)
@@ -669,7 +722,6 @@ class WolfMapViewer(wx.Frame):
669
722
  self.helpmenu.Append(wx.ID_ANY, _('Shortcuts'), _('Shortcuts'))
670
723
  self.helpmenu.Append(wx.ID_ANY, _('Show logs/informations'), _('Logs'))
671
724
  self.helpmenu.Append(wx.ID_ANY, _('Show values'), _('Data/Values'))
672
- self.helpmenu.Append(wx.ID_ANY, _('Colors for selections 1->9'), _('Selections'))
673
725
  self.helpmenu.Append(wx.ID_ANY, _('About'), _('About'))
674
726
  self.helpmenu.Append(wx.ID_ANY, _('Check for updates'), _('Update?'))
675
727
 
@@ -2730,6 +2782,9 @@ class WolfMapViewer(wx.Frame):
2730
2782
  self.option_global = self.menu_options.Append(wx.ID_ANY,_("Global"),_("Modify global options"))
2731
2783
  self.Bind(wx.EVT_MENU, self.GlobalOptionsDialog, self.option_global)
2732
2784
 
2785
+ self.menu_1to9 =self.menu_options.Append(wx.ID_ANY, _('Colors for selections 1->9'), _('Selections'))
2786
+ self.Bind(wx.EVT_MENU, self.colors1to9.change_colors, self.menu_1to9)
2787
+
2733
2788
  self.Show(True)
2734
2789
 
2735
2790
  def OnSize(self, e):
@@ -4517,11 +4572,6 @@ class WolfMapViewer(wx.Frame):
4517
4572
  self.check_tooltip()
4518
4573
  autoscale = False
4519
4574
 
4520
- elif itemlabel == _('Colors for selections 1->9'):
4521
- autoscale = False
4522
-
4523
- newcolors = Colors_1to9(self)
4524
-
4525
4575
  elif itemlabel == _('About'):
4526
4576
  #print About Frame
4527
4577
  self.print_About()
@@ -9093,7 +9143,7 @@ class WolfMapViewer(wx.Frame):
9093
9143
  if idx > 8:
9094
9144
  idx -= 9
9095
9145
 
9096
- self.active_array.SelectionData.move_selectionto(str(idx+1), COLORS1TO9[idx])
9146
+ self.active_array.SelectionData.move_selectionto(str(idx+1), self.colors1to9[idx])
9097
9147
 
9098
9148
  elif key == wx.WXK_F1:
9099
9149
  self.read_last_result()
wolfhece/apps/version.py CHANGED
@@ -5,7 +5,7 @@ class WolfVersion():
5
5
 
6
6
  self.major = 2
7
7
  self.minor = 1
8
- self.patch = 71
8
+ self.patch = 72
9
9
 
10
10
  def __str__(self):
11
11
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.1.71
3
+ Version: 2.1.72
4
4
  Author-email: Pierre Archambeau <pierre.archambeau@uliege.be>
5
5
  License: Copyright (c) 2024 University of Liege. All rights reserved.
6
6
  Project-URL: Homepage, https://uee.uliege.be/hece
@@ -7,7 +7,7 @@ wolfhece/ManageParams.py,sha256=EeuUI5Vvh9ixCvYf8YShMC1s1Yacc7OxOCN7q81gqiQ,517
7
7
  wolfhece/Model1D.py,sha256=SI4oNF_J3MdjiWZoizS8kuRXLMVyymX9dYfYJNVCQVI,476989
8
8
  wolfhece/PyConfig.py,sha256=FB8u0belXOXTb03Ln6RdVWvMgjzi3oGPCmw2dWa3lNg,8332
9
9
  wolfhece/PyCrosssections.py,sha256=FnmM9DWY_SAF2EDH9Gu2PojXNtSTRF4-aYQuAAJXBh4,112771
10
- wolfhece/PyDraw.py,sha256=AXcgzwvTRRnzj7p45fr8QVMdLdoLPe4yIZaXjUoz040,413560
10
+ wolfhece/PyDraw.py,sha256=oTnhTTP-VNzpEDXKD5rozJL3NLKg-bLs2pjgy_f6JgA,415541
11
11
  wolfhece/PyGui.py,sha256=oBIBpgBQRR_XXucKE5-RFrtqKj0DRg9VlUCRo8Mzalc,105009
12
12
  wolfhece/PyGuiHydrology.py,sha256=f60E8K9eGTnRq5RDF6yvt-ahf2AYegwQ9t25zZ2Mk1A,14946
13
13
  wolfhece/PyHydrographs.py,sha256=jwtSNMMACwarxrtN1UeQYth99UNrhwPx1IGgUwcooHA,3774
@@ -72,7 +72,7 @@ wolfhece/apps/check_install.py,sha256=Xoi_d8MzKzNAy2xqEpERdsqgRPu0hbBWukI0WkIYzD
72
72
  wolfhece/apps/curvedigitizer.py,sha256=Yps4bcayzbsz0AoVc_dkSk35dEhhn_esIBy1Ziefgmk,5334
73
73
  wolfhece/apps/isocurrent.py,sha256=dagmGR8ja9QQ1gwz_8fU-N052hIw-W0mWGVkzLu6C7I,4247
74
74
  wolfhece/apps/splashscreen.py,sha256=SrustmIQeXnsiD-92OzjdGhBi-S7c_j-cSvuX4T6rtg,2929
75
- wolfhece/apps/version.py,sha256=rqw8QaFT71GR38qeOp9kpMIUqgZVxzFlK5B3lDQwa5g,388
75
+ wolfhece/apps/version.py,sha256=3A3gjGP_weec_y6tBauBg2qMw-gVkcOM1hHNYwbBK6k,388
76
76
  wolfhece/apps/wolf.py,sha256=j_CgvsL8rwixbVvVD5Z0s7m7cHZ86gmFLojKGuetMls,729
77
77
  wolfhece/apps/wolf2D.py,sha256=4z_OPQ3IgaLtjexjMKX9ppvqEYyjFLt1hcfFABy3-jU,703
78
78
  wolfhece/apps/wolf_logo.bmp,sha256=ruJ4MA51CpGO_AYUp_dB4SWKHelvhOvd7Q8NrVOjDJk,3126
@@ -283,8 +283,8 @@ wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=8PlMYrb_8jI8h9F0_EagpM
283
283
  wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=ORy7fz4dcp691qKzaOZHrRLZ0uXNhL-LIHxmpDGL6BI,5007
284
284
  wolfhece/wintab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
285
285
  wolfhece/wintab/wintab.py,sha256=8A-JNONV6ujgsgG3lM5Uw-pVgglPATwKs86oBzzljoc,7179
286
- wolfhece-2.1.71.dist-info/METADATA,sha256=8vSyAQXGeAxh_xR9kdlgShsERbzgKUbpRnP_n5NGdrE,2570
287
- wolfhece-2.1.71.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
288
- wolfhece-2.1.71.dist-info/entry_points.txt,sha256=Q5JuIWV4odeIJI3qc6fV9MwRoz0ezqPVlFC1Ppm_vdQ,395
289
- wolfhece-2.1.71.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
290
- wolfhece-2.1.71.dist-info/RECORD,,
286
+ wolfhece-2.1.72.dist-info/METADATA,sha256=DZos2AlEODsAm_6IcOCXz4XszYsIgdiXEUvXm5URAWo,2570
287
+ wolfhece-2.1.72.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
288
+ wolfhece-2.1.72.dist-info/entry_points.txt,sha256=Q5JuIWV4odeIJI3qc6fV9MwRoz0ezqPVlFC1Ppm_vdQ,395
289
+ wolfhece-2.1.72.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
290
+ wolfhece-2.1.72.dist-info/RECORD,,